中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

proxysql配置信息清理、備份、還原

發布時間:2020-06-28 18:52:02 來源:網絡 閱讀:421 作者:xingzhehxiang 欄目:MySQL數據庫

1、緊接上文,配置過程請看上文
2、進入proxysql數據目錄

[root@12c proxysql]# cd /var/lib/proxysql/
[root@12c proxysql]# ll
total 344
-rw-rw-r-- 1 proxysql proxysql   1050 Jul 18 13:45 proxysql-ca.pem
-rw-rw-r-- 1 proxysql proxysql   1058 Jul 18 13:45 proxysql-cert.pem
-rw------- 1 proxysql proxysql 163840 Jul 18 14:49 proxysql.db
-rw-rw-r-- 1 proxysql proxysql   1679 Jul 18 13:45 proxysql-key.pem
-rw------- 1 proxysql proxysql  26369 Jul 18 16:20 proxysql.log
-rw-r--r-- 1 proxysql proxysql      5 Jul 18 14:24 proxysql.pid
-rw------- 1 proxysql proxysql 143360 Jul 18 16:22 proxysql_stats.db 

3、備份目錄

[root@12c proxysql]# cd ..
[root@12c lib]# tar -cvzf proxysql.tar.gz proxysql
proxysql/
proxysql/proxysql-key.pem
proxysql/proxysql-ca.pem
proxysql/proxysql-cert.pem
proxysql/proxysql.log
proxysql/proxysql_stats.db
proxysql/proxysql.db
proxysql/proxysql.pid
[root@12c lib]# cd  proxysql/
[root@12c proxysql]# ll
total 344
-rw-rw-r-- 1 proxysql proxysql   1050 Jul 18 13:45 proxysql-ca.pem
-rw-rw-r-- 1 proxysql proxysql   1058 Jul 18 13:45 proxysql-cert.pem
-rw------- 1 proxysql proxysql 163840 Jul 18 14:49 proxysql.db
-rw-rw-r-- 1 proxysql proxysql   1679 Jul 18 13:45 proxysql-key.pem
-rw------- 1 proxysql proxysql  26369 Jul 18 16:20 proxysql.log
-rw-r--r-- 1 proxysql proxysql      5 Jul 18 14:24 proxysql.pid
-rw------- 1 proxysql proxysql 143360 Jul 18 16:23 proxysql_stats.db

4、關閉并清空

[root@12c proxysql]# /etc/init.d/proxysql stop
Shutting down ProxySQL: DONE!
[root@12c proxysql]# rm *.* -f
[root@12c proxysql]# ll
total 0

5、啟動并觀察

[root@12c proxysql]# /etc/init.d/proxysql start
Starting ProxySQL: 2019-07-18 16:24:16 [INFO] Using config file /etc/proxysql.cnf
2019-07-18 16:24:16 [INFO] No SSL keys/certificates found in datadir (/var/lib/proxysql). Generating new keys/certificates.
DONE!
[root@12c proxysql]# mysql -u admin -padmin -h 127.0.0.1 -P6032 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.30 (ProxySQL Admin Module)

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

admin@127.0.0.1 [(none)] 04:24:23>>>SELECT * FROM mysql_servers;
Empty set (0.00 sec)

admin@127.0.0.1 [(none)] 04:25:03>>>exit
Bye

6、關閉后恢復

[root@12c proxysql]# /etc/init.d/proxysql stop
Shutting down ProxySQL: DONE!
[root@12c proxysql]# ..
[root@12c proxysql]# ll
total 308
-rw-rw-r-- 1 proxysql proxysql   1050 Jul 18 16:24 proxysql-ca.pem
-rw-rw-r-- 1 proxysql proxysql   1058 Jul 18 16:24 proxysql-cert.pem
-rw------- 1 proxysql proxysql 163840 Jul 18 16:24 proxysql.db
-rw-rw-r-- 1 proxysql proxysql   1679 Jul 18 16:24 proxysql-key.pem
-rw------- 1 proxysql proxysql   4095 Jul 18 16:25 proxysql.log
-rw------- 1 proxysql proxysql 135168 Jul 18 16:24 proxysql_stats.db
[root@12c proxysql]# rm *.* -f
[root@12c proxysql]# cd ..
[root@12c lib]# tar -xvzf proxysql.tar.gz 
proxysql/
proxysql/proxysql-key.pem
proxysql/proxysql-ca.pem
proxysql/proxysql-cert.pem
proxysql/proxysql.log
proxysql/proxysql_stats.db
proxysql/proxysql.db
proxysql/proxysql.pid

7、啟動后重新觀察

[root@12c lib]# /etc/init.d/proxysql start
Starting ProxySQL: Removed stale pid file: /var/lib/proxysql/proxysql.pid
2019-07-18 16:25:53 [INFO] Using config file /etc/proxysql.cnf
2019-07-18 16:25:53 [INFO] SSL keys/certificates found in datadir (/var/lib/proxysql): loading them.
DONE!
[root@12c lib]# mysql -u admin -padmin -h 127.0.0.1 -P6032 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.30 (ProxySQL Admin Module)

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

admin@127.0.0.1 [(none)] 04:26:15>>>SELECT * FROM mysql_servers;
+--------------+---------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| hostgroup_id | hostname      | port | gtid_port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
+--------------+---------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| 10           | 192.168.56.11 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 0       | 0              |         |
| 20           | 192.168.56.11 | 3307 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 0       | 0              |         |
+--------------+---------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
2 rows in set (0.00 sec)

admin@127.0.0.1 [(none)] 04:26:16>>>exit
Bye

8、查看路由規律

[root@12c lib]# mysql -urootuser -p123456 -h292.168.56.11  -P6033 -e "SELECT @@server_id;"  
+-------------+
| @@server_id |
+-------------+
|          11 |
+-------------+
[root@12c lib]#  mysql -urootuser -p123456 -h292.168.56.11 -P6033 -e "BEGIN;SELECT @@server_id;commit;"
+-------------+
| @@server_id |
+-------------+
|           1 |
+-------------+
向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

宁陵县| 雷州市| 灵武市| 平潭县| 白河县| 武定县| 星子县| 嘉峪关市| 额济纳旗| 颍上县| 马龙县| 响水县| 高州市| 广西| 扬中市| 威远县| 平谷区| 连江县| 江西省| 广元市| 赫章县| 筠连县| 丹巴县| 贵州省| 康马县| 中超| 霍州市| 富锦市| 彩票| 贵阳市| 昌乐县| 永兴县| 左云县| 井陉县| 米脂县| 阳西县| 霸州市| 德庆县| 吉木乃县| 孟津县| 且末县|