31.07.2013 Views

MySQL Cluster Tutorial - cdn.oreillystatic.com

MySQL Cluster Tutorial - cdn.oreillystatic.com

MySQL Cluster Tutorial - cdn.oreillystatic.com

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Configuration<br />

my_Slave.cnf Configuration file Slave <strong>MySQL</strong> server<br />

There are two configuration files needed: one for <strong>MySQL</strong> <strong>Cluster</strong> (config.ini) and the<br />

options file for the regular <strong>MySQL</strong> server (my.cnf). The first default location for both is<br />

/etc but it re<strong>com</strong>mended to put them into a mysql subdirectory, which is also read by<br />

default: /etc/mysql/.<br />

For this tutorial we'll be putting the configuration files under /opt/mysqlcluster.<br />

First <strong>MySQL</strong> Server<br />

File /opt/mysqlcluster/my_A.cnf:<br />

[mysqld]<br />

datadir = /opt/mysqlcluster/mysql_A<br />

socket = /tmp/mysql_A<br />

port = 3306<br />

log_bin = master_A_binary<br />

server_id = 1<br />

ndbcluster<br />

Second <strong>MySQL</strong> Server<br />

File /opt/mysqlcluster/my_B.cnf:<br />

[mysqld]<br />

datadir = /opt/mysqlcluster/mysql_B<br />

socket = /tmp/mysql_B<br />

port = 3306<br />

log_bin = master_B_binary<br />

server_id = 2<br />

ndbcluster<br />

Slave <strong>MySQL</strong> Server<br />

File /opt/mysqlcluster/my_B.cnf:<br />

[mysqld]<br />

datadir=/opt/mysqlcluster/mysql_Slave<br />

port=3308<br />

socket=/tmp/mysql_Slave<br />

log_bin = master_Slave_binlog<br />

server_id = 90<br />

binlog_format = MIXED<br />

ndbcluster<br />

ndb_connectstring = localhost:1187<br />

Copyright © 2010, Oracle and/or its affiliates. All rights reserved. 11/81

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!