In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Atlas is a data middle-tier project based on MySQL protocol developed and maintained by the infrastructure team of Web platform Department of Qihoo 360. It modifies a lot of bug and adds a lot of features on the basis of the official version of MySQL-Proxy 0.8.2 released by MySQL. At present, the project has been widely used within the company, and many MySQL services have been connected to the Atlas platform, carrying billions of read and write requests every day. At the same time, more than 50 companies have deployed Atlas in production environments, and more than 800people have joined our developer exchange group, and these numbers are growing.
Github address
Introduction
I. installation
Installation
Before installation, mysql must be installed on the server, and altas will use mysql components.
When starting, you may prompt information such as faild start altas of test. The solution is as follows.
Echo'/ usr/local/mysql/lib/' > > / etc/ld.so.confldconfig 2. Configuration instructions [mysql-proxy] (required, default value is fine) user name of management interface admin-username = user (mandatory, default value is OK) password of management interface admin-password = pwd (required, configured according to actual situation) IP and port proxy-backend-addresses of main library = 192.168.0.12 Vu3306 (optional) Configure according to the actual situation) from the IP and port of the library, the number after @ represents the weight, which is used for load balancing. If omitted, it defaults to 1. Multiple entries can be set and separated by commas. If you want the main library to share the read request, you only need to add the main library information to the configuration item below. Proxy-read-only-backend-addresses = 192.168.0.13 proxy-read-only-backend-addresses 3306192.168.0.14 (required, configured according to the actual situation) the username and its corresponding encrypted MySQL password are encrypted using the encryption program encrypt in the PREFIX/bin directory, and the username and password are separated by colons. You need to create the user and set the password on the master-slave database (the username and password should be the same on the master-slave database). For example, the user name is myuser, the password is mypwd, and the result of executing. / encrypt mypwd is HJBoxfRsjeI=. If you have multiple users, you can separate them with commas. The running mode of Atlas is set as shown in the following line: pwds = myuser: HJBoxfRsjeI=,myuser2:HJBoxfRsjeI= (required, default) Atlas, daemon when true, foreground when false, generally false when developing and debugging, truedaemon = true (required, default value) when running online, Atlas starts two processes when true is set, one is monitor and the other is worker Monitor automatically restarts worker after exiting unexpectedly. It is set to false with only worker and no monitor. Generally, it is set to false when developing and debugging, and to truekeepalive = true (required, configured according to the actual situation) when running online. It is recommended to set it to 2 to 4 times the number of CPU cores of the system, event-threads = 4 (required, default) log level, which is divided into five levels: message, warning, critical, error, debug, log-level = message (required). The default value is OK) the path to log storage is log-path = / usr/local/mysql-proxy/log (required, configured according to the actual situation) the switch for SQL logs can be set to OFF, ON, and REALTIME,OFF: do not record SQL logs, and ON means to record SQL logs. In this mode, log refresh is based on the buffer. Log information is brushed to disk only after the log fills the buffer. REALTIME is used for debugging, which means that SQL logs are recorded and written to disk in real time. The default is OFFsql-log = OFF (optional, but not set) slow log output setting. When this parameter is set, the log only outputs log records whose execution time exceeds sql-log-slow (in ms). If this parameter is not set, all logs are output. Sql-log-slow = 10 (optional, but not set) turn off inactive client connection settings. When this parameter is set, Atlas will actively close connections that have been inactive after the 'wait-timeout' time. Unit: second wait-timeout = 10 (required, default value) work interface IP and port for Atlas monitoring, address proxy-address for connecting altas = 0.0.0.0proxy-address 1234 (required, default value) Atlas listening management interface IP and port admin-address = 0.0.0.023proxy-address 45, address for connecting altas management service (optional, but not set) sub-table setting. In this case, person is the library name and mt is the table name. Id is a sub-table field, 3 is the number of sub-tables, and multiple items can be set, separated by commas. If there is no sub-table, you do not need to set this item. The sub-table needs to be built in advance. The name of the sub-table is table name _ number, and the number range is [0, number of sub-tables-1]. For example, in this case, the name of the child table is mt_0, mt_1, mt_2tables = person.mt.id.3 (optional, but not set) default character set. The default character set is latin1charset = utf8 (optional, but not required) to allow the IP of clients connected to Atlas, either exact IP or IP segments separated by commas. If this item is not set, all IP connections are allowed, otherwise only IP connections in the list are allowed client-ips = 127.0.0.1, 192.168.1 (optional, rarely required) IP of the physical network card of the LVS attached in front of the Atlas (note that it is not a virtual IP) If there is LVS and client-ips is set, this must be set, otherwise lvs-ips = 192.168.1.1 III. Altas management can not be set.
Execute mysql-h227.0.0.1-uuser-ppwd-P2345 to connect and enter altas management
1. Query help select * from help +-- +-- + | command | description | | +-+-- + | SELECT * FROM help | Show help | | | SELECT * FROM backends | check the status of the backend server | | SET OFFLINE $backend_id | offline backend CVM | $backend_id is backend_ndx's id | | SET ONLINE $backend_id | launched backend server,... | | ADD MASTER $backend | add master server, example: "add master 127.0.0.1 ADD MASTER 3306",... | | ADD SLAVE $server | add slave server, example: "add slave 127.0.0.1 backend_id 3306" | | REMOVE BACKEND $backend_id | remove backend server example: "remove backend 1",... | | ADD CLIENT $client | add client example: "add client 192.168.1.2",... | | REMOVE CLIENT $client | remove client example: "remove client 192.168.1.2" | | SAVE CONFIG | Save configuration to file | +-+ 2. View backend mysql status information mysql > select * from backends-> +-+ | backend_ndx | address | state | type | +-+ | 1 | 10.211.55.9 rows in set 3306 | up | rw | | 2 | 10.211.55.10 up | ro | +-+ 2 rows in set (0.00 sec) 3. Offline mysql server mysql > set offline 2-> +-+ | backend_ndx | address | state | type | +-+ | 2 | 10.211.55.10 row in set 3306 | offline | ro | +-+ 1 sec (0.00 sec) 4. Launch mysql server mysql > set online 2 +-+ | backend_ndx | address | state | type | +-+ | 2 | 10.211.55.10 row in set 3306 | unknown | ro | +-+ 1 sec)
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.