Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MySQL-Proxy Round Robin

Posted on 2014-03-03
7
Medium Priority
?
793 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 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
Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

 
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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

704 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