|
Hi Dipti Joshi,
Master is um1 and slaves are um2, um3, as you can see from maxscale mysqlmonioir node :
mysql -hum2 -umaxscalerepl -pmaxscalepass -e "show slave status\G"
|
...
|
Master_Host: 192.168.56.10 (um1)
|
Master_User: idbrep
|
Master_Port: 3306
|
...
|
|
mysql -hum3 -umaxscalerepl -pmaxscalepass -e "show slave status"
|
...
|
Master_Host: 192.168.56.10 (um1)
|
Master_User: idbrep
|
Master_Port: 3306
|
...
|
|
|
I've tried with official mysql server (version 5.5) from Jessie and all is ok :
Server 0x21a74b0 (mysql1)
|
Server: 192.168.56.23
|
Status: Master, Running
|
Protocol: MySQLBackend
|
Port: 3306
|
Server Version: 5.5.46-0+deb8u1-log
|
Node Id: 1
|
Master Id: -1
|
Slave Ids: 11, 12
|
Repl Depth: 0
|
Number of connections: 0
|
Current no. of conns: 0
|
Current no. of operations: 0
|
Server 0x21a73a0 (mysql2)
|
Server: 192.168.56.21
|
Status: Slave, Running
|
Protocol: MySQLBackend
|
Port: 3306
|
Server Version: 5.5.46-0+deb8u1-log
|
Node Id: 11
|
Master Id: 1
|
Slave Ids:
|
Repl Depth: 1
|
Number of connections: 0
|
Current no. of conns: 0
|
Current no. of operations: 0
|
Server 0x21a7290 (mysql3)
|
Server: 192.168.56.22
|
Status: Slave, Running
|
Protocol: MySQLBackend
|
Port: 3306
|
Server Version: 5.5.46-0+deb8u1-log
|
Node Id: 12
|
Master Id: 1
|
Slave Ids:
|
Repl Depth: 1
|
Number of connections: 0
|
Current no. of conns: 0
|
Current no. of operations: 0
|
Any issues with mysql version (5.1.73-log) from infinidb ?
|
|
Hi,
All right, I've found problem, look at monitor mysql module source code from maxscale, in my case, the last mysql version on infinidb is 5.1 so we need to enable "mysql51_replication=true" :
static MONITOR_SERVERS *build_mysql51_replication_tree(MONITOR *mon)
|
{
|
MONITOR_SERVERS* database = mon->databases;
|
MONITOR_SERVERS *ptr,*rval = NULL;
|
int i;
|
while(database)
|
{
|
bool ismaster = false;
|
MYSQL_RES* result;
|
MYSQL_ROW row;
|
int nslaves = 0;
|
if(database->con)
|
{
|
if (mysql_query(database->con, "SHOW SLAVE HOSTS") == 0
|
&& (result = mysql_store_result(database->con)) != NULL)
|
{
|
if(mysql_field_count(database->con) < 4)
|
{
|
mysql_free_result(result);
|
skygw_log_write_flush(LE,"Error: \"SHOW SLAVE HOSTS\" "
|
"returned less than the expected amount of columns. Expected 4 columns."
|
" MySQL Version: %s",version_str);
|
return NULL;
|
}
|
|
if(mysql_num_rows(result) > 0)
|
{
|
ismaster = true;
|
while (nslaves < MONITOR_MAX_NUM_SLAVES && (row = mysql_fetch_row(result)))
|
{
|
/* get Slave_IO_Running and Slave_SQL_Running values*/
|
database->server->slaves[nslaves] = atol(row[0]);
|
nslaves++;
|
LOGIF(LD,(skygw_log_write_flush(LD,"Found slave at %s:%d",row[1],row[2])));
|
}
|
database->server->slaves[nslaves] = 0;
|
}
|
|
mysql_free_result(result);
|
}
|
|
|
/* Set the Slave Role */
|
if (ismaster)
|
{
|
LOGIF(LD,(skygw_log_write(LD,"Master server found at %s:%d with %d slaves",
|
database->server->name,
|
database->server->port,
|
nslaves)));
|
monitor_set_pending_status(database, SERVER_MASTER);
|
if(rval == NULL || rval->server->node_id > database->server->node_id)
|
rval = database;
|
}
|
}
|
database = database->next;
|
}
|
As you can see "SHOW SLAVE HOSTS" is called to build the tree. Problem, (I think it's not a problem) is that this feature is not enabled by default in mysql 5.1, I think it's normal, this option is required for replication but we must to have warning from maxscale like "mysql51_replication", you can enable it from my.cnf or in command line argument "--report-host=server1"..
MaxScale> list servers
|
Servers.
|
-------------------+-----------------+-------+-------------+--------------------
|
Server | Address | Port | Connections | Status
|
-------------------+-----------------+-------+-------------+--------------------
|
server1 | 192.168.56.10 | 3306 | 0 | Master, Running
|
server2 | 192.168.56.12 | 3306 | 0 | Slave, Running
|
server3 | 192.168.56.17 | 3306 | 0 | Slave, Running
|
-------------------+-----------------+-------+-------------+--------------------
|
tshuss.
|