[ Part 5 ] Channel creation and Replication

Steps to be implemented:

  • Deploy the Channel

  • Check Channel's status

  • Perform replication

[ 1 ] Deploy the Channel

[ 1.1 ] Go back to Cloud Shell:

root@mysqlshellinstance:/home# exit
logout
ubuntu@mysqlshellinstance:~$ exit
logout
Connection to 129.159.241.250 closed.
florentina@cloudshell:MdsReplication (eu-frankfurt-1)$ 

[ 1.2 ] Create the Channel, by applying resource targetting:

zack@cloudshell:MdsReplication (eu-frankfurt-1)$ cp channel/create_channel.tf .
zack@cloudshell:MdsReplication (eu-frankfurt-1)$ terraform apply -target oci_mysql_channel.MySqlOciChannel    

[ 2 ] Check the status of the Channel

After applying the resource targetting, go to Menu > MySQL > Channels

The status of the Channel should be active:

[ 3 ] Perform replication

[ 3.1 ] Log in back to mysqlshellinstance:

zack@cloudshell:MdsReplication (eu-frankfurt-1)$ terraform output
MySqlSourceIP = 129.159.241.250
zack@cloudshell:MdsReplication (eu-frankfurt-1)$ ssh ubuntu@129.159.241.250

[ ... snip ... ]

ubuntu@mysqlshellinstance:~$ sudo -i
root@mysqlshellinstance:~# 

[ 3.2 ] Download test2.sql script,

root@mysqlshellinstance:~# cd /home
root@mysqlshellinstance:/home#
root@mysqlshellinstance:/home# wget https://raw.githubusercontent.com/isaac-kami/MdsReplication/main/test2.sql    

[ 3.3 ] From same location where you saved the test2.sql, log in to MySQL client:

root@mysqlshellinstance:/home# mysql -uroot -pabc123!
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.

[ ... snip ... ]
mysql>

[ 3.4 ] Create another database & populated tablespace with source command:

mysql> source test2.sql
Query OK, 1 row affected (0.01 sec)

Query OK, 0 rows affected (0.03 sec)

Query OK, 1 row affected (0.00 sec)

mysql> select * from testing.test;
+-------+--------+
| fruit | veggie |
+-------+--------+
| apple | salad  |
+-------+--------+
1 row in set (0.00 sec)

mysql> 

mysql> \q
Bye

[ 3.5 ] Log in to MDS by using mysql-shell, switch to SQL mode and check if new database appears:

root@mysqlshellinstance:/home# mysqlsh -uusermds -h10.0.1.5 -pABCabc123$%
MySQL Shell 8.0.23

[ ... snip ... ]

 MySQL  10.0.1.5:33060+ ssl  JS > \sql
Switching to SQL mode... Commands end with ;
 MySQL  10.0.1.5:33060+ ssl  SQL > 
 MySQL  10.0.1.5:33060+ ssl  SQL > select * from testing.test;
+-------+--------+
| fruit | veggie |
+-------+--------+
| apple | salad  |
+-------+--------+
1 row in set (0.0006 sec)
 MySQL  10.0.1.5:33060+ ssl  SQL > \q
 Bye!

Last updated