Solved

MySQL-Proxy Round Robin

Posted on 2014-03-03
7
737 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

773 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