Hi,
At the moment, I'm trying to replace MySQL by MariaDB on my Kamailio server (5.0.1) . In previous post I have been told that Kamailio supports MariaDB and there is no special module to load.
This work is done on a new server running RHEL 7.4 and MariaDB 10.2.14 that is installed under /opt/mysql/na/10.2.14 folder.
I encounter different problem:
- Without changing anything in the kamailio script, kamailio failed to find the libmysqlclient.so.18 library.
- So I thought that I could get rid of the above error by changing the MODULEPATH in the Kamailio-local.cfg as follows :
MODULEPATH="/usr/lib64/kamailio/modules/:/opt/mysql/na/10.2.14/lib64/"
But with this, I get 2 problem:
The kamailio.log that was written in a /opt/log/Kamailio folder is no longer updated.
I can only find the errors in the /var/log/messages file:
May 23 11:19:19 vm-siprouter74 systemd: Starting SYSV: Kamailio is a fast, reliable and flexible SIP Server....
May 23 11:19:19 vm-siprouter74 kamailio: Not starting : invalid configuration file!
May 23 11:19:19 vm-siprouter74 kamailio: 0(3328) DEBUG: <core> [core/cfg.lex:1822]: pp_define_get(): ### returning define ID [DEFINE_LOG_FACILITY] value [LOG_LOCAL0]
May 23 11:19:19 vm-siprouter74 kamailio: 0(3328) DEBUG: <core> [core/cfg.lex:1822]: pp_define_get(): ### returning define ID [LOCAL_LISTEN] value [udp:129.227.82.109:5060]
May 23 11:19:19 vm-siprouter74 kamailio: 0(3328) DEBUG: <core> [core/cfg.lex:1822]: pp_define_get(): ### returning define ID [LOCAL_LISTEN_2] value [udp:127.0.0.1:5060]
May 23 11:19:19 vm-siprouter74 kamailio: 0(3328) DEBUG: <core> [core/cfg.lex:1822]: pp_define_get(): ### returning define ID [MODULEPATH] value ["/usr/lib64/kamailio/modules/:/opt/mysql/na/10.2.14/lib64/"]
May 23 11:19:19 vm-siprouter74 kamailio: 0(3328) DEBUG: <core> [core/cfg.y:1632]: yyparse(): loading modules under /usr/lib64/kamailio/modules/:/opt/mysql/na/10.2.14/lib64/
May 23 11:19:19 vm-siprouter74 kamailio: 0(3328) DEBUG: <core> [core/cfg.y:1613]: yyparse(): loading module db_mysql.so
May 23 11:19:19 vm-siprouter74 kamailio: 0(3328) DEBUG: <core> [core/sr_module.c:575]: load_module(): trying to load </usr/lib64/kamailio/modules/db_mysql.so>
May 23 11:19:19 vm-siprouter74 kamailio: 0(3328) ERROR: <core> [core/sr_module.c:582]: load_module(): could not open module </usr/lib64/kamailio/modules/db_mysql.so>: libmysqlclient.so.18: cannot open shared object file: No such file or directory
May 23 11:19:19 vm-siprouter74 kamailio: 0(3328) CRITICAL: <core> [core/cfg.y:3401]: yyerror_at(): parse error in config file //etc/kamailio/kamailio.cfg, line 191, column 12-24: failed to load module
May 23 11:19:19 vm-siprouter74 kamailio: 0(3328) DEBUG: <core> [core/cfg.y:1613]: yyparse(): loading module jsonrpcs.so
May 23 11:19:19 vm-siprouter74 kamailio: 0(3328) DEBUG: <core> [core/sr_module.c:575]: load_module(): trying to load </usr/lib64/kamailio/modules/jsonrpcs.so>
To work around the problem we have created 2 symbol links:
<<< ln -s /opt/mysql/na/10.2.14/lib64/libmysqlclient.so.18.0.0 /usr/lib64/libmysqlclient.so.18 >>> the libmysqlclient error
<<< ln -s /myqdata/mysiprdb/data/my.cnf /etc/my.cnf >>> to fix the issue to open the db
It seems that kamailio is always looking for the my.cnf in the /etc/ directory.
My concern are to share this job with people who have much more experience with Kamailio.
I would like to know
- If the different workaround (ln) makes sense to you or is there better change to do
- How to explain the logging issue when changing the modulepath variable
- Is it true that kamailio is always looking for the my.cnf in the /etc/ directory?
Any thoughts are welcome.
Thanks in advance.
Cordialement.
Patrick GINHOUX
Am Mittwoch, 23. Mai 2018, 15:34:41 CEST schrieb Ginhoux, Patrick:
At the moment, I'm trying to replace MySQL by MariaDB on my Kamailio server (5.0.1) . In previous post I have been told that Kamailio supports MariaDB and there is no special module to load.
This work is done on a new server running RHEL 7.4 and MariaDB 10.2.14 that is installed under /opt/mysql/na/10.2.14 folder.
I encounter different problem:
Without changing anything in the kamailio script, kamailio failed
to find the libmysqlclient.so.18 library.
So I thought that I could get rid of the above error by changing
the MODULEPATH in the Kamailio-local.cfg as follows :
MODULEPATH="/usr/lib64/kamailio/modules/:/opt/mysql/na/10.2.14/lib64/"
But with this, I get 2 problem: [..]
Hello Patrick,
the Kamailio module path is not related to the system library path.
So the correct configuration is to point in the Kamailio cfg the module path to the installed location for the Kamailio modules, not include the system library path here.
If you have an issue that the db_mysql module can't find the libmysql system library, you can either fix the system library search path or use a symlink approach as you described in the earlier post as well.
Best regards,
Henning
Hi Henning,
Thanks for your answer.
Cordialement.
Patrick GINHOUX
Unisys | +33 1 46 69 52 12 | +33 6 60 32 24 74 | patrick.ginhoux@unisys.com
De : Henning Westerholt hw@kamailio.org Envoyé : jeudi 24 mai 2018 08:40 À : sr-users@lists.kamailio.org Cc : Ginhoux, Patrick patrick.ginhoux@fr.unisys.com Objet : Re: [SR-Users] Link problem between kamailio and MariaDB
Am Mittwoch, 23. Mai 2018, 15:34:41 CEST schrieb Ginhoux, Patrick:
At the moment, I'm trying to replace MySQL by MariaDB on my Kamailio
server
(5.0.1) . In previous post I have been told that Kamailio supports MariaDB
and there is no special module to load.
This work is done on a new server running RHEL 7.4 and MariaDB 10.2.14
that
is installed under /opt/mysql/na/10.2.14 folder.
I encounter different problem:
- Without changing anything in the kamailio script, kamailio failed
to find the libmysqlclient.so.18 library.
- So I thought that I could get rid of the above error by changing
the MODULEPATH in the Kamailio-local.cfg as follows :
MODULEPATH="/usr/lib64/kamailio/modules/:/opt/mysql/na/10.2.14/lib64/"
But with this, I get 2 problem:
[..]
Hello Patrick,
the Kamailio module path is not related to the system library path.
So the correct configuration is to point in the Kamailio cfg the module path to the installed location for the Kamailio modules, not include the system library path here.
If you have an issue that the db_mysql module can't find the libmysql system library, you can either fix the system library search path or use a symlink approach as you described in the earlier post as well.
Best regards,
Henning