我正在关注Restcomm Docker 快速入门指南。我正在尝试在安装了 docker 的“大型”虚拟机(8GB 内存和 4vCPU)上启动 restcomm 连接。我支持公司的 http 代理,因此开箱即用运行“docker-compose up”是不够的。我创建了自己的 restcomm/restcomm docker 映像:我克隆了 Restcomm-Docker git 项目并进行了一些更改:
我在 Dockerfile 和 scripts/{restcomm_autoconf.sh,restcomm_sslconf.sh} 中添加了 http_proxy 和 https_proxy ENV 指令,以便所有 wget 都可以工作。
我在 RCBCONF_STATIC_ADDRESS 的 Restcomm-Connect/docker-compose.yml 中配置了 VM ip 地址。
当我构建“自定义”泊坞窗图像时,我在 apt-get 安装步骤中有一些错误消息:
docker build -t restcomm/restcomm:latest -f Dockerfile .
...
Setting up x11-common (1:7.7+13ubuntu3) ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
insserv: can not remove(../rc0.d/K01hwclock.sh): No such file or directory
insserv: can not remove(../rc0.d/K01sendsigs): No such file or directory
...
所以我检查了你依赖的原始 docker 镜像(phusion/baseimage),发现了那些奇怪的文件:
run -it phusion/baseimage bash
root@3485dcc8fe85:/# ls -l /etc/rc0.d/
ls: cannot access '/etc/rc0.d/K01hwclock.sh': No such file or directory
ls: cannot access '/etc/rc0.d/K01sendsigs': No such file or directory
ls: cannot access '/etc/rc0.d/K02umountnfs.sh': No such file or directory
ls: cannot access '/etc/rc0.d/K03umountfs': No such file or directory
ls: cannot access '/etc/rc0.d/K04umountroot': No such file or directory
ls: cannot access '/etc/rc0.d/K05halt': No such file or directory
total 4
??????????? ? ? ? ? ? K01hwclock.sh
??????????? ? ? ? ? ? K01sendsigs
lrwxrwxrwx. 1 root root 19 May 17 2017 K01syslog-ng -> ../init.d/syslog-ng
lrwxrwxrwx. 1 root root 17 May 10 2017 K01urandom -> ../init.d/urandom
lrwxrwxrwx. 1 root root 20 May 17 2017 K02hwclock.sh -> ../init.d/hwclock.sh
lrwxrwxrwx. 1 root root 18 May 17 2017 K02sendsigs -> ../init.d/sendsigs
??????????? ? ? ? ? ? K02umountnfs.sh
??????????? ? ? ? ? ? K03umountfs
lrwxrwxrwx. 1 root root 22 May 17 2017 K03umountnfs.sh -> ../init.d/umountnfs.sh
lrwxrwxrwx. 1 root root 18 May 17 2017 K04umountfs -> ../init.d/umountfs
??????????? ? ? ? ? ? K04umountroot
??????????? ? ? ? ? ? K05halt
lrwxrwxrwx. 1 root root 20 May 17 2017 K05umountroot -> ../init.d/umountroot
lrwxrwxrwx. 1 root root 14 May 17 2017 K06halt -> ../init.d/halt
-rw-r--r--. 1 root root 353 Jan 19 2016 README
root@3485dcc8fe85:/#
对不起,这可能是一个非常常见的问题,但在谷歌上没有发现任何明显的问题。
然后,当我运行 docker-compose up 时,我收到以下错误消息:
restcomm_1 | *** Running /etc/my_init.d/restcomm6.sh...
restcomm_1 | mv: cannot remove '/etc/service/cron/run': No such file or directory
restcomm_1 | mv: cannot remove '/etc/service/sshd/down': No such file or directory
restcomm_1 | mv: cannot remove '/etc/service/sshd/run': No such file or directory
restcomm_1 | mv: cannot remove '/etc/service/syslog-forwarder/run': No such file or directory
restcomm_1 | mv: cannot remove '/etc/service/syslog-ng/run': No such file or directory
然后循环中出现以下错误消息:
restcomm_1 | *** Running /etc/rc.local...
restcomm_1 | *** Booting runit daemon...
restcomm_1 | *** Runit started as PID 281
restcomm_1 | runsv syslog-ng: fatal: unable to start ./run: file does not exist
restcomm_1 | runsv syslog-forwarder: fatal: unable to start ./run: file does not exist
restcomm_1 | runsv cron: fatal: unable to start ./run: file does not exist
restcomm_1 | runsv sshd: fatal: unable to start ./run: file does not exist
我认为这与我在构建 docker 映像时遇到的问题有关,但我不是 100% 确定。
我在 Restcomm-Docker/scripts/restcomm-runlevels.sh 中发现以下行添加为 docker 映像中的 /etc/my_init.d/restcomm6.sh:
cp -pR /etc/service/* /etc/runit/runsvdir/current/
这可能是先前错误消息的来源。它应该只添加正确的脚本吗?
编辑 1: 我在 Restcomm-Docker/scripts/restcomm-runlevels.sh 中注释掉了以下块:
#cd /etc/runit/runsvdir
#ln -s default /etc/runit/runsvdir/current
#cp -pR /etc/service/* /etc/runit/runsvdir/current/
#mv -f /etc/service /service.old && ln -s /etc/runit/runsvdir/current /etc/service
现在restcomm服务启动了,但我感觉某些东西启动了多次(可能是由于我的更改而导致的不适当的运行监控?):我可以在不同的线程中看到以下行和随后的日志块两次:
Initializing RVD. Project version: 1.13
然后以绑定异常结束:
restcomm_1 | 21:05:18,291 ERROR [org.mobicents.protocols.mgcp.stack.JainMgcpStackImpl] (RestComm-akka.actor.default-dispatcher-2) java.net.BindException: Address already in use
restcomm_1 | 21:05:18,293 ERROR [org.restcomm.connect.mrb.MediaResourceBrokerGeneric] (RestComm-akka.actor.default-dispatcher-4) Failed to find a local port 2727 to bound stack: java.lang.RuntimeException: Failed to find a local port 2727 to bound stack
restcomm_1 | at org.mobicents.protocols.mgcp.stack.JainMgcpStackImpl.init(JainMgcpStackImpl.java:172) [mgcp-driver-6.0.23.jar:6.0.23]
restcomm_1 | at org.mobicents.protocols.mgcp.stack.JainMgcpStackImpl.createProvider(JainMgcpStackImpl.java:250) [mgcp-driver-6.0.23.jar:6.0.23]
restcomm_1 | at org.restcomm.connect.mrb.MediaResourceBrokerGeneric.bindMGCPStack(MediaResourceBrokerGeneric.java:134) [restcomm-connect.mrb-8.3.0-140.jar:8.3.0-140]
restcomm_1 | at org.restcomm.connect.mrb.MediaResourceBrokerGeneric.onStartMediaResourceBroker(MediaResourceBrokerGeneric.java:120) [restcomm-connect.mrb-8.3.0-140.jar:8.3.0-140]
restcomm_1 | at org.restcomm.connect.mrb.MediaResourceBrokerGeneric.onReceive(MediaResourceBrokerGeneric.java:99) [restcomm-connect.mrb-8.3.0-140.jar:8.3.0-140]
restcomm_1 | at akka.actor.UntypedActor$$anonfun$receive$1.applyOrElse(UntypedActor.scala:159) [akka-actor_2.10-2.1.2.jar:]
restcomm_1 | at akka.actor.ActorCell.receiveMessage(ActorCell.scala:425) [akka-actor_2.10-2.1.2.jar:]
restcomm_1 | at akka.actor.ActorCell.invoke(ActorCell.scala:386) [akka-actor_2.10-2.1.2.jar:]
restcomm_1 | at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:230) [akka-actor_2.10-2.1.2.jar:]
restcomm_1 | at akka.dispatch.Mailbox.run(Mailbox.scala:212) [akka-actor_2.10-2.1.2.jar:]
restcomm_1 | at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:506) [akka-actor_2.10-2.1.2.jar:]
restcomm_1 | at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:262) [scala-library-2.10.1.jar:]
restcomm_1 | at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975) [scala-library-2.10.1.jar:]
restcomm_1 | at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1478) [scala-library-2.10.1.jar:]
restcomm_1 | at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) [scala-library-2.10.1.jar:]