Installing ecss-mysql and creating replication
Оглавление |
---|
For correct MySQL replication configuration script, the following requirements must be met:
...
In the configuration window that opens, select mysql, and then enter the address <VIRTUAL_IP>.
Якорь | ||||
---|---|---|---|---|
|
To verify that data replication is working correctly, follow these steps.
Check the status of the replica. To do this, run the command:
Блок кода sudo mysql -uroot -p -e 'show slave status \G;' | grep -E "Slave_IO_Running:|Slave_SQL_Running:"
This command should show the following information on both hosts:
Блок кода Slave_IO_Running: Yes Slave_SQL_Running: Yes
Check the status of events. To do this, run the command:
Блок кода sudo mysql -uroot -p -e 'use ecss_statistics; show events\G;' | grep Status
Both hosts (on which the keepalive virtual address is present) should show the following status:
Блок кода Status: ENABLED
Checking the status table:
For the master, this number will be 1, for the slave 0Без форматирования mysql> select * from ecss_system.events_status; +--------+---------+ | lock | enabled | +--------+---------+ | events | 0 | +--------+---------+ 1 row in set (0.00 sec)
Restoring replica via mysqldump
This step must be performed in case of replication errors. Example of data recovery on ecss2 based on ecss1 is given below.
...
Без форматирования |
---|
% ,{manager, [ % {config, [ % {dir, "/etc/ecss/snmp/manager/"}, % {verbosity, silence}, % {db_dir, "/var/lib/ecss/snmp/"} % ]}, % {def_user_mod, snmp_alarm_user} % ]} |
Removing replication
In order to remove a previously created replication, use a special script:
...