# loggingRemember, other_server is the only different on the two machines. Each point to the other. Even though the SSL certs are named the same, they are unique for each. The port listed in CHANGE TO MASTER will be the client accept (3307 in this example.)
debug=4
output=/opt/stunnel/server.log
# setup
pid=/opt/stunnel/server.pid
foreground=no
setuid=nobody
setgid=nobody
[repliserver]
accept=3308
connect=127.0.0.1:3306
client=no
# ssl
cert=/etc/stunnel/server.pem
CAfile=/etc/stunnel/server.ca
verify=2
[repliclient]
accept=127.0.0.1:3307
connect=other_server:3308
client=yes
# ssl
cert=/etc/stunnel/server.pem
To test, from both machines issue:
mysql -h 127.0.0.1 --port 3307 -e "SHOW DATABASES;"Add user names and passwords as needed.
One last note: The ports (3307 in this example) can be anything, but absolutely must be the same port number on master and all slaves.
No comments:
Post a Comment