[Checkins] SVN: relstorage/trunk/repltest/ auto-configure the slave.
Shane Hathaway
shane at hathawaymix.org
Sat Oct 3 20:13:46 EDT 2009
Log message for revision 104772:
auto-configure the slave.
Changed:
U relstorage/trunk/repltest/master/buildout.cfg
U relstorage/trunk/repltest/master/replicas.conf
U relstorage/trunk/repltest/slave/buildout.cfg
-=-
Modified: relstorage/trunk/repltest/master/buildout.cfg
===================================================================
--- relstorage/trunk/repltest/master/buildout.cfg 2009-10-03 22:23:31 UTC (rev 104771)
+++ relstorage/trunk/repltest/master/buildout.cfg 2009-10-04 00:13:45 UTC (rev 104772)
@@ -1,6 +1,7 @@
[buildout]
develop = ../..
+ ../../../../plone.recipe.zope2instance/trunk
parts =
mysqlconf
mysql
@@ -25,6 +26,7 @@
zc.buildout = 1.4.1
ZODB3 = 3.8.3-polling
zope.proxy = 3.4.2
+plone.recipe.zope2instance = 3.6dev
[mysqlconf]
recipe = collective.recipe.template
@@ -60,12 +62,14 @@
${mysql:location}/bin/mysql_install_db
${mysql:location}/bin/mysqld_safe &
sleep 5
+
${buildout:directory}/bin/mysql -u root << EOF
- SHOW MASTER STATUS;
CREATE DATABASE plone;
GRANT ALL ON plone.* TO 'plone'@'localhost' IDENTIFIED BY 'plonepass';
GRANT REPLICATION SLAVE ON *.* TO 'repl'@'localhost' IDENTIFIED BY 'slavepass';
FLUSH PRIVILEGES;
+ RESET MASTER;
+ SHOW MASTER STATUS;
EOF
kill `cat ${mysqlconf:datadir}/mysqld.pid`
Modified: relstorage/trunk/repltest/master/replicas.conf
===================================================================
--- relstorage/trunk/repltest/master/replicas.conf 2009-10-03 22:23:31 UTC (rev 104771)
+++ relstorage/trunk/repltest/master/replicas.conf 2009-10-04 00:13:45 UTC (rev 104772)
@@ -1,6 +1,5 @@
# The list of replicas for RelStorage to contact.
-# Note that MySQL interprets "localhost" specially. We have to
-# use "127.0.0.1" instead.
-localhost
+# Note that MySQL uses a socket file instead of TCP/IP if the host
+# is "localhost". Use "127.0.0.1" instead.
127.0.0.1:23306
127.0.0.1:23307
Modified: relstorage/trunk/repltest/slave/buildout.cfg
===================================================================
--- relstorage/trunk/repltest/slave/buildout.cfg 2009-10-03 22:23:31 UTC (rev 104771)
+++ relstorage/trunk/repltest/slave/buildout.cfg 2009-10-04 00:13:45 UTC (rev 104772)
@@ -39,6 +39,23 @@
test -e ${mysqlconf:datadir}/mysql && exit 0
mkdir -p ${mysqlconf:datadir}
${mysql:location}/bin/mysql_install_db
+ ${mysql:location}/bin/mysqld_safe &
+ sleep 5
+ ${buildout:directory}/bin/mysql -u root << EOF
+ CREATE DATABASE plone;
+ GRANT ALL ON plone.* TO 'plone'@'localhost' IDENTIFIED BY 'plonepass';
+ FLUSH PRIVILEGES;
+ CHANGE MASTER TO
+ MASTER_HOST='127.0.0.1',
+ MASTER_USER='repl',
+ MASTER_PASSWORD='slavepass',
+ MASTER_PORT=23306,
+ MASTER_LOG_FILE='mysql-bin.000001',
+ MASTER_LOG_POS=4,
+ MASTER_CONNECT_RETRY=10;
+ START SLAVE;
+ EOF
+ kill `cat ${mysqlconf:datadir}/mysqld.pid`
[pidproxy]
recipe = zc.recipe.egg
More information about the checkins
mailing list