[sr-dev] [SR-Users] openser db on an external mysql server

Daniel-Constantin Mierla miconda at gmail.com
Thu Feb 14 19:20:15 CET 2013


On 2/14/13 7:09 PM, Daniel-Constantin Mierla wrote:
> I want to add few details about some case that I encountered in the 
> past. On some specific OS'es, especially centos, seems to be a limit 
> on the number of new connections allowed in the host. 

To be more precise, it is about a limit on the rate of new connections. 
So the problem is when many new connections are opened at more or less 
same time. All is fine when new connections are opened with some delay 
between them.

Cheers,
Daniel

> That results in some kamailio processes being able to connect, some 
> not, with over all result of failing to start kamailio.
>
> For that reason, there is a config parameter that can be used to 
> control the forking rate at startup:
>
> http://www.kamailio.org/wiki/cookbooks/devel/core#fork_delay
>
> In case of some kamailio process can connect and some cannot, try with 
> this parameter.
>
> Cheers,
> Daniel
>
>
> On 2/13/13 5:12 PM, Muhammad Shahzad wrote:
>> Now, we have different mysql error as well as different network topology,
>>
>> 1. Kamailio IP has changed from, previously 192.168.1.170, now it is 
>> 192.168.1.60 as the error says.
>>
>> *Feb 14 01:41:01 192 /usr/local/sbin/kamailio[7576]: ERROR: <core> 
>> [pt.c:350]: ERROR: fork_process(): init_child failed for  process 7, 
>> pid 7576, "udp receiver child=2 sock=192.168.1.60:5060 
>> <http://192.168.1.60:5060/>"*
>>
>> 2. MySQL server has changed, previously it was 192.168.1.1, now its 
>> 192.168.1.170 as the error says,
>>
>> *Feb 14 01:41:01 192 /usr/local/sbin/kamailio[7575]: ERROR: db_mysql 
>> [km_my_con.c:109]: driver error: Can't connect to MySQL server on 
>> '192.168.1.170' (4)*
>>
>> 3. MySQL connection error has changed, previously, "Unknown 
>> database", now it is "Can't connect to MySQL server".
>>
>>
>> Below i am giving steps again, please carefully check them,
>>
>> 1. On mysql server, make sure mysql service is running and listening 
>> for connections on 192.168.1.170, (make sure this ip is correct as well).
>>
>> netstat -plan | grep 3306
>>
>> 2. On mysql server, make sure "openser" database is created and fully 
>> populated.
>>
>> mysql -p openser
>> SELECT * FROM version;
>>
>> 3. On mysql server, make sure you have user for kamailio service 
>> 'openser'@'192.168.1.60' (make sure kamailio ip here is correct) is 
>> created with full permissions on "openser" database.
>>
>> SHOW GRANTS FOR 'openser'@'192.168.1.60';
>>
>> 4. On kamailio server, make sure you can access openser database 
>> using user name "openser" and password "operserrw" manually (make 
>> sure user name and password are correct and mentioned in kamailio.cfg 
>> correctly).
>>
>> mysql -u openser -h 192.168.1.170 -p openser
>> SELECT * FROM version;
>>
>> 5. On kamailio server, check db connection string (db username, 
>> password and host), start kamailio service and check debug logs in 
>> /var/log/message to see if kamailio is able to connect to mysql 
>> database. If not then repeat step 1-4 again.
>>
>> Hope it solves the problem.
>>
>>
>> Thank you.
>>
>>
>> On Wed, Feb 13, 2013 at 4:23 PM, Prakash N <prakash.n at tevatel.com 
>> <mailto:prakash.n at tevatel.com>> wrote:
>>
>>     Hi Shahzap ,
>>
>>            Thanks for your detail mail
>>
>>            Now  i have reinstalled  other server ,still i am having
>>     the same problem
>>
>>            If i use localhost it is working correctly ,if i changed
>>     to remote sever not working( i have changed DB HOST =
>>     192.168.1.170 (remote server )
>>
>>     mysql -u openser -h 192.168.1.170 -p - I can able to connect
>>
>>
>>     SHOW GRANTS FOR 'openser'@'192.168.1.170';  it is also granted
>>
>>     Output
>>     +--------------------------------------------------------------------------------------------------------------------+
>>     | Grants for openser at 192.168.1.170 <mailto:openser at 192.168.1.170>
>>                           |
>>     +--------------------------------------------------------------------------------------------------------------------+
>>     | GRANT USAGE ON *.* TO 'openser'@'192.168.1.170' IDENTIFIED BY
>>     PASSWORD '*6A673AEF9A79D8A0A4A11EE2FCDCA705FAEC1AE4' |
>>     | GRANT ALL PRIVILEGES ON `openser`.* TO
>>     'openser'@'192.168.1.170'                         |
>>     +--------------------------------------------------------------------------------------------------------------------+
>>     2 rows in set (0.00 sec)
>>
>>
>>
>>     *My error messages  :*
>>     *
>>     *
>>     *
>>      kamailio: WARNING: <core> [socket_info.c:1392]: WARNING:
>>     fix_hostname: could not rev. resolve 192.168.1.60
>>     Feb 14 01:40:58 192 kamailio: WARNING: <core>
>>     [socket_info.c:1392]: WARNING: fix_hostname: could not rev.
>>     resolve 192.168.1.60
>>     Feb 14 01:40:58 192 kamailio: INFO: <core> [tcp_main.c:4832]:
>>     init_tcp: using epoll_lt as the io watch method (auto detected)
>>     Feb 14 01:40:58 192 /usr/local/sbin/kamailio[7569]: INFO: usrloc
>>     [hslot.c:53]: locks array size 512
>>     Feb 14 01:40:58 192 /usr/local/sbin/kamailio[7569]: INFO: auth
>>     [auth_mod.c:329]: auth: qop set, but nonce-count (nc_enabled)
>>     support disabled
>>     Feb 14 01:40:59 192 /usr/local/sbin/kamailio[7569]: INFO: <core>
>>     [udp_server.c:179]: INFO: udp_init: SO_RCVBUF is initially 229376
>>     Feb 14 01:40:59 192 /usr/local/sbin/kamailio[7569]: INFO: <core>
>>     [udp_server.c:230]: INFO: udp_init: SO_RCVBUF is finally 262142
>>     Feb 14 01:40:59 192 /usr/local/sbin/kamailio[7569]: INFO: <core>
>>     [udp_server.c:179]: INFO: udp_init: SO_RCVBUF is initially 229376
>>     Feb 14 01:40:59 192 /usr/local/sbin/kamailio[7569]: INFO: <core>
>>     [udp_server.c:230]: INFO: udp_init: SO_RCVBUF is finally 262142
>>     Feb 14 01:41:00 192 avahi-daemon[5122]: Withdrawing address
>>     record for 192.168.1.60 on eth0.
>>     Feb 14 01:41:00 192 avahi-daemon[5122]: Host name conflict,
>>     retrying with <192-165>
>>     Feb 14 01:41:00 192 avahi-daemon[5122]: Registering new address
>>     record for fe80::a00:27ff:feea:b793 on eth0.*.
>>     Feb 14 01:41:00 192 avahi-daemon[5122]: Registering new address
>>     record for 192.168.1.60 on eth0.IPv4.
>>     Feb 14 01:41:00 192 avahi-daemon[5122]: Registering HINFO record
>>     with values 'X86_64'/'LINUX'.
>>     Feb 14 01:41:01 192 /usr/local/sbin/kamailio[7575]: ERROR:
>>     db_mysql [km_my_con.c:109]: driver error: Can't connect to MySQL
>>     server on '192.168.1.170' (4)
>>     Feb 14 01:41:01 192 /usr/local/sbin/kamailio[7575]: ERROR: <core>
>>     [db.c:320]: could not add connection to the pool
>>     Feb 14 01:41:01 192 /usr/local/sbin/kamailio[7575]: ERROR:
>>     auth_db [authdb_mod.c:174]: unable to connect to the database
>>     Feb 14 01:41:01 192 /usr/local/sbin/kamailio[7575]: ERROR: <core>
>>     [sr_module.c:896]: init_mod_child(): Error while initializing
>>     module auth_db (/usr/local/lib64/kamailio/modules_k/auth_db.so)
>>     Feb 14 01:41:01 192 /usr/local/sbin/kamailio[7575]: ERROR: <core>
>>     [pt.c:350]: ERROR: fork_process(): init_child failed for  process
>>     6, pid 7575, "udp receiver child=1 sock=192.168.1.60:5060
>>     <http://192.168.1.60:5060>"
>>     Feb 14 01:41:01 192 /usr/local/sbin/kamailio[7576]: ERROR:
>>     db_mysql [km_my_con.c:109]: driver error: Can't connect to MySQL
>>     server on '192.168.1.170' (4)
>>     Feb 14 01:41:01 192 /usr/local/sbin/kamailio[7576]: ERROR: <core>
>>     [db.c:320]: could not add connection to the pool
>>     Feb 14 01:41:01 192 /usr/local/sbin/kamailio[7576]: ERROR:
>>     auth_db [authdb_mod.c:174]: unable to connect to the database
>>     Feb 14 01:41:01 192 /usr/local/sbin/kamailio[7576]: ERROR: <core>
>>     [sr_module.c:896]: init_mod_child(): Error while initializing
>>     module auth_db (/usr/local/lib64/kamailio/modules_k/auth_db.so)
>>     Feb 14 01:41:01 192 /usr/local/sbin/kamailio[7576]: ERROR: <core>
>>     [pt.c:350]: ERROR: fork_process(): init_child failed for  process
>>     7, pid 7576, "udp receiver child=2 sock=192.168.1.60:5060
>>     <http://192.168.1.60:5060>"
>>     Feb 14 01:41:01 192 /usr/local/sbin/kamailio[7576]: : <core>
>>     [main.c:1625]: main_loop: Cannot fork
>>
>>     *
>>
>
> -- 
> Daniel-Constantin Mierla -http://www.asipto.com
> http://twitter.com/#!/miconda  -http://www.linkedin.com/in/miconda
> Kamailio World Conference, April 16-17, 2013, Berlin
>   -http://conference.kamailio.com  -

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, April 16-17, 2013, Berlin
  - http://conference.kamailio.com -

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20130214/bed23825/attachment-0001.htm>


More information about the sr-dev mailing list