commit
c190ea20b6
|
@ -29,6 +29,7 @@ extern uint16_t tsServerPort;
|
||||||
extern uint16_t tsDnodeShellPort;
|
extern uint16_t tsDnodeShellPort;
|
||||||
extern uint16_t tsDnodeDnodePort;
|
extern uint16_t tsDnodeDnodePort;
|
||||||
extern uint16_t tsSyncPort;
|
extern uint16_t tsSyncPort;
|
||||||
|
extern uint16_t tsArbitratorPort;
|
||||||
extern int32_t tsStatusInterval;
|
extern int32_t tsStatusInterval;
|
||||||
extern int32_t tsNumOfMnodes;
|
extern int32_t tsNumOfMnodes;
|
||||||
extern int32_t tsEnableVnodeBak;
|
extern int32_t tsEnableVnodeBak;
|
||||||
|
|
|
@ -37,6 +37,7 @@ uint16_t tsServerPort = 6030;
|
||||||
uint16_t tsDnodeShellPort = 6030; // udp[6035-6039] tcp[6035]
|
uint16_t tsDnodeShellPort = 6030; // udp[6035-6039] tcp[6035]
|
||||||
uint16_t tsDnodeDnodePort = 6035; // udp/tcp
|
uint16_t tsDnodeDnodePort = 6035; // udp/tcp
|
||||||
uint16_t tsSyncPort = 6040;
|
uint16_t tsSyncPort = 6040;
|
||||||
|
uint16_t tsArbitratorPort = 6042;
|
||||||
int32_t tsStatusInterval = 1; // second
|
int32_t tsStatusInterval = 1; // second
|
||||||
int32_t tsNumOfMnodes = 3;
|
int32_t tsNumOfMnodes = 3;
|
||||||
int32_t tsEnableVnodeBak = 1;
|
int32_t tsEnableVnodeBak = 1;
|
||||||
|
@ -1331,7 +1332,10 @@ int taosGetFqdnPortFromEp(const char *ep, char *fqdn, uint16_t *port) {
|
||||||
*port = atoi(temp+1);
|
*port = atoi(temp+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*port == 0) *port = tsServerPort;
|
if (*port == 0) {
|
||||||
|
*port = tsServerPort;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -413,9 +413,11 @@ static void syncAddArbitrator(SSyncNode *pNode)
|
||||||
|
|
||||||
SNodeInfo nodeInfo;
|
SNodeInfo nodeInfo;
|
||||||
nodeInfo.nodeId = 0;
|
nodeInfo.nodeId = 0;
|
||||||
taosGetFqdnPortFromEp(tsArbitrator, nodeInfo.nodeFqdn, &nodeInfo.nodePort);
|
int ret = taosGetFqdnPortFromEp(tsArbitrator, nodeInfo.nodeFqdn, &nodeInfo.nodePort);
|
||||||
nodeInfo.nodePort += TSDB_PORT_SYNC;
|
if (-1 == ret) {
|
||||||
|
nodeInfo.nodePort = tsArbitratorPort;
|
||||||
|
}
|
||||||
|
|
||||||
if (pPeer) {
|
if (pPeer) {
|
||||||
if ((strcmp(nodeInfo.nodeFqdn, pPeer->fqdn) == 0) && (nodeInfo.nodePort == pPeer->port)) {
|
if ((strcmp(nodeInfo.nodeFqdn, pPeer->fqdn) == 0) && (nodeInfo.nodePort == pPeer->port)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -40,13 +40,9 @@ typedef struct {
|
||||||
void *pConn;
|
void *pConn;
|
||||||
} SNodeConn;
|
} SNodeConn;
|
||||||
|
|
||||||
uint16_t tsArbitratorPort = 0;
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
char arbLogPath[TSDB_FILENAME_LEN + 16] = {0};
|
char arbLogPath[TSDB_FILENAME_LEN + 16] = {0};
|
||||||
|
|
||||||
tsArbitratorPort = tsServerPort + TSDB_PORT_ARBITRATOR;
|
|
||||||
|
|
||||||
for (int i=1; i<argc; ++i) {
|
for (int i=1; i<argc; ++i) {
|
||||||
if (strcmp(argv[i], "-p")==0 && i < argc-1) {
|
if (strcmp(argv[i], "-p")==0 && i < argc-1) {
|
||||||
tsArbitratorPort = atoi(argv[++i]);
|
tsArbitratorPort = atoi(argv[++i]);
|
||||||
|
|
Loading…
Reference in New Issue