No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

OceanStor BCManager 6.5.0 eReplication User Guide 02

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Configuring the Time Zone and the NTP Service (SUSE Linux)

Configuring the Time Zone and the NTP Service (SUSE Linux)

In SUSE Linux, the NTP service is often used to synchronize time between servers to avoid time difference caused by long-term running.

Prerequisites

  • A cross-platform remote access tool, such as PuTTY, has been obtained.
  • The password of user root for logging in to the SUSE Linux operating system has been obtained.

Context

Common NTP service commands (in SUSE Linux) include:
  • Starting the NTP service: /etc/init.d/ntp start
  • Stopping the NTP service: /etc/init.d/ntp stop
  • Restarting the NTP service: /etc/init.d/ntp restart
  • Checking the NTP service status: /etc/init.d/ntp status

Procedure

  1. Check the time zone.

    1. Use PuTTY to log in to the eReplication Server management server.
      Use the DRManager account to log in, and run the su - root command to switch to user root.
      NOTE:
      The default password of user DRManager is Huawei@CLOUD8.In template-based installation mode, the default password of user root is Huawei@CLOUD8!.
    2. Run the following command to prevent PuTTY from exiting due to session timeout:

      TMOUT=0

      NOTE:

      After you run this command, the system continues to run when no operation is performed, resulting a risk. For security purposes, you are advised to run the exit command to exit the system after completing your operations.

    3. Run the date command to check the current time zone. If the it is inconsistent with the onsite time zone, change it according to 2.

  2. (Optional) Change the time zone.

    1. Run the tzselect command.

      The following command output is displayed:

    2. Select a proper time zone based on the command output.

      Asia/Shanghai is selected as the onsite time zone for reference. After this, the following is displayed:

    3. Enter 1 and press Enter.

      The following information is displayed:

    4. Run the vim /etc/profile command to open the profile file. Press i to go to the editing mode and add the following information obtained from 2.c to the end of the file.
      TZ='Asia/Shanghai'; export TZ
      NOTE:

      If exit 0 exists at the end of the file, add the information above the exit 0 row.

    5. Press ESC to enter the browsing mode. Then, press Shift and : simultaneously, and run the wq! command to save the configuration and exit.
    6. Run the TZ='Asia/Shanghai'; export TZ command to modify the time zone.

  3. Use PuTTY to log in to the SUSE Linux server as user root.
  4. Run the following command to prevent PuTTY from exiting due to session timeout:

    TMOUT=0

    NOTE:

    After you run this command, the system continues to run when no operation is performed, resulting a risk. For security purposes, you are advised to run the exit command to exit the system after completing your operations.

  5. Check whether the NTP service is installed.

    Run the rpm -qa | grep ntp command. If the NTP version information, for example, ntpdate-4.2.6p5-1.el6.x86_64, is displayed, NTP is installed. Otherwise, NTP is not installed.

  6. Configure the NTP server.
    1. Configure file /etc/ntp.conf.

      1. Run the following command to edit file /etc/ntp.conf.

        vi /etc/ntp.conf

      2. Press i to edit the edit mode. In the end of file /etc/ntp.conf, add the following content:
        restrict 192.168.0.0 mask 255.255.0.0 nomodify
        restrict 0.0.0.0 mask 0.0.0.0 nomodify notrap noquery notrust
        
        • restrict 192.168.0.0 mask 255.255.0.0 nomodify: indicates that hosts whose IP addresses are 192.168.*.* can use the NTP service.
        • restrict 0.0.0.0 mask 0.0.0.0 nomodify notrap noquery notrust : indicates that hosts of other network segments cannot use the NTP service to update time.
      3. After edition, press Esc and run the :wq! command to save and exit.

    2. Run the service ntpd start command to start the NTP service.
    3. Run the chkconfig ntp on command to configure the NTP auto-startup service (the NTP service automatically starts along with the system startup).
  7. Configure the NTP client.
    1. Add a scheduled time synchronization task.

      1. Log in to the client host (192.168.80.80 is used as the IP address of the client host in the following example):
      2. Run the crontab -e command.
      3. Add the following content at the end of the command:
        */1 * * * * ntpdate 192.168.80.80
        The basic format of a scheduled task is * * * * * command:
        • First *: minute, 0 to 59. * or */1 indicates each minute.
        • Second *: hour, 0 (0 or 24 o'clock) to 23
        • Third *: date, 0 to 31
        • Fourth *: mount, 1 to 12
        • Fifth *: a day in a week, 0 (Sunday) to 6
        • The previous five parameters can be set to *, which indicate every minute, hour, day, mount, and week, respectively.
        • command: content executed as scheduled

    2. Run the service cron restart command to restart the scheduled task.
Translation
Download
Updated: 2019-05-21

Document ID: EDOC1100075861

Views: 12265

Downloads: 66

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next