Sv translation | ||
---|---|---|
| ||
IntroductionThis page describes the process of rebuilding a |
...
Slave-DB & Replication |
...
Es dürfen auf dem Master-Server keine VarCalData Einträge vorhanden sind.
...
Anmeldung in MySQL mit Credentials USER und PWD, danach Slave stoppen und MySQL wieder verlassen. Dafür folgende Befehle nutzen:
- mysql -uUSER -pPWD
- STOP SLAVE;
- QUIT;
...
- mysql -uUSER -pPWD
- SHOW MASTER STATUS \G;
- Binlog-File <Name LogFile> und Binlog-Position <Position LogFile> merken
- QUIT;
...
- mysqldump -uUSER -pPWD --databases JTELWeb JTELStats JTELLog --add-drop-database --add-drop-table --events --routines > filename
...
. Since the MySQL Dump command locks the tables, there is no need to create it when there is no traffic on the machine. It can be done during operational hours. With --master-data the command mysqldump stores the correct position for inserting the replication on the slave server.
Step-By-Step Guide
STOP SLAVELogin to the Slave Database MySQL and stop the slave SQL. Leave MySQL again afterwards. Use the following commands for this:
Phase 1 - MySQL DumpA MySQL Dump of the master database is now created. Perform the following steps to create a MySQL Dump and save it to the STORE:
jtel Portal software release
Create Backup Directory
Create MySQL Dump
To Check for MySQL Version, log in to the master database server and execute the following command
MySQL Dump - Until jtel Portal release 3.12
MySQL Dump - From jtel Portal release 3.12 until 3.31
MySQL Dump - From Release 3.32
MySQL Dump - From MySQL 8.0.27
Brief Explanation of the mysqldump command
|
|
...
|
...
|
...
|
...
- alle Zeichen "-- " durch "#" ersetzen
Phase 2 - Import Dump on Slave Database
Import Dump - tmux
Import Dump - No tmux
Check statusYou can check the progress by executing the following command on acd-dbs
Start Slave - tmux
Start Slave - No tmux
Slave Disk FullThere are several reasons why the slave disk can become full. Following is a summary of the different cases and further below is a detailed explanation:
tmp Directory Is FullIntroductionEvery time a query creates a tmp table, it is written to the temp directory, usually /tmp. This happens when the maximum size exceeds the maximum "in memory" table size. This is defined with the variables The tables in /tmp are kept until the respective DB connection is closed or a DROP TEMPORARY TABLE is called. If the /tmp directory is full, it is likely that a DROP TEMPORARY TABLE is missing somewhere. This can also happen through customer queries to the DB. The installation of tmpwatch creates help in a permanent way Hints:
Procedure
Lots of "relay logs" availableIntroductionMySQL first writes the relay logs from the master to a file. Once replication is interrupted, but the slave relay process continues to operate, the disk is filled by relay logs. This step should be done in any case, especially before the next one (ibdata too large) to make room. ProcedureThe files for the database are usually located in /var/lib/mysql If not, the location can be found in /etc/my.cnf The corresponding entry is datadir=(pfad) Delete all relay logs:
Restart MySQL service
If enough space is available (at least 20%) then proceed with the slave recovery as described above. ibdata files on the slave "very large"IntroductionThe files for the database are usually located in /var/lib/mysql Due to not clearly documented MySQL internas, the file /var/lib/mysql/ibdata1 can be huge compared to the master database. To remedy this, you have to proceed a little more rigorously. ProcedureIf no less than 100% disk can be achieved by the steps above: Unsubscribe the MySQL service from the autostart:
Restart the computer with :
Only works if less than 100% disk is reached (possibly after reboot above) then Log on to the mysql server:
Drop all JTEL databases:
Press CTRL+C to return to the command line, and then
Start MySql Server, and enable it again if necessary:
Check disk space, and proceed with Slave Restore as described above. Still no disk space > 20% freeIntroductionThe slave disk space is still full, more than 80% of the space on the drive is used by normal operation SolutionIn this case the slave is simply too small. The hard disk must be expanded (as with extending the STORE role, apply only to the logical volume where the MySQL database data resides). Then perform the steps again, if the disk is too small, then restore the slave as described above. Or the slave is completely rebuilt with a larger plate. |
Sv translation | ||
---|---|---|
| ||
Sv translation | ||
---|---|---|
|
...
- Dafür verwenden wir die folgenden Befehle
- mysql -uUSER -pPWD (Nun sind wir in MySQL)
- drop database JTELLog
- drop database JTELStats
- drop database JTELWeb
- source <filename>
- Dafür verwenden wir die folgenden Befehle
- mysql -uUSER -pPWD < filename
...
- mysql -uUSER -pPWD
- RESET SLAVE;
- CHANGE MASTER TO MASTER_LOG_FILE=<Name LogFile>, MASTER_LOG_POS = <Position LogFile>;
- START SLAVE;
...
- SHOW SLAVE STATUS \G;
...
- Slave_IO_Running: Yes
- Slave_SQL_Running: Yes
...
- Testanruf im System
- Master-Server Status prüfen
- Slave-Status prüfen
- letzter Eintrag sollte identisch sein, so dass ACD-System an sich funktioniert und auch die Replikation
...
- Login auf Master / Slave Datenbank Server
- Login in MySQL: mysql -uUSER -pPWD
- Richtige Datenbank wählen: use JTELStats
- Anrufdaten abfragen: SELECT * FROM StatisticsPartA WHERE ANUMBER LIKE '%<Anrufernummer>%' ORDER BY ID DESC LIMIT 1;
...