In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Previously, I wrote a simple shell script that can quickly deploy tests in a simple MySQL Group Replication environment. You can quickly create multiple instance nodes in more than a minute. If you want to try MGR, you are recommended to try it.
I have tested it by hand several times, and it can still be used. It is not classy, but it can basically meet the needs. Today, I took the time to improve it and deployed one in a brand-new environment, which was quite smooth.
I would like to talk briefly about this small project and hope that everyone will work together to improve it step by step.
If you want to achieve rapid deployment of MGR, here are some basic steps.
1. First of all, you need to download the MySQL software, configure / etc/hosts file, download the binary package without any installation, just unpack it and put it in the specified directory, such as / usr/local/mysql. The latest version is the official 5.7.19 assuming 10.127.1.18 is the IP of the server, so you should pay special attention to it in / etc/hosts and make sure it is configured. For example, the contents of the / etc/hosts file: 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain610.127.1.18 mysqltestdb2. There is a unified configuration file auto.cnf, in which you can configure the path of the MySQL software and the path of the data file. There is no fixed content, it is based on your needs and specific configuration. For example, the content of auto.cnf is as follows: export base_dir=/usr/local/mysqlexport base_data_dir=/home/data3. Configure the list of nodes, which is a key configuration file for MGR deployment. The configuration of each node is divided into four parts: the port of the node, the alias of the node, the internal port of the node and the role of the node. The port of the node is the port through which the database provides data access, and the alias of the node. Because the test is simulated on the same server, you need to identify the names of different nodes. The internal port of the node, which is the communication port of MGR between nodes, and finally the role of the node. If Y is provided with read and write permission, responsible, only read permission. If it is a single master mode, the last identification bit is Y, and the others are N24801 S1 24901 Y24802 s2 24902 N 24803 s3 24903 N 24804 s4 24904 N24805 s5 24905 N if it is a multi-master mode, then the role of the node should be marked as Y24801 s1 24901 Y24902 s2 24902 Y 24803 s3 24903 Y 24904 s4 24904 Y24905 Y5 24905 Y4. No parameters are required to run the script init.sh. This is the most time-consuming step and the core script. 5. Use check_node.sh script to check the status of each node. Input parameters are node aliases. For example, S1 uses start_node.sh script to start specified nodes, and input parameters are node aliases. For example, S1 uses reset_node.sh script to use when nodes need to rejoin the cluster, and input parameters are node aliases. For example, S1 uses stop_node.sh script to stop specified nodes. The input parameters are node aliases, for example, S1 can connect to the specified node using conn_node.sh script, and the input parameters are node aliases, such as S1. For example, if I want to check the status of node S2, whether it is oline, and whether the application data is normal, you can check it using check_node.sh. Sh check_node.sh s26. Thank you for your use. If you have any feedback, you can submit issue or email me to jeanrock@126.com.
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.