Skip to content

Checking your reading list…

Retry verification

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Atlas MySQL Proxy: Introduction, Installation, Configuration, Testing, and Basic Management
Databases 5 min read

Atlas MySQL Proxy: Introduction, Installation, Configuration, Testing, and Basic Management

This article introduces Atlas, a MySQL‑protocol data middle‑layer developed by Qihoo 360, and provides step‑by‑step instructions for downloading, installing, configuring, testing read/write operations, creating production users, and managing backends using its admin interface.

Atlas is a data‑middle‑layer project based on the MySQL protocol, developed and maintained by Qihoo 360's Web Platform Infrastructure team. It builds on mysql‑proxy 0.8.2 with optimizations and new features, and handles billions of read/write requests daily in 360's internal environment.

Download Atlas from the official GitHub releases page: https://github.com/Qihoo360/Atlas/releases .

Prerequisites :

Atlas can only be installed on a 64‑bit operating system.

For CentOS 5.x use Atlas-XX.el5.x86_64.rpm; for CentOS 6.x use Atlas-XX.el6.x86_64.rpm.

The backend MySQL version should be greater than 5.1; MySQL 5.6 or newer is recommended.

Installation and basic configuration :

yum install -y Atlas*
cd /usr/local/mysql-proxy/conf
mv test.cnf test.cnf.bak

Edit test.cnf with the following content (adjust IPs and passwords as needed):

[mysql-proxy]
admin-username = user
admin-password = pwd
proxy-backend-addresses = 192.168.20.42:3306
proxy-read-only-backend-addresses = 192.168.20.40:3306,192.168.20.39:3306
pwds = repl:3yb5jEku5h4=,mha:O2jBXONX098=
daemon = true
keepalive = true
event-threads = 8
log-level = message
log-path = /usr/local/mysql-proxy/log
sql-log = ON
proxy-address = 0.0.0.0:33060
admin-address = 0.0.0.0:2345
charset = utf8

Start Atlas:

/usr/local/mysql-proxy/bin/mysql-proxyd test start
ps -ef | grep proxy

Function testing :

Read operation:

mysql -umha -pmha -h 192.168.20.40 -P 33060
select @@server_id;

Write operation: mysql> begin; select @@server_id; commit; Production user requirement :

Create an application user app with SELECT, UPDATE, INSERT privileges, allowed to connect from the 192.168.20.% network:

grant select, update, insert on *.* to app@'192.168.20.%' identified by '123456';

Generate an encrypted password for the user:

/usr/local/mysql-proxy/bin/encrypt 123456   # → encrypted string

Add the encrypted password to the pwds line in test.cnf: pwds = repl:3yb5jEku5h4=,mha:O2jBXONX098=,app:/iZxz+0GRoA= Restart Atlas to apply the change: /usr/local/mysql-proxy/bin/mysql-proxyd test restart Verify the new user can connect: mysql -uapp -p123456 -h 192.168.20.40 -P 33060 Basic management commands (admin interface) :

mysql -uuser -ppwd -h127.0.0.1 -P2345
select * from help;
SELECT * FROM backends;
set offline 2;
set online 2;
REMOVE BACKEND 3;
ADD SLAVE 192.168.20.40:3306;
ADD PWD hahashen:123456;
save config;

The article concludes with additional recommended reading on MySQL binlog cleaning, dump recovery, and MySQL 8.0 replication and installation.

About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

Report an issue with this article
ConfigurationDatabase MiddlewareinstallationMySQL-ProxyAtlas

Reader feedback

Was this useful?

Useful0

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion