Distribuido

1,240 views

Published on

Configuracion de Mysql en ambiente Federado y Distribuido

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,240
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
18
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Distribuido

  1. 1. Configuración de MySQL<br />Federated y Cluster<br />
  2. 2. Ambiente Federado<br />Servidor 1<br />Servidor 2<br />Servidor 3<br />
  3. 3. Servidor Remoto<br />Servidor Local<br />
  4. 4. Inicio del Servidor Local<br />Habilitar el motor FEDERATED para acceder a bases de datos remotas<br />Mysqld--federated<br />
  5. 5. Misma estructura<br />Servidor Remoto<br />Servidor Local<br />CreatetableUsers(<br />idusuariointauto_increment,<br />usernamevarchar(10),<br />passwordvarchar(15),<br />primarykey(idusuario));<br />CreatetableUsers(<br />idusuariointauto_increment,<br />usernamevarchar(10),<br />passwordvarchar(15),<br />primarykey(idusuario))<br />ENGINE=FEDERATED <br />CONNECTION=<br />'mysql://fed_user@remote_host:9306/federated/test_table’;<br />
  6. 6. Al crear la tabla<br />Formato de la Cadena de Conexión<br />scheme://user_name[:password]@host_name[:port_num]/db_name/tbl_name <br />ENGINE=FEDERATED CONNECTION='mysql://fed_user@remote_host:9306/federated/test_table'<br />
  7. 7. MySQLCluster<br />Ambiente distribuido<br />
  8. 8. Topología<br />Clientes<br />Mysql<br />Datos<br />Cliente <br />Management<br />Datos<br />Datos<br />Management<br />Api<br />Datos<br />
  9. 9. Management<br />ndb_mgmd<br />ndb_mgm<br />Api<br />mysqld --ndb<br />Datos<br />ndbd<br />Datos<br />ndbd<br />
  10. 10. Supuestos Básicos<br />6nodos<br />
  11. 11. Archivo my.ini de los nodos de datos<br /># Optionsformysqldprocess:<br />[mysqld] <br />ndbcluster<br /># run NDB storageengine<br />ndb-connectstring=192.168.0.10<br /># Optionsforndbdprocess:<br />[mysql_cluster] <br />ndb-connectstring=192.168.0.10 <br />Motor del management server<br />Ubicación del management server<br />
  12. 12. Debe estar localizado en la raíz del paquete<br />
  13. 13. Archivo config.ini del nodo management<br /># Options affecting ndbd processes on all data nodes:<br />[ndbd default]<br />NoOfReplicas=2 # Number of replicas<br />DataMemory=80M # How much memory to allocate for data storage <br />IndexMemory=18M # How much memory to allocate for index storage <br /># For DataMemory and IndexMemory, we have used the <br /># default values. Since the "world" database takes up <br /># only about 500KB, this should be more than enough for <br /># this example Cluster setup. <br /># TCP/IP options: <br />[tcp default] <br />portnumber=2202 <br />
  14. 14. # This the default; however, you can use any port that is free <br /># for all the hosts in the cluster <br /># Note: It is recommended that you do not specify the port <br /># number at all and allow the default value to be used instead<br /># Management process options: <br />[ndb_mgmd]<br />hostname=192.168.0.10 # Hostname or IP address of management node <br />datadir=/var/lib/mysql-cluster # Directory for management node log files <br /># Options for data node "A": <br />[ndbd] <br /># (one [ndbd] section per data node) <br />hostname=192.168.0.30 # Hostname or IP address <br />datadir=/usr/local/mysql/data # Directory for this data node's data files <br />
  15. 15. # Options for data node "B": <br />[ndbd] <br />hostname=192.168.0.40 # Hostname or IP address <br />datadir=/usr/local/mysql/data # Directory for this data node's data files <br /># SQL node options: <br />[mysqld] <br />hostname=192.168.0.20 # Hostname or IP address <br /># (additional mysqld connections can be <br /># specified for this node for various <br /># purposes such as running ndb_restore) <br />
  16. 16. Directorio de Trabajo<br />
  17. 17. Iniciar ndb_mgmd en el nodo servidor<br />ndbd-mgmd –config-file=archivo<br />Iniciar ndbd en los nodos de datos<br />Ndbd<br />Iniciar ndb-mgm en el nodo interfaz<br />ndb<br />Iniciar mysqld en el nodo interfaz<br />
  18. 18. Ndb-mgm<br />Show <br />Startbackup<br />Shutdown<br />
  19. 19. Referencias<br />ENGINE Federated<br />http://dev.mysql.com/doc/refman/5.0/en/federated-storage-engine.html<br />MySQLCluster<br />http://mirror.atlanticmetro.net/mysql/doc/mysql-cluster-excerpt/5.1/en/index.html<br />

×