I have an AWS RDS with 1 read replica (total 2 instances). I'm planning to install mysqlnd_ms plugin so that I can have my request pointed to the database servers in round robin fashion.
I have 2 basic questions which I couldn't find direct answers in documentation
Create a json file and mention the path in
/etc/php.d/mysqlnd_ms.ini
file as below
mysqlnd_ms.config_file=/etc/mysqlnd_ms_cfg.json
Add the following code in json file
/etc/mysqlnd_ms_cfg.json
{
"myapp": {
"master": {
"master_0": {
"host": "RDS master instance IP/doamin name",
"port": 3306
}
},
"slave": {
"slave_0": {
"host": "RDS master instance IP/doamin name",
"port": 3306
},
"slave_1": {
"host": "RDS read replica instance IP/doamin name",
"port": 3306
}
},
"filters": [
"roundrobin"
]
}
}