我正在关注Restcomm Docker Quick Start Guide。 我正在尝试在我安装了docker的“大型”VM(8GB内存和4vCPU)上启动restcomm connect。 我是一个公司的http代理,因此开箱即用“docker-compose up”是不够的。我创建了自己的restcomm / restcomm docker镜像:我克隆了Restcomm-Docker git项目并进行了一些更改:
我在Dockerfile和scripts / {restcomm_autoconf.sh,restcomm_sslconf.sh}中添加了http_proxy和https_proxy ENV指令,以便所有wgets都能正常工作。
我在RCBCONF_STATIC_ADDRESS的Restcomm-Connect / docker-compose.yml中配置了VM IP地址。
当我构建“自定义”docker镜像时,我在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时,我有以下错误消息:
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镜像时遇到的问题有关,但我并不是百分之百确定。
我在Docker镜像中将Restcomm-Docker / scripts / restcomm-runlevels.sh中的以下行添加为/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服务启动但我觉得有些东西多次启动(由于我的更改,可能是不合适的runit监控?):我可以在不同的线程中看到以下行和后续日志块两次:
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:]
答案 0 :(得分:1)
我发现了问题的来源。 它与docker / var / lib / docker底层文件系统有关。 我有一个xfs文件系统,它没有使用d_type支持格式化。 我将一个新卷附加到我的(openstack)VM,使用d_type参数对其进行格式化并且它有效! 实际上,没有这个选项,它会混淆phusion / baseimage,然后间接地依赖于这个图像的restcomm图像。
以下是详细信息:
# docker info
...
Storage Driver: overlay
Backing Filesystem: xfs
Supports d_type: false
...
WARNING: overlay: the backing xfs filesystem is formatted without d_type support, which leads to incorrect behavior.
Reformat the filesystem with ftype=1 to enable d_type support.
Running without d_type support will not be supported in future releases.
这就是我发现问题的方法。 用xfs_info确认:ftype = 0,应为1
[root@yohann telestax]# xfs_info /
meta-data=/dev/vda1 isize=256 agcount=10, agsize=524224 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0 spinodes=0
data = bsize=4096 blocks=5240950, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@yohann telestax]#
在openstack上创建了一个新卷
将此卷附加到正在运行的实例
(创建的设备是/ dev / vdb)
使用“fdisk / dev / vdb”创建分区
命令:n,p,1和默认
然后“w”写分区表
使用正确的参数在此分区上创建xfs文件系统:
[root@yohann centos]# mkfs.xfs -n ftype=1 /dev/vdb1
meta-data=/dev/vdb1 isize=512 agcount=4, agsize=655296 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=2621184, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@yohann centos]#
停止使用docker ,挂载此文件系统:
rm -fr /var/lib/docker
mkdir /var/lib/docker
mount /dev/vdb1 /var/lib/docker/
然后,docker info提供了正确的详细信息:
docker info
...
Storage Driver: overlay
Backing Filesystem: xfs
Supports d_type: true
...
(no more warning)
成功尝试使用baseimage:
[root@yohann centos]# docker run -it phusion/baseimage bash
Unable to find image 'phusion/baseimage:latest' locally
latest: Pulling from phusion/baseimage
22ecafbbcc4a: Pull complete
580435e0a086: Pull complete
8321ffd10031: Pull complete
08b8f28a13c2: Pull complete
2b401702069a: Pull complete
a3ed95caeb02: Pull complete
eae027dcdc0e: Pull complete
93bc98227159: Pull complete
Digest: sha256:d7507394a2e31759297a8726ac1f61e1c135b5255f8be42e7081d85b6fb3f903
Status: Downloaded newer image for phusion/baseimage:latest
root@4a3b26f2748e:/# ls -l /etc/rc0.d/
total 4
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
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
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--. 13 root root 353 Jan 19 2016 README
root@4a3b26f2748e:/# exit
[root@yohann centos]#
(没有更多的符号链接问题)
然后,我重建了restcomm docker图像并使用“docker-compose up”再次运行它。
我使用https://myip:8443进行了测试 administrator@company.com,密码:RestComm
它有效! (它与http上的污染图像无关。)