Configuración de MySQLFederated y Cluster
Ambiente FederadoServidor 1Servidor 2Servidor 3
Servidor RemotoServidor Local
Inicio del Servidor LocalHabilitar el motor FEDERATED para acceder a bases de datos remotasMysqld--federated
Misma estructuraServidor RemotoServidor LocalCreatetableUsers(idusuariointauto_increment,usernamevarchar(10),passwordvarchar(15),primarykey(idusuario));CreatetableUsers(idusuariointauto_increment,usernamevarchar(10),passwordvarchar(15),primarykey(idusuario))ENGINE=FEDERATED CONNECTION='mysql://fed_user@remote_host:9306/federated/test_table’;
Al crear la tablaFormato de la Cadena de Conexiónscheme://user_name[:password]@host_name[:port_num]/db_name/tbl_name ENGINE=FEDERATED CONNECTION='mysql://fed_user@remote_host:9306/federated/test_table'
MySQLClusterAmbiente distribuido
TopologíaClientesMysqlDatosCliente ManagementDatosDatosManagementApiDatos
Managementndb_mgmdndb_mgmApimysqld --ndbDatosndbdDatosndbd
Supuestos Básicos6nodos
Archivo my.ini de los nodos de datos# Optionsformysqldprocess:[mysqld] ndbcluster# run NDB storageenginendb-connectstring=192.168.0.10# Optionsforndbdprocess:[mysql_cluster] ndb-connectstring=192.168.0.10 Motor del management serverUbicación del management server
Debe estar localizado en la raíz del paquete
Archivo config.ini del nodo management# Options affecting ndbd processes on all data nodes:[ndbd default]NoOfReplicas=2 	# Number of replicasDataMemory=80M 	# How much memory to allocate for data storage IndexMemory=18M 	# How much memory to allocate for index storage # For DataMemory and IndexMemory, we have used the # default values. Since the "world" database takes up # only about 500KB, this should be more than enough for # this example Cluster setup. # TCP/IP options: [tcp default] portnumber=2202
# This the default; however, you can use any port that is free # for all the hosts in the cluster # Note: It is recommended that you do not specify the port # number at all and allow the default value to be used instead# Management process options: [ndb_mgmd]hostname=192.168.0.10 	# Hostname or IP address of management node datadir=/var/lib/mysql-cluster 	# Directory for management node log files # Options for data node "A": [ndbd] # (one [ndbd] section per data node) hostname=192.168.0.30 # Hostname or IP address datadir=/usr/local/mysql/data 	# Directory for this data node's data files
# Options for data node "B": [ndbd] hostname=192.168.0.40 # Hostname or IP address datadir=/usr/local/mysql/data  # Directory for this data node's data files # SQL node options: [mysqld] hostname=192.168.0.20  # Hostname or IP address # (additional mysqld connections can be # specified for this node for various # purposes such as running ndb_restore)
Directorio de Trabajo
Iniciar ndb_mgmd en el nodo servidorndbd-mgmd –config-file=archivoIniciar ndbd en los nodos de datosNdbdIniciar ndb-mgm en el nodo interfazndbIniciar mysqld en el nodo interfaz
Ndb-mgmShow StartbackupShutdown
ReferenciasENGINE Federatedhttp://dev.mysql.com/doc/refman/5.0/en/federated-storage-engine.htmlMySQLClusterhttp://mirror.atlanticmetro.net/mysql/doc/mysql-cluster-excerpt/5.1/en/index.html

Distribuido