Solved

MySQL-Proxy Round Robin

Posted on 2014-03-03
7
752 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Get Database Help Now w/ Support & Database Audit

Keeping your database environment tuned, optimized and high-performance is key to achieving business goals. If your database goes down, so does your business. Percona experts have a long history of helping enterprises ensure their databases are running smoothly.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating and Managing Databases with phpMyAdmin in cPanel.
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…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

710 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