<div dir="ltr"><div>Hello!<br><br></div><div>In our architecture, Kamailio uses 2 local Redis servers to get routing information.<br></div><div>We noticed that if at the start of Kamailio the first in the modparam list is a running Redis server (<span style="background-color:rgb(30,30,30);color:rgb(206,145,120);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre">name=real</span>), and the second in the list is not running (<span style="background-color:rgb(30,30,30);color:rgb(206,145,120);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre">name=fake</span>), then Kamailio will not even try to connect to the running one.</div><div><br></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Consolas,"Courier New",monospace;font-size:14px;line-height:19px;white-space:pre"><div><span style="color:rgb(106,153,85)"># ----- redis server params -----</span><br></div><div><span style="color:rgb(86,156,214)">modparam</span>(<span style="color:rgb(206,145,120)">"ndb_redis"</span>, <span style="color:rgb(206,145,120)">"init_without_redis"</span>, <span style="color:rgb(181,206,168)">1</span>)</div><div><span style="color:rgb(86,156,214)">modparam</span>(<span style="color:rgb(206,145,120)">"ndb_redis"</span>, <span style="color:rgb(206,145,120)">"server"</span>, <span style="color:rgb(206,145,120)">"name=real;addr=127.0.0.1;port=6379;db=1"</span>)<br></div><div><span style="color:rgb(86,156,214)">modparam</span>(<span style="color:rgb(206,145,120)">"ndb_redis"</span>, <span style="color:rgb(206,145,120)">"server"</span>, <span style="color:rgb(206,145,120)">"name=fake;addr=127.0.0.1;port=6479;db=2"</span>)</div></div></div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Consolas,"Courier New",monospace;font-size:14px;line-height:19px;white-space:pre"><br></div><div><br></div><div><div>But if the servers in the list above are reversed, then everything will work as it should.<br></div><div>Looks the initialization order affects behavior.</div><div></div></div><div><br></div><div>Syslog output:</div>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<br>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] (<a href="http://127.0.0.1:6479/2">127.0.0.1:6479/2</a>): Connection refused<br><div>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.</div><div><br></div><div>There is no established connection to the real server after Kamailio starts both through redis-cli and through ss.</div><div><br><div>[root@kamailio ~]# ss -anp | grep 6379<br>tcp    LISTEN     0      128    <a href="http://127.0.0.1:6379">127.0.0.1:6379</a>                  *:*                   users:(("redis-server",pid=10376,fd=6))<br></div><div><br></div><div>[root@kamailio ~]# kamailio -v<br>version: kamailio 5.6.0-dev2 (x86_64/linux) 378a2d<br>compiled on 04:12:43 Nov 11 2021 with gcc 4.8.5<br></div><div><br></div><div>[root@kamailio ~]# cat /etc/redhat-release<br>CentOS Linux release 7.9.2009 (Core)<br></div><div>g</div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><br><div><div>BR,</div><div>Denys Pozniak<br></div><div><br></div><div><br></div></div></div></div></div></div>