linux – 如何在docker中成功启用udev同步?
发布时间:2020-05-23 08:47:41 所属栏目:Linux 来源:互联网
导读:我已经从这个 site下载并安装了静态链接的docker 1.6.1,并在RHEL 7.1上运行它: [root@localhost bin]# ./docker -dWARN[0000] Udev sync is not supported. This will lead to unexpected behavior, data loss and errorsINFO[0000] +job
我已经从这个 site下载并安装了静态链接的docker 1.6.1,并在RHEL 7.1上运行它: [root@localhost bin]# ./docker -d WARN[0000] Udev sync is not supported. This will lead to unexpected behavior,data loss and errors INFO[0000] +job init_networkdriver() INFO[0000] +job serveapi(unix:///var/run/docker.sock) INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) INFO[0000] -job init_networkdriver() = OK (0) INFO[0000] Loading containers: start. INFO[0000] Loading containers: done. INFO[0000] docker daemon: 1.6.1 97cd073; execdriver: native-0.2; graphdriver: devicemapper INFO[0000] +job acceptconnections() INFO[0000] -job acceptconnections() = OK (0) INFO[0000] Daemon has completed initialization 我可以看到有一个警告:“不支持Udev同步.这将导致意外行为,数据丢失和错误”,并且在检查docker源代码后,我发现警告日志来自deviceset.go: func (devices *DeviceSet) initDevmapper(doInit bool) error { ...... // https://github.com/docker/docker/issues/4036 if supported := devicemapper.UdevSetSyncSupport(true); !supported { log.Warnf("Udev sync is not supported. This will lead to unexpected behavior,data loss and errors") } log.Debugf("devicemapper: udev sync support: %v",devicemapper.UdevSyncSupported()) ...... } devicemapper.UdevSetSyncSupport是这样的: // UdevSyncSupported returns whether device-mapper is able to sync with udev // // This is essential otherwise race conditions can arise where both udev and // device-mapper attempt to create and destroy devices. func UdevSyncSupported() bool { return DmUdevGetSyncSupport() != 0 } // UdevSetSyncSupport allows setting whether the udev sync should be enabled. // The return bool indicates the state of whether the sync is enabled. func UdevSetSyncSupport(enable bool) bool { if enable { DmUdevSetSyncSupport(1) } else { DmUdevSetSyncSupport(0) } return UdevSyncSupported() } 我可以看到原因是启用udev同步失败.如何成功启用udev同步? 更新: (gdb) disassemble dm_udev_set_sync_support Dump of assembler code for function dm_udev_set_sync_support: => 0x0000000000a3e4e0 <+0>: repz retq End of assembler dump. 它是一个空函数,什么都不做,没有提到set sync支持.这是否意味着这个静态构建的docker二进制文件是不可用的? 解决方法我不能重现你的问题;我得到以下内容:(gdb) disassemble dm_udev_set_sync_support Dump of assembler code for function dm_udev_set_sync_support@plt: 0x0000000000403420 <+0>: jmpq *0xda8c92(%rip) # 0x11ac0b8 <dm_udev_set_sync_support@got.plt> 0x0000000000403426 <+6>: pushq $0x14 0x000000000040342b <+11>: jmpq 0x4032d0 帮自己一个忙:忽略docker.io所做的构建,直接从RHEL获取Docker.它可以在Extras频道中找到.虽然它通常比上游版本落后几周(例如1.6而不是1.7),但它也经过了充分测试并保证实际工作. (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- linux – 如何检查OpenSSL中的FIPS 140-2支持?
- linux – process_usershare_file:stat失败.允许拒绝Samba
- 编写Linux内核模块时获取用户进程pid
- linux – 使用IP V6寻址多少钱?
- 您是否为每个设备使用相同的root密码?
- liunx 错误提示E45: readonly option is set (add ! to ove
- C嵌入式软件编程
- linux – 多个服务器就像一个具有所有硬件的服务器?
- linux – 如何解决SVN 1.6不支持的存储库间单文件外部问题?
- /etc/sudoers: syntax error near line 27 解决方法