In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces you how to manage MySQL multi-instance configuration. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.
MySQL multi-instance configuration management configuration multi-instance my.cnf:
[root@open_source 3309] # cat / mysql/3307/my.cnf [mysqld] user=mysqlbasedir=/usr/local/mysqldatadir=/mysql/3307/datasocket=/tmp/mysql3307.sockport=3307server_id= 7 [root @ open_source 3309] # cat / mysql/3308/my.cnf [mysqld] user=mysqlbasedir=/usr/local/mysqldatadir=/mysql/3308/datasocket=/tmp/mysql3308.sockport=3308server_id= 8 [root @ open_source 3309] # cat / mysql/3309/my.cnf [mysqld] user=mysqlbasedir=/usr/local/mysqldatadir=/mysql/3309/datasocket=/tmp/mysql3309.sockport=3309server_id=9 initializes multiple instances
Mysqld-- initialize-insecure-- user=mysql-- basedir=/usr/local/mysql-- datadir=/mysql/3307/data/mysqld-- initialize-insecure-- user=mysql-- basedir=/usr/local/mysql-- datadir=/mysql/3308/data/mysqld-- initialize-insecure-- user=mysql-- basedir=/usr/local/mysql-- datadir=/mysql/3309/data/ starts multiple instances:
[root@open_source 3309] # mysqld_safe-- defaults-file=/mysql/3307/my.cnf & [root@open_source 3309] # mysqld_safe-- defaults-file=/mysql/3308/my.cnf & [root@open_source 3309] # mysqld_safe-- defaults-file=/mysql/3309/my.cnf & [root@open_source 3309] # ps-ef | grep mysql | grep-v greproot 10251 7511 0 18:57 pts/1 00:00:00 / bin/sh / usr/local/mysql/bin/mysqld_safe-defaults-file=/mysql/3307/my.cnfmysql 10428 10251 0 18:57 pts/1 00:00:00 / usr/local/mysql/bin/mysqld-- defaults-file=/mysql/3307/my.cnf-- basedir=/usr/local/mysql-- datadir=/mysql/3307/data-- plugin-dir=/usr/local/mysql/lib/plugin-- user=mysql-- log-error=open_source.err-- pid-file=open_source.pid- -socket=/tmp/mysql3307.sock-port=3307root 10464 7511 0 18:59 pts/1 00:00:00 / bin/sh / usr/local/mysql/bin/mysqld_safe-- defaults-file=/mysql/3308/my.cnfmysql 10641 10464 0 18:59 pts/1 00:00:01 / usr/local/mysql/bin/mysqld-- defaults-file=/mysql/3308/my.cnf-- basedir=/usr/local/mysql-- datadir=/mysql/3308/data-- plugin- Dir=/usr/local/mysql/lib/plugin-user=mysql-log-error=open_source.err-pid-file=open_source.pid-socket=/tmp/mysql3308.sock-port=3308root 10672 7511 0 19:00 pts/1 00:00:00 / bin/sh / usr/local/mysql/bin/mysqld_safe-defaults-file=/mysql/3309/my.cnfmysql 10849 10672 0 19:00 pts/1 00:00:01 / usr/local/mysql/bin/mysqld-- Defaults-file=/mysql/3309/my.cnf-- basedir=/usr/local/mysql-- datadir=/mysql/3309/data-- plugin-dir=/usr/local/mysql/lib/plugin-- user=mysql-- log-error=open_source.err-- pid-file=open_source.pid-- socket=/tmp/mysql3309.sock-- port= 3309 [root @ open_source 3309] # netstat-anlt | grep 33tcp6 0: 3307:: * LISTEN tcp6 0 0: 3308: * LISTEN tcp6 0 0: 3309: * LISTEN log in to multi-instance server_id:
[root@open_source 3309] # mysql-S / tmp/mysql3307.sock-e "select @ @ server_id" +-+ | @ server_id | +-+ | 7 | +-+ [root@open_source 3309] # mysql-S / tmp/mysql3308.sock-e "select @ @ server_id" +- -+ | @ @ server_id | +-+ | 8 | +-+ [root@open_source 3309] # mysql-S / tmp/mysql3309.sock-e "select @ @ server_id" +-+ | @ server_id | +-+ | 9 | +-- -+ stop multiple instances:
[root@open_source] # mysqladmin-S / tmp/mysql3307.sock shutdown2020-03-10T00:04:36.491980Z mysqld_safe mysqld from pid file / mysql/3307/data/open_source.pid ended [1] Done mysqld_safe-- defaults-file=/mysql/3307/my.cnf (wd: / mysql/3309) (wd now: ~) [root@open_source ~] # mysqladmin-S / tmp/mysql3308.sock shutdown2020-03-10T00:04 : 45.304744Z mysqld_safe mysqld from pid file / mysql/3308/data/open_source.pid ended [2]-Done mysqld_safe-- defaults-file=/mysql/3308/my.cnf (wd: / mysql/3309) (wd now: ~) [root@open_source] # mysqladmin-S / tmp/mysql3309.sock shutdown2020-03-10T00:04:54.383289Z mysqld_safe mysqld from pid file / mysql/3309/data/open_source.pid ended [3] + Done mysqld_safe-- defaults-file=/mysql/3309/my.cnf (wd: / mysql/3309) (wd now: ~) on how to manage MySQL multi-instance configuration, that's all. I hope the above content can be of some help to you and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.