linux - Freeswitch 在 centos 7.1 上启动时在 check_ip 上暂停

标签 linux centos admin voip freeswitch

在调查另一个问题 (Inconsistent systemd startup of freeswitch) 期间,我发现最新的 freeswitch 1.6 和 1.7 在 centos 7.1 上启动期间一次暂停几分钟(4 到 14 分钟之间)。虽然它是间歇性的,但频率高达 3 或 4 次。

从命令行运行:

/usr/bin/freeswitch -nonat -db /dev/shm -log /usr/local/freeswitch/log -conf /usr/local/freeswitch/conf -run /usr/local/freeswitch/run

导致以下输出(注意添加任务 2 和它后面的行之间的时间差):

2015-10-23 15:40:14.160101 [INFO] switch_event.c:685 Activate Eventing Engine.
2015-10-23 15:40:14.170805 [WARNING] switch_event.c:656 Create additional event dispatch thread 0
2015-10-23 15:40:14.272850 [INFO] switch_core_sqldb.c:3381 Opening DB
2015-10-23 15:40:14.282317 [INFO] switch_core_sqldb.c:1693 CORE Starting SQL thread.
2015-10-23 15:40:14.285266 [NOTICE] switch_scheduler.c:183 Starting task thread
2015-10-23 15:40:14.293743 [DEBUG] switch_scheduler.c:249 Added task 1 heartbeat (core) to run at 1445611214
2015-10-23 15:40:14.293837 [DEBUG] switch_scheduler.c:249 Added task 2 check_ip (core) to run at 1445611214
2015-10-23 15:49:47.883158 [NOTICE] switch_core.c:1386 Created ip list rfc6598.auto default (deny)

当我使用与上面相同的命令行在 centos6.7 上从 1.6 运行它时,我得到了这个 - 注意延迟是更合理的 14 秒:

2015-10-23 10:31:00.274533 [INFO] switch_event.c:685 Activate Eventing Engine.
2015-10-23 10:31:00.285807 [WARNING] switch_event.c:656 Create additional event dispatch thread 0
2015-10-23 10:31:00.434780 [INFO] switch_core_sqldb.c:3381 Opening DB
2015-10-23 10:31:00.465158 [INFO] switch_core_sqldb.c:1693 CORE Starting SQL thread.
2015-10-23 10:31:00.481306 [DEBUG] switch_scheduler.c:249 Added task 1 heartbeat (core) to run at 1445610660
2015-10-23 10:31:00.481446 [DEBUG] switch_scheduler.c:249 Added task 2 check_ip (core) to run at 1445610660
2015-10-23 10:31:00.481723 [NOTICE] switch_scheduler.c:183 Starting task thread
2015-10-23 10:31:14.286702 [NOTICE] switch_core.c:1386 Created ip list rfc6598.auto default (deny)

在 FS 1.7 上也是一样。

这严重表明 centos 7.1 和 FS 一起存在问题。任何人都可以帮助我进一步诊断或进一步阐明这一点吗?

当我试图理解为什么 FS 在我认为它已经启动后几分钟不接受 cli 连接时(使用 systemd 服务中的 -nc),这一切都曝光了。

最佳答案

感谢 FS 用户列表和最终的 Anthony Minessale,问题与 RNG 熵有关。

这是一个很好的解释 - https://www.digitalocean.com/community/tutorials/how-to-setup-additional-entropy-for-cloud-servers-using-haveged

这里是一些摘录:

There are two general random devices on Linux: /dev/random and /dev/urandom. The best randomness comes from /dev/random, since it's a blocking device, and will wait until sufficient entropy is available to continue providing output.

这里的关键是它是一个阻塞设备,因此任何等待来自/dev/random 的随机数的程序都会暂停,直到有足够的熵可用于“安全”随机数。

这是一个 headless 服务器,因此鼠标/键盘事件(以及许多其他事件)等常见的熵源不适用。因此延迟,

修复是这样的:

Based on the HAVEGE principle, and previously based on its associated library, haveged allows generating randomness based on variations in code execution time on a processor......(google the rest!)

像这样安装:

yum install haveged

然后像这样启动它:

haveged -w 1024

确保它在重启时重新启动:

chkconfig haveged on

希望这对某人有帮助。

关于linux - Freeswitch 在 centos 7.1 上启动时在 check_ip 上暂停,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33305393/

相关文章:

python - 对象没有属性 '__getitem__'

c - getc 是宏还是函数?

linux - 如何创建具有可变参数/参数的 bash 函数以 grep 多个关键字/标签

Ruby:从 bash 脚本运行脚本?

php - php @mail 发送的消息无法解析 html

mongodb - MongoDB中的 "admin"数据库是什么?

java - 在基于 UNIX 的系统中存储我的 Java 库和应用程序的常规位置

php - Nginx 无法与 uwsgi 对话(连接过早关闭)

linux - 我想在 vmware 工作站中安装 centos 6.6 和 centos 6.6 最小服务器有什么区别?

mysql - 未处理的异常 : Error creating account