Closed unix196 closed 6 years ago
"DiscoverByShowSlaveHosts": true,
?select @@report_host, @@report_port
return on each of the two replicas?
mysql> select @@report_host;
+------------------------+
| @@report_host |
+------------------------+
| DNS NAME SLAVE1 |
+------------------------+
mysql> select @@report_port;
+---------------+ | @@report_port | +---------------+ | 3307 |
mysql> select @@report_host; +------------------------+ | @@report_host | +------------------------+ | DNS NAME SLAVE2 | +------------------------+ mysql> select @@report_port; +---------------+ | @@report_port | +---------------+ | 3307 | +---------------+
P.S. API return IP addresses of the slaves insted dns name, "show slave hosts" return dns name of the slave (may be it important)
API call
curl -s http://orchestrator.local/api/instance/master_host/3306 | json_pp
{
"LastSeenTimestamp" : "2018-07-10 15:51:42",
"DowntimeEndTimestamp" : "",
"VersionComment" : "Percona Server (GPL), Release 38.5, Revision 71794d3",
"InstanceAlias" : "",
"CountMySQLSnapshots" : 0,
"SupportsOracleGTID" : false,
"Uptime" : 2207219,
"LastIOError" : "",
"Version" : "5.5.53-38.5-log",
"Slave_SQL_Running" : false,
"MasterKey" : {
"Port" : 0,
"Hostname" : ""
},
"PromotionRule" : "neutral",
"LastDiscoveryLatency" : 5682377,
"AllowTLS" : false,
"ServerID" : 220,
"ServerUUID" : "",
"ElapsedDowntime" : 0,
"IsLastCheckValid" : true,
"IsCandidate" : false,
"SecondsBehindMaster" : {
"Int64" : 0,
"Valid" : false
},
"SemiSyncEnforced" : false,
"DowntimeOwner" : "",
"FlavorName" : "Percona",
"DataCenter" : "",
"PhysicalEnvironment" : "",
"Binlog_format" : "ROW",
"SQLDelay" : 0,
"IsDowntimed" : false,
"LogBinEnabled" : true,
"SuggestedClusterAlias" : "",
"IsRecentlyChecked" : true,
"ReadOnly" : false,
"IsCoMaster" : false,
"IsDetachedMaster" : false,
"LastSQLError" : "",
"SlaveLagSeconds" : {
"Valid" : false,
"Int64" : 0
},
"SemiSyncMasterEnabled" : false,
"DowntimeReason" : "",
"RelaylogCoordinates" : {
"LogFile" : "",
"Type" : 1,
"LogPos" : 0
},
"ReadBinlogCoordinates" : {
"LogFile" : "",
"LogPos" : 0,
"Type" : 0
},
"ClusterName" : "master_host:3306",
"HasReplicationCredentials" : false,
"Key" : {
"Port" : 3306,
"Hostname" : "master_host"
},
"ReplicationDepth" : 0,
"GtidPurged" : "",
"UnresolvedHostname" : "",
"UsingMariaDBGTID" : false,
"Slave_IO_Running" : false,
"GTIDMode" : "",
"IsDetached" : false,
"ExecBinlogCoordinates" : {
"LogFile" : "",
"LogPos" : 0,
"Type" : 0
},
"SecondsSinceLastSeen" : {
"Int64" : 0,
"Valid" : true
},
"UsingOracleGTID" : false,
"IsUpToDate" : true,
"ReplicationCredentialsAvailable" : false,
"ExecutedGtidSet" : "",
"UsingPseudoGTID" : false,
"SemiSyncReplicaEnabled" : false,
"BinlogRowImage" : "",
"SelfBinlogCoordinates" : {
"Type" : 0,
"LogPos" : 517006612,
"LogFile" : "dbmaster-bin.041196"
},
"SlaveHosts" : [
{
"Port" : 3306,
"Hostname" : "IP1"
},
{
"Hostname" : "IP2",
"Port" : 3306
},
],
"HasReplicationFilters" : false,
"LogSlaveUpdatesEnabled" : false
}
OK. Since you have master and replicas on different ports you'll need to keep using "DiscoverByShowSlaveHosts": true,
, otherwise orchestrator
cannot guess the ports. Also continue to have @@report_host
and @@report_port
available on all servers.
Also use
"HostnameResolveMethod": "default"
"MySQLHostnameResolveMethod": "@@hostname"
or "MySQLHostnameResolveMethod": "@@report_port"
I need to look into the information presented in []SlaveHosts
.
Thanks! All worked great! I use this config:
cat /etc/orchestrator.conf.json
{
"Debug": false,
"EnableSyslog": false,
"ListenAddress": "127.0.0.1:3001",
"MySQLOrchestratorHost": "127.0.0.1",
"MySQLOrchestratorPort": 3306,
"MySQLOrchestratorDatabase": "orchestrator",
"MySQLOrchestratorUser": "orch_use",
"MySQLOrchestratorPassword": "pass1",
"MySQLTopologyUser": "orch",
"MySQLTopologyPassword": "passw2",
"HostnameResolveMethod": "default",
"MySQLHostnameResolveMethod": "@@report_host",
"DiscoverByShowSlaveHosts": true
}
i.e. use combination "DiscoverByShowSlaveHosts": true and "HostnameResolveMethod": "default". In GUI I discover only master host, then all slave depict automatically
Good day!
In web interface I discover three hosts and orchestrator draw dashboard with this three host - one master, two slave, all good. But if I try use API - it return wrong information about slave ports
On master_hosts:
Slaves servers works on port 3307, but API return that they connected to master_host from 3306 port. In general, API works fine, for example: it returns true information for mysql binary log file and LogPosition. In GUI slave hosts depict that they connected to master from 3307 ports. Why this can be happen?