美文网首页程序员
在docker下使用ntpdate同步时间时报错`ntpdate

在docker下使用ntpdate同步时间时报错`ntpdate

作者: x1ankun | 来源:发表于2017-04-24 13:44 被阅读0次

场景

在docker下使用ntpdate同步时间时

原因

应该是因为容器的内核不能适合宿主机的共享导致

解决方案

  1. 推荐挂载宿主机locatime文件,实现原理:首先宿主机间实现时间同步,然后容器启动时以只读方式挂载宿主机的/etc/localtime文件实现各宿主机上的Docker容器间的时间同步。
  2. 提权(不推荐):在创建一个docker容器是添加--privileged选项

相关文章

网友评论

    本文标题:在docker下使用ntpdate同步时间时报错`ntpdate

    本文链接:https://www.haomeiwen.com/subject/dbqpzttx.html