Примечание
Таблица 17.2. Системные требования
Компонент
|
Количество
|
ОЗУ
|
ЦП
|
Диск
|
---|---|---|---|---|
SQL Server
|
2
|
1 ГБ
|
2 vCPUs
|
10 ГБ
|
HAProxy
|
2
|
1 ГБ
|
2 vCPUs
|
10 ГБ
|
OpenUDS Server
|
2
|
2 ГБ
|
2 vCPUs
|
8 ГБ
|
OpenUDS Tunnel
|
2
|
2 ГБ
|
2 vCPUs
|
13 ГБ
|
Примечание
# apt-get install mariadb
Запустить сервер MySQL и добавить его в автозагрузку:
# systemctl enable --now mariadb.service
Задать пароль root и настройки безопасности для MySQL:
# mysql_secure_installation
/etc/my.cnf.d/server.cnf
:
skip-networking
;
server-id
и log-bin
;
server-id
установлено значение 1;
bind-address
и указать IP-адрес сервера (главного):
bind-address 192.168.0.128
# systemctl restart mariadb
$ mysql -p
MariaDB [(none)]> CREATE USER 'replica'@'%' IDENTIFIED BY 'uds';
Query OK, 0 rows affected (0.009 sec)
replication slave
пользователю:
MariaDB [(none)]> GRANT REPLICATION SLAVE ON *.* TO 'replica'@'%' IDENTIFIED BY 'uds';
Query OK, 0 rows affected (0.002 sec)
MariaDB [(none)]> SHOW MASTER STATUS\G
*************************** 1. row ***************************
File: mysql-bin.000002
Position: 328
Binlog_Do_DB:
Binlog_Ignore_DB:
1 row in set (0.001 sec)
/etc/my.cnf.d/server.cnf
:
skip-networking
;
server-id
и log-bin
;
server-id
установить значение 2;
bind-address
и указать IP-адрес сервера (вторичного):
bind-address 192.168.0.129
# systemctl restart mariadb
$ mysql -p
MariaDB [(none)]> STOP SLAVE;
Query OK, 0 rows affected, 1 warning (0.001 sec)
MariaDB [(none)]> CHANGE MASTER TO MASTER_HOST='192.168.0.128', MASTER_USER='replica', MASTER_PASSWORD='uds', MASTER_LOG_FILE='mysql-bin.000002', MASTER_LOG_POS=328;
Query OK, 0 rows affected (0.020 sec)
MariaDB [(none)]> START SLAVE;
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> SHOW SLAVE STATUS\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.0.128
Master_User: replica
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000004
Read_Master_Log_Pos: 328
Relay_Log_File: mysqld-relay-bin.000006
Relay_Log_Pos: 555
Relay_Master_Log_File: mysql-bin.000004
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
…
Slave_IO_Running
и Slave_SQL_Running
должны быть установлены в значение «Yes».
MariaDB [(none)]> CREATE DATABASE replicatest;
Query OK, 1 row affected (0.001 sec)
MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| replicatest |
+--------------------+
4 rows in set (0.001 sec)
MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| replicatest |
+--------------------+
4 rows in set (0.002 sec)
MariaDB [(none)]> DROP DATABASE replicatest;
$mysql -p
Enter password: MariaDB [(none)]>CREATE DATABASE dbuds CHARACTER SET utf8 COLLATE utf8_general_ci;
MariaDB [(none)]>CREATE USER 'dbuds'@'%' IDENTIFIED BY 'password';
MariaDB [(none)]>GRANT ALL PRIVILEGES ON dbuds.* TO 'dbuds'@'%';
MariaDB [(none)]>FLUSH PRIVILEGES;
MariaDB [(none)]>exit;
/var/server/server/settings.py
указать параметры новой БД (это необходимо сделать на всех серверах OpenUDS-Server).
Примечание
# mysqldump -u dbuds -ppassword --databases dbuds > dbuds_dump.sql