GithubHelp home page GithubHelp logo

docker-ntp's Introduction

introduce

用于构建cdm所需要的ntp服务器镜像

image build

docker image build -t fino-cdm-ntp:v2.0

run

docker run   --rm -it fino-cdm-ntp:v2.0

run cluster

docker compose up

config

我们通过下面的几步来完成ntp服务端和��客户端的搭建

  1. 在server的服务机器上我们通过
    volumes:
        - /etc/localtime:/etc/localtime:ro 
    让docker和服务器的时间保持一致
  2. �在server的服务上还需要配置/etc/ntp.conf,�方式如下shell
    rm /etc/ntp.conf
    cat >> /etc/ntp.conf <<EOF
    # **这边最活跃的时间服务器 : http://www.pool.ntp.org/zone/cn
    server 0.ubuntu.pool.ntp.org 
    server 1.ubuntu.pool.ntp.org 
    server 2.ubuntu.pool.ntp.org 
    server 3.ubuntu.pool.ntp.org
    # allow update time by the upper server
    restrict 0.cn.pool.ntp.org nomodify notrap noquery
    restrict 0.asia.pool.ntp.org nomodify notrap noquery
    restrict 3.asia.pool.ntp.org nomodify notrap noquery
    # Undisciplined Local Clock. This is a fake driver intended for backup
    # and when no outside source of synchronized time is available.
    # 外部时间服务器不可用时,以本地时间作为时间服务
    server  127.127.1.0     # local clock
    fudge   127.127.1.0 stratum 10
    EOF
  3. 在client的服务上对/etc/ntp/。方式如下shell
    echo "server ${NTP_SERVER_HOSTNAME} prefer" >> /etc/ntp.conf
    echo "restrict ${NTP_SERVER_HOSTNAME} " >> /etc/ntp.conf

docker-ntp's People

Contributors

osenlin avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.