我使用 Virtualbox 在 Ubuntu-Server 14.4 上安装了 Kamailio 4.0,并在另一个 Ubuntu 服务器上安装了 MySQL 服务器。
192.168.0.131:MySQL服务器
192.168.0.141:卡迈利奥 4.0
我把数据库的地址从 localhost 改成了 192.168.0.131。但是连接不上。我在 Google 上搜索了很多,但找不到解决办法。 您需要什么信息来帮助我?
我可以使用以下命令访问服务器:
mysql -h 192.168.0.131 -u kamailio -p
一些输出:
ahmad@ubuntu2:/$ kamctl start
INFO: Starting Kamailio :
ERROR: PID file /var/run/kamailio.pid does not exist -- Kamailio start failed
Kamailio 错误日志
ahmad@ubuntu2:/$ kamailio -E -e -dd
loading modules under /usr/local/lib/kamailio/modules_k/:/usr/lib/x86_64-linux-gnu/kamailio/modules/
0(2983) WARNING: <core> [socket_info.c:1407]: fix_hostname(): WARNING: fix_hostname: could not rev. resolve 192.168.0.141
0(2983) WARNING: <core> [socket_info.c:1407]: fix_hostname(): WARNING: fix_hostname: could not rev. resolve 200.200.200.246
0(2983) WARNING: <core> [socket_info.c:1407]: fix_hostname(): WARNING: fix_hostname: could not rev. resolve 192.168.0.141
0(2983) WARNING: <core> [socket_info.c:1407]: fix_hostname(): WARNING: fix_hostname: could not rev. resolve 200.200.200.246
Listening on
udp: 127.0.0.1:5060
udp: 192.168.0.141:5060
udp: 200.200.200.246:5060
tcp: 127.0.0.1:5060
tcp: 192.168.0.141:5060
tcp: 200.200.200.246:5060
Aliases:
tcp: localhost:5060
udp: localhost:5060
0(2983) INFO: <core> [tcp_main.c:4846]: init_tcp(): init_tcp: using epoll_lt as the io watch method (auto detected)
0(2985) INFO: rr [../outbound/api.h:49]: ob_load_api(): Failed to import bind_ob
0(2985) INFO: rr [rr_mod.c:159]: mod_init(): outbound module not available
0(2985) INFO: usrloc [hslot.c:53]: ul_init_locks(): locks array size 512
0(2985) INFO: auth [auth_mod.c:350]: mod_init(): auth: qop set, but nonce-count (nc_enabled) support disabled
0(2985) ERROR: db_mysql [km_my_con.c:109]: db_mysql_new_connection(): driver error: Can't connect to MySQL server on '192.168.0.131' (4)
0(2985) ERROR: <core> [db.c:322]: db_do_init2(): could not add connection to the pool 0(2985) ERROR: usrloc [dlist.c:635]: register_udomain(): failed to open database connection
0(2985) ERROR: registrar [reg_mod.c:516]: domain_fixup(): failed to register domain
0(2985) ERROR: <core> [route.c:1215]: fix_actions(): fixing failed (code=-1) at cfg:/etc/kamailio/kamailio.cfg:637
0(2985) ERROR: <core> [route.c:1215]: fix_actions(): fixing failed (code=-1) at cfg:/etc/kamailio/kamailio.cfg:640
0(2985) ERROR: <core> [route.c:1215]: fix_actions(): fixing failed (code=-1) at cfg:/etc/kamailio/kamailio.cfg:642
ERROR: error -1 while trying to fix configuration
ss 输出:
ahmad@ubuntu2:~$ sudo ss -l | grep mysql
u_str LISTEN 0 50 /var/run/mysqld/mysqld.sock 204079 * 0
tcp LISTEN 0 50 *:mysql *:*