Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MySQL-Proxy Round Robin

Posted on 2014-03-03
7
Medium Priority
?
816 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
6 Comments
 
LVL 13

Assisted Solution

by:Sandy
Sandy earned 1500 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 13

Accepted Solution

by:
Sandy earned 1500 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
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
Suggested Courses
Course of the Month7 days, 23 hours left to enroll

824 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