...
Code Block |
---|
#Login to the master db pod ubuntu@k8s-s1-master:~$ kubectl exec -it sdnc-dbhost-0 -n onap bash Defaulting container name to sdnc-db-container. Use 'kubectl describe pod/sdnc-dbhost-0' to see all of the containers in this pod. #Login to mysql root@sdnc-dbhost-0:/etc/mysql/conf.d# mysql -u root -popenECOMP1.0 mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 46083 Server version: 5.7.21-log MySQL Community Server (GPL) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> #find out log bin position mysql> show master status; +--------------------------+----------+--------------+------------------+-------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set | +--------------------------+----------+--------------+------------------+-------------------+ | sdnc-dbhost-0-bin.000004 | 154 | | | | +--------------------------+----------+--------------+------------------+-------------------+ 1 row in set (0.00 sec) mysql> stop slave; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> #Set: # - "master_host" to peer site's 1'sK8S master node' IP address # - "master_port" to port number of the NodePort service port number # - "master_user" to user name (here 'root') # - "master_password" to user's password (here 'root' user'ds default password) # - "master_log_file" to log _file name from "show master status" commands on the peer site (Primary) # - "master_log_pos" to log_position pos from "show master status" commands on the peer site (Primary) mysql> CHANGE MASTER TO master_host='10.147.112.136', master_port=30031, master_user='root', master_password='openECOMP1.0', master_log_file='sdnc-dbhost-0-bin.000004000002', master_log_pos=37433012; mysql> start slave; Query OK, 0 rows affected (0.00 sec) mysql> |
...
Code Block |
---|
#Login to the master db pod ubuntu@k8s-s1-master:~$ kubectl exec -it sdnc-dbhost-0 -n onap bash Defaulting container name to sdnc-db-container. Use 'kubectl describe pod/sdnc-dbhost-0' to see all of the containers in this pod. #Login to mysql root@sdnc-dbhost-0:/etc/mysql/conf.d# mysql -u root -popenECOMP1.0 mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 46083 Server version: 5.7.21-log MySQL Community Server (GPL) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> #find out log bin position mysql> show master status; +--------------------------+----------+--------------+------------------+-------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set | +--------------------------+----------+--------------+------------------+-------------------+ | sdnc-dbhost-0-bin.000004000003 | 37433012 | | | | +--------------------------+----------+--------------+------------------+-------------------+ 1 row in set (0.00 sec) mysql> stop slave; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> #Set: # - "master_host" to peer site's 1'sK8S master node' IP address # - "master_port" to port number of the NodePort service port number # - "master_user" to user name (here 'root') # - "master_password" to user's password (here 'root' user'ds default password) # - "master_log_file" to log _file name from "show master status" commands on peer site (Seconday) # - "master_log_pos" to log pos_position from "show master status" commands on the peer site (Seconday) mysql> CHANGE MASTER TO master_host='10.147.113.36', master_port=30031, master_user='root', master_password='openECOMP1.0', master_log_file='sdnc-dbhost-0-bin.000004',master_log_pos=154; Query OK, 0 rows affected, 2 warnings (0.01 sec) mysql> start slave; Query OK, 0 rows affected (0.00 sec) mysql> |
...