Solved

MySQL-Proxy Round Robin

Posted on 2014-03-03
7
726 Views
Last Modified: 2014-06-15
Hi All,

I have Mysql-Proxy Server (IP: 192.168.190.142) and 03 DB servers, in there:

- DB Server 1: Read & Write
  (IP: 192.168.190.41)
- DB Server 2: Read
  (IP: 192.168.190.144)
- DB Server 3: Read
  (IP: 192.168.190.145)

I checked the DB Server 1 (Read & Write OK) & DB Server 3 (Read OK)
And DB Server 2 never read.

#vi /etc/mysql-proxy.cnf
[mysql-proxy]

user=root
proxy-address= 192.168.190.142:3306      #IP, port of proxy server
proxy-backend-addresses=192.168.190.41:3306       #IP, port of DB server for writting
proxy-read-only-backend-addresses=192.168.190.144:3306      #IP, port of DB server for read
proxy-read-only-backend-addresses=192.168.190.145:3306       #IP, port of DB server for read
proxy-lua-script=/usr/local/mysql-proxy/lua/rw-splitting.lua # script read-write
admin-lua-script=/usr/local/mysql-proxy/lua/admin-sql.lua # script management
log-file=/usr/local/mysql-proxy/log/mysql-proxy.log       #file log
log-level=warning
daemon=true            
keepalive=true

Where is the parameter for round robin that I can declare in this configuration above? Is it right?

Please give me your advices about this issue.

Thanks in advance,
0
Comment
Question by:ldvhai
  • 4
  • 2
7 Comments
 
LVL 13

Assisted Solution

by:Sandy
Sandy earned 500 total points
ID: 39902548
--proxy-backend-addresses=host:port, -b host:port

The host name (or IP address) and port of the MySQL server to connect to. You can specify multiple backend servers by supplying multiple options. Clients are connected to each backend server in round-robin fashion. For example, if you specify two servers A and B, the first client connection will go to server A; the second client connection to server B and the third client connection to server A.

When using this option on the command line, you can specify the option and the server multiple times to specify multiple backends. For example:

shell> mysql-proxy --proxy-backend-addresses 192.168.190.41:3306 --proxy-backend-addresses 192.168.190.144:3306 192.168.190.145:3306

When using the option within the configuration file, you should separate multiple servers by commas. The equivalent of the preceding example would be:

it's by default round-robin no need to define parameter. Your configuration is perfectly fine.

TY/SA
0
 
LVL 2

Author Comment

by:ldvhai
ID: 40129118
Ok, Thanks.
0
 
LVL 2

Author Comment

by:ldvhai
ID: 40129129
I've requested that this question be closed as follows:

Accepted answer: 0 points for ldvhai's comment #a40129118

for the following reason:

OK, Thks,
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 13

Accepted Solution

by:
Sandy earned 500 total points
ID: 40129130
Was this resolved ?

TY/SA
0
 
LVL 2

Author Comment

by:ldvhai
ID: 40129137
Yes, solved, thks.
0
 
LVL 2

Author Comment

by:ldvhai
ID: 40136155
Thks for your help.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now