How to use chrony to synchronize timestamp on two computers












1















I need to compare results which come from two different laptops.
Each laptop has a different set of sensors and in order to correctly compare them I need to have the same timestamp on both laptops.
They are not connected to public internet, but if necessary, I can use a router to make them communicate locally over ethernet.



I installed chrony on both computers, but I didn't understand how to setup the master and how to configure the client.



I've checked these instructions:



Master:

driftfile /var/lib/chrony/drift
local stratum 8
manual
allow 192.168.165
smoothtime 400 0.01

Clients:

server master iburst
driftfile /var/lib/chrony/drift
logdir /var/log/chrony
log measurements statistics tracking


but I didn't understand if I need to specify these commands in command-line or if I have to create a text file named "drift" containing these instructions and put it inside /var/lib/chrony/ and then restart chrony.



Can you help me, please?
I really cant understand how to use chrony!



Thank you!










share|improve this question

























  • I tried to find some tutorial on Google but I wasn't able to find out how to setup the configuration for the master. Still don't know if I need to create a new file or if I need to modify something else..

    – Marcus Barnet
    Jun 17 '16 at 1:41
















1















I need to compare results which come from two different laptops.
Each laptop has a different set of sensors and in order to correctly compare them I need to have the same timestamp on both laptops.
They are not connected to public internet, but if necessary, I can use a router to make them communicate locally over ethernet.



I installed chrony on both computers, but I didn't understand how to setup the master and how to configure the client.



I've checked these instructions:



Master:

driftfile /var/lib/chrony/drift
local stratum 8
manual
allow 192.168.165
smoothtime 400 0.01

Clients:

server master iburst
driftfile /var/lib/chrony/drift
logdir /var/log/chrony
log measurements statistics tracking


but I didn't understand if I need to specify these commands in command-line or if I have to create a text file named "drift" containing these instructions and put it inside /var/lib/chrony/ and then restart chrony.



Can you help me, please?
I really cant understand how to use chrony!



Thank you!










share|improve this question

























  • I tried to find some tutorial on Google but I wasn't able to find out how to setup the configuration for the master. Still don't know if I need to create a new file or if I need to modify something else..

    – Marcus Barnet
    Jun 17 '16 at 1:41














1












1








1








I need to compare results which come from two different laptops.
Each laptop has a different set of sensors and in order to correctly compare them I need to have the same timestamp on both laptops.
They are not connected to public internet, but if necessary, I can use a router to make them communicate locally over ethernet.



I installed chrony on both computers, but I didn't understand how to setup the master and how to configure the client.



I've checked these instructions:



Master:

driftfile /var/lib/chrony/drift
local stratum 8
manual
allow 192.168.165
smoothtime 400 0.01

Clients:

server master iburst
driftfile /var/lib/chrony/drift
logdir /var/log/chrony
log measurements statistics tracking


but I didn't understand if I need to specify these commands in command-line or if I have to create a text file named "drift" containing these instructions and put it inside /var/lib/chrony/ and then restart chrony.



Can you help me, please?
I really cant understand how to use chrony!



Thank you!










share|improve this question
















I need to compare results which come from two different laptops.
Each laptop has a different set of sensors and in order to correctly compare them I need to have the same timestamp on both laptops.
They are not connected to public internet, but if necessary, I can use a router to make them communicate locally over ethernet.



I installed chrony on both computers, but I didn't understand how to setup the master and how to configure the client.



I've checked these instructions:



Master:

driftfile /var/lib/chrony/drift
local stratum 8
manual
allow 192.168.165
smoothtime 400 0.01

Clients:

server master iburst
driftfile /var/lib/chrony/drift
logdir /var/log/chrony
log measurements statistics tracking


but I didn't understand if I need to specify these commands in command-line or if I have to create a text file named "drift" containing these instructions and put it inside /var/lib/chrony/ and then restart chrony.



Can you help me, please?
I really cant understand how to use chrony!



Thank you!







networking ntp timestamp






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 17 '16 at 1:40







Marcus Barnet

















asked Jun 16 '16 at 17:31









Marcus BarnetMarcus Barnet

1064




1064













  • I tried to find some tutorial on Google but I wasn't able to find out how to setup the configuration for the master. Still don't know if I need to create a new file or if I need to modify something else..

    – Marcus Barnet
    Jun 17 '16 at 1:41



















  • I tried to find some tutorial on Google but I wasn't able to find out how to setup the configuration for the master. Still don't know if I need to create a new file or if I need to modify something else..

    – Marcus Barnet
    Jun 17 '16 at 1:41

















I tried to find some tutorial on Google but I wasn't able to find out how to setup the configuration for the master. Still don't know if I need to create a new file or if I need to modify something else..

– Marcus Barnet
Jun 17 '16 at 1:41





