How to monitor the ntpd and ntpdate running status?

957

Solution 1

Additionally, NTPDate is not a service/daemon. It's a one-time command tool that immediately synchronizes the software clock. It's packaged with NTP on some Linux distributions, but not necessarily all.

I would not recommend its use on a system that is running a database. Historically, many database products don't deal well with abrupt changes in system time.

Solution 2

Note that the authors of ntp/ntpdate deprecate the use of ntpdate. The recommendation is to run ntpd to keep your clock continuously synced. The page where they explain why they deprecate it has lots of good information about how to use ntpd in a context where it is replacing ntpdate.

Once you have been running ntpd long enough to have a good drift file, there should be no reason to use ntpdate at all. As long as ntpd is properly configured (which the above page discusses, the important parts being that it is running with -g, and you have iburst for a good server), ntpd should be able to correct your clock quickly. If you need for some reason to wait for ntpd to get a good sync before doing something (like starting a service that needs the time to be correct), you can use the ntp-wait command.

Solution 3

ntpq -p will show you the status of the NTP daemon, with information about which peers it's syncing with and its opinion on the hygiene habits (or clock accuracy, if you prefer) of each.

Share:
957

Related videos on Youtube

krishna reddy Vardhireddy
Author by

krishna reddy Vardhireddy

Updated on September 18, 2022

Comments

  • krishna reddy Vardhireddy
    krishna reddy Vardhireddy over 1 year

    enter image description here

    I have configured the jenkins job for building the grails application war file as shown in the picture. I have checked the output console i got the following error.

    Output console Error: [JENKINS-7702] sanitizing $JAVA_OPTS
        [workspace] $ cmd.exe /C '"G:\practice\jenkins\tools\com.g2one.hudson.grails.GrailsInstallation\grails-2.2.4\bin\grails.bat -Dgrails.work.dir=/G:/practice/jenkins/jobs/Grails-Jenkins/workspace//target clean --non-interactive --plain-output && exit %%ERRORLEVEL%%"'
        Can't load log handler "1catalina.org.apache.juli.FileHandler"
        java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler
        java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler
            at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
            at java.util.logging.LogManager$4.run(LogManager.java:808)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:802)
            at java.util.logging.LogManager.addLogger(LogManager.java:1008)
            at java.util.logging.LogManager$1.run(LogManager.java:209)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.util.logging.LogManager.<clinit>(LogManager.java:181)
            at java.util.logging.Logger.demandLogger(Logger.java:339)
            at java.util.logging.Logger.getLogger(Logger.java:393)
            at org.codehaus.groovy.runtime.DefaultGroovyMethodsSupport.<clinit>(DefaultGroovyMethodsSupport.java:33)
            at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:96)
            at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:73)
            at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:33)
            at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:62)
            at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32)
            at groovy.lang.Closure.<init>(Closure.java:221)
            at groovy.lang.Closure.<init>(Closure.java:238)
            at groovy.lang.Closure$1.<init>(Closure.java:205)
            at groovy.lang.Closure.<clinit>(Closure.java:205)
            at org.codehaus.groovy.grails.cli.GrailsScriptRunner.<clinit>(GrailsScriptRunner.java:84)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:234)
            at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:234)
            at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)
    

    Please assist me on the grails build configuration.

  • aboutstudy
    aboutstudy over 12 years
    In some condition, such as the server was restart before the ntpd is running, should I run the commmand tool of ntpdate?
  • Magellan
    Magellan over 12 years
    I think you're looking at it backwards. I only recommend running ntpdate before any time-sensitive services (such as databases) start up during the boot process. I seem to recall that there were option to call ntpdate at NTPd service start for an initial time sync, but I can no longer find that reference.
  • Magellan
    Magellan over 12 years
    Although further research indicates that the ntpdate isn't as problematic as it used to be. I'd still recommend shutting down any databases before doing an ntpdate time sync.
  • krishna reddy Vardhireddy
    krishna reddy Vardhireddy about 8 years
    I have tried the above solutions: targets: clean refresh-dependencies "war target/ROOT.war" But still getting the same error.
  • krishna reddy Vardhireddy
    krishna reddy Vardhireddy about 8 years
    Getting the below error: [workspace] $ cmd.exe /C '"C:\grails-2.2.4\bin\grails.bat -Dgrails.work.dir=/G:/practice/jenkins/jobs/Grails-Jenkins/w‌​orkspace//target upgrade --non-interactive && exit %%ERRORLEVEL%%"' Can't load log handler "1catalina.org.apache.juli.FileHandler"
  • Michal_Szulc
    Michal_Szulc about 8 years
    do you have CATALINA_HOME set?
  • krishna reddy Vardhireddy
    krishna reddy Vardhireddy about 8 years
    I set the environment variable CATELINE_HOME for tomcat server Still getting the some errors: 1:Can't load log handler "4host-manager.org.apache.juli.FileHandler" java.lang.ClassNotFoundException: 4host-manager.org.apache.juli.FileHandler 2.Can't load log handler "3manager.org.apache.juli.FileHandler" java.lang.ClassNotFoundException: 3manager.org.apache.juli.FileHandler 3.Can't load log handler "2localhost.org.apache.juli.FileHandler" java.lang.ClassNotFoundException: 2localhost.org.apache.juli.FileHandler
  • krishna reddy Vardhireddy
    krishna reddy Vardhireddy about 8 years
    But build getting success and deploying to the tomcat server. I have no idea why i am getting those errors still....
  • Michal_Szulc
    Michal_Szulc about 8 years
    Check this out: tomcat.10.x6.nabble.com/…