opensips搭建问题解决笔记
只是笔记而已,不是很详细,莫怪
opensips搭建问题解决笔记:
# opensipsctl start
INFO: Starting OpenSIPS :
ERROR: PID file /var/run/opensips.pid does not exist -- OpenSIPS start failed
Nov 6 15:57:53 webcon2013 opensips: WARNING:core:warn: warning in config file /usr/local/asijack//etc/opensips/opensips.cfg, line 50,
column 13-16: tls support not compiled in
Nov 6 15:57:54 webcon2013 opensips: INFO:core:init_tcp: using epoll_lt as the TCP io watch method (auto detected)
Nov 6 15:57:54 webcon2013 ./opensips[3016]: NOTICE:core:main: version: opensips 1.8.2-notls (i386/linux)
Nov 6 15:57:54 webcon2013 ./opensips[3016]: INFO:core:main: using 32 Mb shared memory
Nov 6 15:57:54 webcon2013 ./opensips[3016]: INFO:core:main: using 2 Mb private memory per process
Nov 6 15:57:54 webcon2013 ./opensips[3016]: NOTICE:signaling:mod_init: initializing module ...
Nov 6 15:57:54 webcon2013 ./opensips[3016]: INFO:sl:mod_init: Initializing StateLess engine
Nov 6 15:57:54 webcon2013 ./opensips[3016]: INFO:tm:mod_init: TM - initializing...
Nov 6 15:57:54 webcon2013 ./opensips[3016]: INFO:rr:mod_init: rr - initializing
Nov 6 15:57:54 webcon2013 ./opensips[3016]: INFO:maxfwd:mod_init: initializing...
Nov 6 15:57:54 webcon2013 ./opensips[3016]: INFO:sipmsgops:mod_init: initializing...
Nov 6 15:57:54 webcon2013 ./opensips[3016]:
ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Nov 6 15:57:54 webcon2013 ./opensips[3016]: ERROR:db_mysql:db_mysql_new_connection: initial connect failed
Nov 6 15:57:54 webcon2013 ./opensips[3016]: ERROR:core:db_do_init: could not add connection to the pool
Nov 6 15:57:54 webcon2013 ./opensips[3016]: ERROR:uri:mod_init: Could not connect to database
Nov 6 15:57:54 webcon2013 ./opensips[3016]: ERROR:core:init_mod: failed to initialize module uri
Nov 6 15:57:54 webcon2013 ./opensips[3016]: ERROR:core:main: error while initializing modules
Nov 6 15:57:54 webcon2013 ./opensips[3016]: INFO:core:cleanup: cleanup
Nov 6 15:57:54 webcon2013 opensips: INFO:core:daemonize: pre-daemon process exiting with -1
/var/lib/mysql/mysql.sock 转移到了 /data/mysql/mysql.sock
(http://www.cnblogs.com/fuhj02/p/3541173.html)
软连接
ln –s /data/mysql/mysql.sock /var/lib/mysql/
还是出错
----------------------------------------------------------------------------------------------------------------------------------
Nov 6 16:40:07 webcon2013 opensips: WARNING:core:warn: warning in config file /usr/local/asijack//etc/opensips/opensips.cfg, line 50, column 13-16: tls support not compiled in
Nov 6 16:40:07 webcon2013 opensips: INFO:core:init_tcp: using epoll_lt as the TCP io watch method (auto detected)
Nov 6 16:40:07 webcon2013 ./opensips[3471]: NOTICE:core:main: version: opensips 1.8.2-notls (i386/linux)
Nov 6 16:40:07 webcon2013 ./opensips[3471]: INFO:core:main: using 32 Mb shared memory
Nov 6 16:40:07 webcon2013 ./opensips[3471]: INFO:core:main: using 2 Mb private memory per process
Nov 6 16:40:07 webcon2013 ./opensips[3471]: NOTICE:signaling:mod_init: initializing module ...
Nov 6 16:40:07 webcon2013 ./opensips[3471]: INFO:sl:mod_init: Initializing StateLess engine
Nov 6 16:40:07 webcon2013 ./opensips[3471]: INFO:tm:mod_init: TM - initializing...
Nov 6 16:40:07 webcon2013 ./opensips[3471]: INFO:rr:mod_init: rr - initializing
Nov 6 16:40:07 webcon2013 ./opensips[3471]: INFO:maxfwd:mod_init: initializing...
Nov 6 16:40:07 webcon2013 ./opensips[3471]: INFO:sipmsgops:mod_init: initializing...
Nov 6 16:40:07 webcon2013 ./opensips[3471]: ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Nov 6 16:40:07 webcon2013 ./opensips[3471]: ERROR:db_mysql:db_mysql_new_connection: initial connect failed
Nov 6 16:40:07 webcon2013 ./opensips[3471]: ERROR:core:db_do_init: could not add connection to the pool
Nov 6 16:40:07 webcon2013 ./opensips[3471]: ERROR:uri:mod_init: Could not connect to database
Nov 6 16:40:07 webcon2013 ./opensips[3471]: ERROR:core:init_mod: failed to initialize module uri
Nov 6 16:40:07 webcon2013 ./opensips[3471]: ERROR:core:main: error while initializing modules
Nov 6 16:40:07 webcon2013 ./opensips[3471]: INFO:core:cleanup: cleanup
Nov 6 16:40:07 webcon2013 opensips: INFO:core:daemonize: pre-daemon process exiting with -1
检查了一下软连接还是/my.cnf 的socket 都做了修改
在[mysql] 加上了socket=/tmp/mysql.sock
还是出现如下错误:
--------------------------------------------------------------------------------------------------------------------------------------
Nov 7 09:04:25 webcon2013 opensips: WARNING:core:warn: warning in config file /usr/local/asijack//etc/opensips/opensips.cfg, line 50, column 13-16: tls support not compiled in
Nov 7 09:04:25 webcon2013 opensips: INFO:core:init_tcp: using epoll_lt as the TCP io watch method (auto detected)
Nov 7 09:04:25 webcon2013 ./opensips[5447]: NOTICE:core:main: version: opensips 1.8.2-notls (i386/linux)
Nov 7 09:04:25 webcon2013 ./opensips[5447]: INFO:core:main: using 32 Mb shared memory
Nov 7 09:04:25 webcon2013 ./opensips[5447]: INFO:core:main: using 2 Mb private memory per process
Nov 7 09:04:25 webcon2013 ./opensips[5447]: NOTICE:signaling:mod_init: initializing module ...
Nov 7 09:04:25 webcon2013 ./opensips[5447]: INFO:sl:mod_init: Initializing StateLess engine
Nov 7 09:04:25 webcon2013 ./opensips[5447]: INFO:tm:mod_init: TM - initializing...
Nov 7 09:04:25 webcon2013 ./opensips[5447]: INFO:rr:mod_init: rr - initializing
Nov 7 09:04:25 webcon2013 ./opensips[5447]: INFO:maxfwd:mod_init: initializing...
Nov 7 09:04:25 webcon2013 ./opensips[5447]: INFO:sipmsgops:mod_init: initializing...
Nov 7 09:04:25 webcon2013 ./opensips[5447]: ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Nov 7 09:04:25 webcon2013 ./opensips[5447]: ERROR:db_mysql:db_mysql_new_connection: initial connect failed
Nov 7 09:04:25 webcon2013 ./opensips[5447]: ERROR:core:db_do_init: could not add connection to the pool
Nov 7 09:04:25 webcon2013 ./opensips[5447]: ERROR:uri:mod_init: Could not connect to database
Nov 7 09:04:25 webcon2013 ./opensips[5447]: ERROR:core:init_mod: failed to initialize module uri
Nov 7 09:04:25 webcon2013 ./opensips[5447]: ERROR:core:main: error while initializing modules
Nov 7 09:04:25 webcon2013 ./opensips[5447]: INFO:core:cleanup: cleanup
Nov 7 09:04:25 webcon2013 opensips: INFO:core:daemonize: pre-daemon process exiting with -1
猜想是不是 以前装过mysql卸载,在重新装mysql 出现的问题 。
当前数据库版本:4.1.11-standard-log
查看mysql进程 ps -ef|grep mysqld
发现 地址/DB_home/mysql/data/my.cnf 下面 修改了这个文件 还是出现错误如下
---------------------------------------------------------------
Nov 7 09:30:08 webcon2013 opensips: WARNING:core:warn: warning in config file /usr/local/asijack//etc/opensips/opensips.cfg, line 50, column 13-16: tls support not compiled in
Nov 7 09:30:08 webcon2013 opensips: INFO:core:init_tcp: using epoll_lt as the TCP io watch method (auto detected)
Nov 7 09:30:08 webcon2013 ./opensips[6092]: NOTICE:core:main: version: opensips 1.8.2-notls (i386/linux)
Nov 7 09:30:08 webcon2013 ./opensips[6092]: INFO:core:main: using 32 Mb shared memory
Nov 7 09:30:08 webcon2013 ./opensips[6092]: INFO:core:main: using 2 Mb private memory per process
Nov 7 09:30:08 webcon2013 ./opensips[6092]: NOTICE:signaling:mod_init: initializing module ...
Nov 7 09:30:08 webcon2013 ./opensips[6092]: INFO:sl:mod_init: Initializing StateLess engine
Nov 7 09:30:08 webcon2013 ./opensips[6092]: INFO:tm:mod_init: TM - initializing...
Nov 7 09:30:08 webcon2013 ./opensips[6092]: INFO:rr:mod_init: rr - initializing
Nov 7 09:30:08 webcon2013 ./opensips[6092]: INFO:maxfwd:mod_init: initializing...
Nov 7 09:30:08 webcon2013 ./opensips[6092]: INFO:sipmsgops:mod_init: initializing...
Nov 7 09:30:08 webcon2013 ./opensips[6092]: ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Nov 7 09:30:08 webcon2013 ./opensips[6092]: ERROR:db_mysql:db_mysql_new_connection: initial connect failed
Nov 7 09:30:08 webcon2013 ./opensips[6092]: ERROR:core:db_do_init: could not add connection to the pool
Nov 7 09:30:08 webcon2013 ./opensips[6092]: ERROR:uri:mod_init: Could not connect to database
Nov 7 09:30:08 webcon2013 ./opensips[6092]: ERROR:core:init_mod: failed to initialize module uri
Nov 7 09:30:08 webcon2013 ./opensips[6092]: ERROR:core:main: error while initializing modules
Nov 7 09:30:08 webcon2013 ./opensips[6092]: INFO:core:cleanup: cleanup
Nov 7 09:30:08 webcon2013 opensips: INFO:core:daemonize: pre-daemon process exiting with -1
远程访问数据库
mysql -h 202.107.195.117 -uroot -pdcs.1234
会出错
修改权限后 出错如下
---------------------------------------------------------------------------------------------------------------------------
Nov 7 10:01:32 webcon2013 opensips: WARNING:core:warn: warning in config file /usr/local/asijack//etc/opensips/opensips.cfg, line 50, column 13-16: tls support not compiled in
Nov 7 10:01:32 webcon2013 opensips: INFO:core:init_tcp: using epoll_lt as the TCP io watch method (auto detected)
Nov 7 10:01:32 webcon2013 ./opensips[7305]: NOTICE:core:main: version: opensips 1.8.2-notls (i386/linux)
Nov 7 10:01:32 webcon2013 ./opensips[7305]: INFO:core:main: using 32 Mb shared memory
Nov 7 10:01:32 webcon2013 ./opensips[7305]: INFO:core:main: using 2 Mb private memory per process
Nov 7 10:01:32 webcon2013 ./opensips[7305]: NOTICE:signaling:mod_init: initializing module ...
Nov 7 10:01:32 webcon2013 ./opensips[7305]: INFO:sl:mod_init: Initializing StateLess engine
Nov 7 10:01:32 webcon2013 ./opensips[7305]: INFO:tm:mod_init: TM - initializing...
Nov 7 10:01:32 webcon2013 ./opensips[7305]: INFO:rr:mod_init: rr - initializing
Nov 7 10:01:32 webcon2013 ./opensips[7305]: INFO:maxfwd:mod_init: initializing...
Nov 7 10:01:32 webcon2013 ./opensips[7305]: INFO:sipmsgops:mod_init: initializing...
Nov 7 10:01:32 webcon2013 ./opensips[7305]: ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Nov 7 10:01:32 webcon2013 ./opensips[7305]: ERROR:db_mysql:db_mysql_new_connection: initial connect failed
Nov 7 10:01:32 webcon2013 ./opensips[7305]: ERROR:core:db_do_init: could not add connection to the pool
Nov 7 10:01:32 webcon2013 ./opensips[7305]: ERROR:uri:mod_init: Could not connect to database
Nov 7 10:01:32 webcon2013 ./opensips[7305]: ERROR:core:init_mod: failed to initialize module uri
Nov 7 10:01:32 webcon2013 ./opensips[7305]: ERROR:core:main: error while initializing modules
Nov 7 10:01:32 webcon2013 ./opensips[7305]: INFO:core:cleanup: cleanup
Nov 7 10:01:32 webcon2013 opensips: INFO:core:daemonize: pre-daemon process exiting with -1
怀疑是编译的mysql 和 系统启动的mysql 不是同一个。
1、查找出已安装的版本
rpm -qa | grep mysql
mysql-5.0.95-5.el5_9
php-mysql-5.1.6-44.el5_10
mysql-server-5.0.95-5.el5_9
mysql-devel-5.0.95-5.el5_9
2、查询已安装好的mysql 会显示安装的地址
whereis mysql
mysql: /usr/bin/mysql /usr/lib/mysql /usr/local/bin/mysql /usr/local/bin/mysql.server /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
额,我发现服务器里面装了一堆的mysql组件,版本也有2个。最后选择全部卸载。
全部卸载
(http://blog.csdn.net/rosten/article/details/25096159)
安装mysql
(http://blog.csdn.net/rosten/article/details/25098331)
重新配置 就好了。我去。