求助:Coturn搭建,turnserver服务无法运行


#1

按照GitHub官网的步奏,成功安装了Coturn,但turnserver命令后服务始终无法运行。
端口无法开启监听。
报错代码如下:

# turnserver -L 39.104.90.91 -o -a -f -r demo
0: log file opened: /var/log/turn_11652_2019-02-18.log
0: WARNING: Cannot find config file: turnserver.conf. Default and command-line settings will be used.
0: Listener address to use: 39.104.90.91
0: WARNING: Cannot find config file: turnserver.conf. Default and command-line settings will be used.
0:
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.5.1.0 'dan Eider'
0:
Max number of open files/sockets allowed for this process: 65535
0:
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 32500 (approximately)
0:

==== Show him the instruments, Practical Frost: ====

0: TLS supported
0: DTLS supported
0: DTLS 1.2 supported
0: TURN/STUN ALPN supported
0: Third-party authorization (oAuth) supported
0: GCM (AEAD) supported
0: OpenSSL compile-time version: OpenSSL 1.0.2k-fips  26 Jan 2017 (0x100020bf)
0:
0: SQLite supported, default database location is /usr/local/var/db/turndb
0: Redis is not supported
0: PostgreSQL is not supported
0: MySQL is not supported
0: MongoDB is not supported
0:
0: Default Net Engine version: 3 (UDP thread per CPU core)

=====================================================

0: Domain name:
0: Default realm: demo
0: ERROR:
CONFIG ERROR: Empty cli-password, and so telnet cli interface is disabled! Please set a non empty cli-password!
0: Config file found: /root/../etc/turn_server_cert.pem
0: Config file found: /root/../etc/turn_server_pkey.pem
0: SSL23: Certificate file found: /root/../etc/turn_server_cert.pem
0: SSL23: Private key file found: /root/../etc/turn_server_pkey.pem
0: TLS1.0: Certificate file found: /root/../etc/turn_server_cert.pem
0: TLS1.0: Private key file found: /root/../etc/turn_server_pkey.pem
0: TLS1.1: Certificate file found: /root/../etc/turn_server_cert.pem
0: TLS1.1: Private key file found: /root/../etc/turn_server_pkey.pem
0: TLS1.2: Certificate file found: /root/../etc/turn_server_cert.pem
0: TLS1.2: Private key file found: /root/../etc/turn_server_pkey.pem
0: TLS cipher suite: DEFAULT
0: DTLS: Certificate file found: /root/../etc/turn_server_cert.pem
0: DTLS: Private key file found: /root/../etc/turn_server_pkey.pem
0: DTLS1.2: Certificate file found: /root/../etc/turn_server_cert.pem
0: DTLS1.2: Private key file found: /root/../etc/turn_server_pkey.pem
0: DTLS cipher suite: DEFAULT
0: Relay address to use: 39.104.90.91

环境配置如下:
阿里云服务器,端口打开了3478和5349~(阿里云安全组和服务器内TCP/UDP都开了)。Centos7.6,宝塔环境,按官网说明编译安装了sqlite和 libevent。

安装过程如下:

git clone https://github.com/coturn/coturn 
cd coturn 
./configure 
make 
sudo make install
turnadmin -a -u test -r test.com -p test
bin/turnadmin -A -u test -p test

#2

Config file found: /root/…/etc/turn_server_cert.pem
Config file found: /root/…/etc/turn_server_pkey.pem

这两个文件有吗


#3

有的!通过OpenSSL自签名的根证书~(感觉也是没用。。)
代码:

openssl req -x509 -newkey rsa:2048 -keyout /etc/turn_server_pkey.pem -out /etc/turn_server_cert.pem -days 99999 –nodes

#4

从错误上看,就是这个两个文件没找到,你看看你的路径,或者还有他的查找方式有什么特别。错是这么报的只能先按他报的错误来查


#5

感谢!找到原因了!因为阿里云服务器公网是弹性IP的原因,不是固定绑定在机器网卡上得~所以coturn绑定不到这个IP的端口上!
解决方法是把IP删掉。。不指定IP

# turnserver -L -o -a -f -r demo

测试穿透成功。。:joy::joy:
不管怎样!感谢你的回复!!


#6

谢谢楼主把原因找到了。我们也是买的阿里云,服务端同学快哭了


#7

删掉IP是什么意思啊,是吧turnconfig里配置的IP删掉吗?