Use the following instructions to prepare the database:
On both clusters, make sure the following lines are in the MySQL my.cnf configuration file.
On Cluster 1:
# GoldenGate requirements log-bin=/mys2/data/logs/bin-log log-bin-index=/mys2/data/logs/bin-log.index max_binlog_size=4096 binlog-format=ROW # GoldenGate requirements end
On Cluster 2
# GoldenGate requirements log-bin=/mys1/data/logs/bin-log log-bin-index=/mys1/data/logs/bin-log.index max_binlog_size=4096 binlog-format=ROW # GoldenGate requirements end
In both clusters, set the socket to the following value in the my.cnf file:
socket=/tmp/mysql.sock
As of the time of creating this deployment example, /tmp/mysql.sock must be used as the socket for the MySQL database. Check your Oracle GoldenGate documentation for the latest information.
Restart the database resource as shown:
psoma1 # clrs disable mys-rs psoma1 # clrs enable mys-rs vzsoma1a # clrs disable mys-rs vzsoma1a # clrs enable mys-rs
On both clusters, create a database to be replicated and an User for Oracle GoldenGate.
For for the sake of simplicity, in a lab install make the gg user as the administrator.
root@psoma1:~# /usr/local/mysql/bin/mysql -S /tmp/mysql.sock -uroot -proot mysql> use mysql mysql> GRANT ALL ON *.* TO 'gg'@'localhost' IDENTIFIED BY 'gg'; mysql> GRANT ALL ON *.* TO 'gg'@'psoma1' IDENTIFIED BY 'gg'; mysql> GRANT ALL ON *.* TO 'gg'@'psoma2' IDENTIFIED BY 'gg'; mysql> GRANT ALL ON *.* TO 'gg'@'soma-3' IDENTIFIED BY 'gg'; mysql> create database golden; mysql> exit root@psoma1:~# /usr/local/mysql/bin/mysql -h soma-3 -ugg -pgg mysql> use golden mysql> create table tab1 (row1 int not null, row2 char(64)); mysql> create unique index ind1 on tab1(row1); root@vzsoma1a:~# /usr/local/mysql/bin/mysql -S /tmp/mysql.sock -uroot -proot mysql> use mysql mysql> GRANT ALL ON *.* TO 'gg'@'localhost' IDENTIFIED BY 'gg'; mysql> GRANT ALL ON *.* TO 'gg'@'vzsoma2a' IDENTIFIED BY 'gg'; mysql> GRANT ALL ON *.* TO 'gg'@'vzsoma2a' IDENTIFIED BY 'gg'; mysql> GRANT ALL ON *.* TO 'gg'@'soma-1' IDENTIFIED BY 'gg'; mysql> create database golden; mysql> exit root@vzsoma1a:~# /usr/local/mysql/bin/mysql -h soma-3 -ugg -pgg mysql> use golden mysql> create table tab1 (row1 int not null, row2 char(64)); mysql> create unique index ind1 on tab1(row1); mysql> exit