Description
Problem
The output of alternateAddresses and nodesExt from /pools/default/nodeServices endpoint changes a lot depending on how alternate-address is set. This makes it tricky to cross refer node names to alternate-address (see MB-35235).
- Two node cluster with no alternate Address, notice how there is no information about the other node:
{
"clusterCapabilities": {
"n1ql": [
"enhancedPreparedStatements"
]
},
"clusterCapabilitiesVer": [
1,
0
],
"nodesExt": [
{
"hostname": "172.18.1.197",
"services": {
"capi": 9500,
"capiSSL": 19500,
"indexAdmin": 9100,
"indexHttp": 9102,
"indexHttps": 19102,
"indexScan": 9101,
"indexStreamCatchup": 9104,
"indexStreamInit": 9103,
"indexStreamMaint": 9105,
"kv": 12000,
"kvSSL": 11998,
"mgmt": 9000,
"mgmtSSL": 19000,
"n1ql": 9499,
"n1qlSSL": 19499,
"projector": 10000
},
"thisNode": true
},
{
"services": {
"cbas": 9615,
"cbasSSL": 19601,
"eventingAdminPort": 9301,
"eventingDebug": 9307,
"eventingSSL": 19301,
"fts": 9202,
"ftsGRPC": 9203,
"ftsGRPCSSL": 19203,
"ftsSSL": 19202,
"mgmt": 9001,
"mgmtSSL": 19001
}
}
],
"rev": 106
}
- With the alternate-address set on one node, notice the new section alternateAddresses and a number of default alternate ports:
{
"clusterCapabilities": {
"n1ql": [
"enhancedPreparedStatements"
]
},
"clusterCapabilitiesVer": [
1,
0
],
"nodesExt": [
{
"alternateAddresses": {
"external": {
"hostname": "paddy1",
"ports": {
"capi": 9500,
"capiSSL": 19500,
"indexAdmin": 9100,
"indexHttp": 9102,
"indexHttps": 19102,
"indexScan": 9101,
"indexStreamCatchup": 9104,
"indexStreamInit": 9103,
"indexStreamMaint": 9105,
"kv": 12000,
"kvSSL": 11998,
"mgmt": 9000,
"mgmtSSL": 19000,
"n1ql": 9499,
"n1qlSSL": 19499,
"projector": 10000
}
}
},
"hostname": "172.18.1.197",
"services": {
"capi": 9500,
"capiSSL": 19500,
"indexAdmin": 9100,
"indexHttp": 9102,
"indexHttps": 19102,
"indexScan": 9101,
"indexStreamCatchup": 9104,
"indexStreamInit": 9103,
"indexStreamMaint": 9105,
"kv": 12000,
"kvSSL": 11998,
"mgmt": 9000,
"mgmtSSL": 19000,
"n1ql": 9499,
"n1qlSSL": 19499,
"projector": 10000
},
"thisNode": true
},
{
"services": {
"cbas": 9615,
"cbasSSL": 19601,
"eventingAdminPort": 9301,
"eventingDebug": 9307,
"eventingSSL": 19301,
"fts": 9202,
"ftsGRPC": 9203,
"ftsGRPCSSL": 19203,
"ftsSSL": 19202,
"mgmt": 9001,
"mgmtSSL": 19001
}
}
],
"rev": 107
}
- One node with alternate hostname and Query Service port set. Now there is just one port in the list now:
{
"clusterCapabilities": {
"n1ql": [
"enhancedPreparedStatements"
]
},
"clusterCapabilitiesVer": [
1,
0
],
"nodesExt": [
{
"alternateAddresses": {
"external": {
"hostname": "paddy1",
"ports": {
"n1ql": 10000
}
}
},
"hostname": "172.18.1.197",
"services": {
"capi": 9500,
"capiSSL": 19500,
"indexAdmin": 9100,
"indexHttp": 9102,
"indexHttps": 19102,
"indexScan": 9101,
"indexStreamCatchup": 9104,
"indexStreamInit": 9103,
"indexStreamMaint": 9105,
"kv": 12000,
"kvSSL": 11998,
"mgmt": 9000,
"mgmtSSL": 19000,
"n1ql": 9499,
"n1qlSSL": 19499,
"projector": 10000
},
"thisNode": true
},
{
"services": {
"cbas": 9615,
"cbasSSL": 19601,
"eventingAdminPort": 9301,
"eventingDebug": 9307,
"eventingSSL": 19301,
"fts": 9202,
"ftsGRPC": 9203,
"ftsGRPCSSL": 19203,
"ftsSSL": 19202,
"mgmt": 9001,
"mgmtSSL": 19001
}
}
],
"rev": 108
}
- Now with one node with alternate address and port and a second node with just alternate address. Notice how the 2nd node does not have it's primary hostname/nodename:
{
"clusterCapabilities": {
"n1ql": [
"enhancedPreparedStatements"
]
},
"clusterCapabilitiesVer": [
1,
0
],
"nodesExt": [
{
"alternateAddresses": {
"external": {
"hostname": "paddy1",
"ports": {
"n1ql": 10000
}
}
},
"hostname": "172.18.1.197",
"services": {
"capi": 9500,
"capiSSL": 19500,
"indexAdmin": 9100,
"indexHttp": 9102,
"indexHttps": 19102,
"indexScan": 9101,
"indexStreamCatchup": 9104,
"indexStreamInit": 9103,
"indexStreamMaint": 9105,
"kv": 12000,
"kvSSL": 11998,
"mgmt": 9000,
"mgmtSSL": 19000,
"n1ql": 9499,
"n1qlSSL": 19499,
"projector": 10000
},
"thisNode": true
},
{
"alternateAddresses": {
"external": {
"hostname": "paddy2",
"ports": {
"cbas": 9615,
"cbasSSL": 19601,
"eventingAdminPort": 9301,
"eventingDebug": 9307,
"eventingSSL": 19301,
"fts": 9202,
"ftsGRPC": 9203,
"ftsGRPCSSL": 19203,
"ftsSSL": 19202,
"mgmt": 9001,
"mgmtSSL": 19001
}
}
},
"services": {
"cbas": 9615,
"cbasSSL": 19601,
"eventingAdminPort": 9301,
"eventingDebug": 9307,
"eventingSSL": 19301,
"fts": 9202,
"ftsGRPC": 9203,
"ftsGRPCSSL": 19203,
"ftsSSL": 19202,
"mgmt": 9001,
"mgmtSSL": 19001
}
}
],
"rev": 109
}
—
Now if we do the same things from the pool/default
- Skipping the no alternate address set sample.
- With the alternate-address set on one node, notice how this port list is not the same as the pools/default/nodeServices
"nodes": [
{
"addressFamily": "inet",
"alternateAddresses": {
"external": {
"hostname": "paddy1",
"ports": {
"capi": 9500,
"capiSSL": 19500,
"kv": 12000,
"mgmt": 9000,
"mgmtSSL": 19000
}
}
},
...
"hostname": "172.18.1.197:9000",
- One node with alternate hostname and Query Service port set. Now there is no port section in the alternateAddresses section even though it's set:
"nodes": [
{
"addressFamily": "inet",
"alternateAddresses": {
"external": {
"hostname": "paddy1"
}
},
"clusterCompatibility": 393221,
- Skipping one node with alternate address and port and a second node with just alternate address output for pools/defaults
—
Expectations
For a simple API to show the current status of the alternate address config.
Attachments
Issue Links
Gerrit Reviews
For Gerrit Dashboard: MB-36801 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
117687,1 | MB-36801 Add additional info to pools/default | master | ns_server | Status: ABANDONED | 0 | 0 |