mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
Cluster: error out quicker if port is unusable
The default cluster control port is 10,000 ports higher than the base Redis port. If Redis is started on a too-high port, Cluster can't start and everything will exit later anyway.
This commit is contained in:
parent
b20ae393f1
commit
ce68caea37
@ -329,6 +329,19 @@ void clusterInit(void) {
|
||||
|
||||
/* We need a listening TCP port for our cluster messaging needs. */
|
||||
server.cfd_count = 0;
|
||||
|
||||
/* Port sanity check II
|
||||
The other handshake port check is triggered too late to stop
|
||||
us from trying to use a too-high cluster port number.
|
||||
*/
|
||||
if (server.port > (65535-REDIS_CLUSTER_PORT_INCR)) {
|
||||
redisLog(REDIS_WARNING, "Redis port number too high. "
|
||||
"Cluster communication port is 10,000 port "
|
||||
"numbers higher than your Redis port. "
|
||||
"Your Redis port number must be "
|
||||
"lower than 55535.");
|
||||
}
|
||||
|
||||
if (listenToPort(server.port+REDIS_CLUSTER_PORT_INCR,
|
||||
server.cfd,&server.cfd_count) == REDIS_ERR)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user