In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article shares with you the content of a sample analysis of the multi-instance database configuration of a rocks mysql database. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Mysql database default path modification
Start the httpd service
Mkdir-p / run/httpd
Systemctl start httpd.service1. What is multiple instances?
Representative in linux system: multiple processes + multiple threads + multiple pre-allocated memory structures
Generally used in the test environment, test master-slave, high availability and so on.
Multi-instance configuration scheme: (multiple database management systems)
Port port separate configuration files separate socket separate logs separate multiple serverid can use mysql user # summary, initialize multiple databases
Create directory modification permissions
Mkdir / share/work/mysqlmkdir / share/work/mysql/3306
Chown mysql:mysql-R / share/work/mysql
Modify the mysql configuration file, execute the "vi / share/work/mysql/3306/my.cnf" command, and determine.
Cp / etc/my.cnf / share/work/mysql
[mysqld] basedir=/opt/rocks/mysqldatadir=/share/work/mysql/3306/dataport=3306socket=/share/work/mysql/3306/mysql.socklog-error=/share/work/mysql/3306/data/mysql.errlog-bin=/share/work/mysql/3306/data/mysql-binserver_id=7
Install the database
Groupadd mysql
Useradd-r-g mysql mysql
-- skip-grant-tables
Set up boot boot:
Initialize the password and authorize remote login
/ share/work/mysql/3306/mysql.sock
# 6. Close multiple instances
[root@db01 scripts] # mysqladmin-S / share/work/mysql/3306/mysql.sock shutdown
# 7. Check Port
[root@db01 scripts] # netstat-lntup | grep 330
Tcp6 0 0: 3306: * LISTEN 25550/mysqld
# 8. Set multi-instance password
[root@db01 scripts] # mysqladmin-uroot-S / share/work/mysql/3306/mysql.sock password '3306'
# 9. Verify the library connection (view server_id)
[root@db01 scripts] # mysql-uroot-p3306-S / share/work/mysql/3306/mysql.sock-e "show variables like 'server_id';" Warning: Using a password on the command line interface can be insecure.
+-+ +
| | Variable_name | Value |
+-+ +
| | server_id | 7 | |
+-+ +
Thank you for reading! On the "rocks mysql database multi-instance database configuration example analysis" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it out for more people to see it!
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.