Replication
- the
--read-only
switch (orread_only
in my.cnf) it’s the best way to block unwanted writes in a replication slave. So, ditch your specific user’s privileges :) log-slave-updates
in my.cnf needs underscores _ because with normal dashes doesn’t work at all (at least with Mysql 5.1.22). So, it’slog_slave_updates
- Talking about
log_slave_updates
again, it’s fundamental if you’re mounting a circular replication system. Without it, replication will stop at first hop. SET GLOBAL SQL_SLAVE_SKIP_COUNTER=n
could be usefull if you have to skip on a replication error. Be careful anyway because it can lead to logical inconsistences in your data if abused.
Cluster
- When starting up data nodes using ndbd, you can add the
--nostart
flag to have the process in memory without doing nothing. Then, you can tell the node to actually start working from the management console withID_node start
. Moreover, you can put the nostart flag in your config.ini, in the[ndbd default]
section, if you want the change to apply to every node. - in the management console, as said, you can start (or stop, or restart) the data nodes manually, but if you try with the SQL nodes, you’ll get a strange error. That’s because SQL nodes can only be restarted from the local machine, as it were a normal mysql installation (in fact, it is a normal mysql install :)
Mysql Proxy
- If you are trying to execute mysql-proxy with a LUA script, and you have the scripts tree in /usr/share/mysql-proxy, then you have to issue a command like this, otherways mysql-proxy will complain about LUA includes that cannot be found:
LUA_PATH=/usr/share/mysql-proxy/?.lua mysql-proxy --proxy-backend-addresses=192.168.45.112:3306 --proxy-lua-script=/usr/share/mysql-proxy/rw-splitting.lua
–read-only option was introduced in 4.0.14
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_read_only
When you set it dynamically it only applies to new threads. Existing connected threads could still operate in a read-write fashion.
I trust what you’re saying Matthew, but then I need to find out why (I cannot remember right now) I updated the post that way.
Anyway, reverting to the original, and thanks for the suggestion