I tried to find some tutorial on Google but I wasn't able to find out how to setup the configuration for the master. Still don't know if I need to create a new file or if I need to modify something else..

– Marcus Barnet
Jun 17 '16 at 1:41










1 Answer
1






active

oldest

votes


















0














the default config in chrony comes with most of this already, no need to change drift or logfile.
Your example pretty much looks like the section "Isolated networks" in man chrony.conf so there you can find more details.



The changes you need are all in /etc/chrony.conf afterwards restart the service via systemctl restart chrony.



In addition to the default config you only need:



a) on master:



# make it serve time even if it is not synced (as it can't reach out)
local stratum 8
# allow the IP of your peer to connect (subnet not specific IP)
allow 192.168.XX


b) on client:



# set the servers IP here to sync to it
server <IP> iburst
# remove the default servers in the config


The rest you had in your example is either already in the default configuration or doesn't fit your use case.
For example smoothtime will make the served time less jumpy, interesting as you have no high quality clock on your master. But if your use case just wants them the same no matter how jumpy, then this is actually not what you want.






share|improve this answer

























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f787855%2fhow-to-use-chrony-to-synchronize-timestamp-on-two-computers%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    the default config in chrony comes with most of this already, no need to change drift or logfile.
    Your example pretty much looks like the section "Isolated networks" in man chrony.conf so there you can find more details.



    The changes you need are all in /etc/chrony.conf afterwards restart the service via systemctl restart chrony.



    In addition to the default config you only need:



    a) on master:



    # make it serve time even if it is not synced (as it can't reach out)
    local stratum 8
    # allow the IP of your peer to connect (subnet not specific IP)
    allow 192.168.XX


    b) on client:



    # set the servers IP here to sync to it
    server <IP> iburst
    # remove the default servers in the config


    The rest you had in your example is either already in the default configuration or doesn't fit your use case.
    For example smoothtime will make the served time less jumpy, interesting as you have no high quality clock on your master. But if your use case just wants them the same no matter how jumpy, then this is actually not what you want.






    share|improve this answer






























      0














      the default config in chrony comes with most of this already, no need to change drift or logfile.
      Your example pretty much looks like the section "Isolated networks" in man chrony.conf so there you can find more details.



      The changes you need are all in /etc/chrony.conf afterwards restart the service via systemctl restart chrony.



      In addition to the default config you only need:



      a) on master:



      # make it serve time even if it is not synced (as it can't reach out)
      local stratum 8
      # allow the IP of your peer to connect (subnet not specific IP)
      allow 192.168.XX


      b) on client:



      # set the servers IP here to sync to it
      server <IP> iburst
      # remove the default servers in the config


      The rest you had in your example is either already in the default configuration or doesn't fit your use case.
      For example smoothtime will make the served time less jumpy, interesting as you have no high quality clock on your master. But if your use case just wants them the same no matter how jumpy, then this is actually not what you want.






      share|improve this answer




























        0












        0








        0







        the default config in chrony comes with most of this already, no need to change drift or logfile.
        Your example pretty much looks like the section "Isolated networks" in man chrony.conf so there you can find more details.



        The changes you need are all in /etc/chrony.conf afterwards restart the service via systemctl restart chrony.



        In addition to the default config you only need:



        a) on master:



        # make it serve time even if it is not synced (as it can't reach out)
        local stratum 8
        # allow the IP of your peer to connect (subnet not specific IP)
        allow 192.168.XX


        b) on client:



        # set the servers IP here to sync to it
        server <IP> iburst
        # remove the default servers in the config


        The rest you had in your example is either already in the default configuration or doesn't fit your use case.
        For example smoothtime will make the served time less jumpy, interesting as you have no high quality clock on your master. But if your use case just wants them the same no matter how jumpy, then this is actually not what you want.






        share|improve this answer















        the default config in chrony comes with most of this already, no need to change drift or logfile.
        Your example pretty much looks like the section "Isolated networks" in man chrony.conf so there you can find more details.



        The changes you need are all in /etc/chrony.conf afterwards restart the service via systemctl restart chrony.



        In addition to the default config you only need:



        a) on master:



        # make it serve time even if it is not synced (as it can't reach out)
        local stratum 8
        # allow the IP of your peer to connect (subnet not specific IP)
        allow 192.168.XX


        b) on client:



        # set the servers IP here to sync to it
        server <IP> iburst
        # remove the default servers in the config


        The rest you had in your example is either already in the default configuration or doesn't fit your use case.
        For example smoothtime will make the served time less jumpy, interesting as you have no high quality clock on your master. But if your use case just wants them the same no matter how jumpy, then this is actually not what you want.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 18 at 22:08









        user3806123

        32




        32










        answered Mar 22 '18 at 10:27









        Christian EhrhardtChristian Ehrhardt

        521210




        521210






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f787855%2fhow-to-use-chrony-to-synchronize-timestamp-on-two-computers%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?