Hello!
In our architecture, Kamailio uses 2 local Redis servers to get routing
information.
We noticed that if at the start of Kamailio the first in the modparam list
is a running Redis server (name=real), and the second in the list is not
running (name=fake), then Kamailio will not even try to connect to the
running one.
# ----- redis server params -----
modparam("ndb_redis", "init_without_redis", 1)
modparam("ndb_redis", "server",
"name=real;addr=127.0.0.1;port=6379;db=1")
modparam("ndb_redis", "server",
"name=fake;addr=127.0.0.1;port=6479;db=2")
But if the servers in the list above are reversed, then everything will
work as it should.
Looks the initialization order affects behavior.
Syslog output:
Nov 11 18:00:45 kamailio /usr/sbin/kamailio[11445]: ERROR: ndb_redis
[redis_client.c:224]: redisc_init(): Failed to create REDIS returned an
error: Connection refused
Nov 11 18:00:45 kamailio /usr/sbin/kamailio[11445]: ERROR: ndb_redis
[redis_client.c:259]: redisc_init(): error communicating with redis server
[fake] (127.0.0.1:6479/2): Connection refused
Nov 11 18:00:45 kamailio /usr/sbin/kamailio[11445]: WARNING: ndb_redis
[redis_client.c:264]: redisc_init(): failed to initialize redis
connections, but initializing module anyway.
There is no established connection to the real server after Kamailio starts
both through redis-cli and through ss.
[root@kamailio ~]# ss -anp | grep 6379
tcp LISTEN 0 128 127.0.0.1:6379 *:*
users:(("redis-server",pid=10376,fd=6))
[root@kamailio ~]# kamailio -v
version: kamailio 5.6.0-dev2 (x86_64/linux) 378a2d
compiled on 04:12:43 Nov 11 2021 with gcc 4.8.5
[root@kamailio ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
g
--
BR,
Denys Pozniak