Configuración de NTP en Servidor Linux y RAC10G

Embed Size (px)

Citation preview

  • 8/3/2019 Configuracin de NTP en Servidor Linux y RAC10G

    1/9

    Configuracin de NTP en Servidor Linux y

    RAC10G.

    Para poder sincronizar los tres nodos en tiempo y fecha de RAC10G, se debeconfigurar primero un servidor de Linux, para lo cual hay que hacer lo

    siguiente:

    1) Se deber levantar el servicio y ponerlo que lo levante en forma

    automtica, dndole Save:

    2) Es necesario modificar un archivo de configuracin en /etc/ntp.conf y

    agregar las siguientes lineas:

  • 8/3/2019 Configuracin de NTP en Servidor Linux y RAC10G

    2/9

    3) Luego se revisa si est corriendo el servicio de NTP ejecutando desderoot, pgrep ntp y este devuelve un numero de proceso.

    4) Posteriormente es necesario volver a reiniciar el servicio para que tome

    efecto el cambio que se realiz en el archivo de configuracin del tem

    2), haciendo desde root, service ntpd restart

    5) El servidor debe de contar con permisos de Internet, y correr el siguiente

    comando para sincronizar el servidor de Linux con el servidor de tiempode internet, para hacer esto es necesario correr el siguiente comando:

    ntpdate u 209.81.9.7, este muestra el mensaje de sincronizacin

  • 8/3/2019 Configuracin de NTP en Servidor Linux y RAC10G

    3/9

    6) Luego es necesario, volver a reiniciar el servicio de NTP, service ntpd

    restart, con eso queda sincronizado el servidor de Linux con el servidor

    de tiempo de Internet..

    7) Posteriormente, se configura uno por uno cada nodo del RAC10G, el

    mismo se puede hacer desde la forma grfica de HP-UX, escribiendo en

    una pantalla de root el comando sam

    8) Luego en la opcin de time

    9) Se ingresa en la opcin de NTP

    10) Se agrega el servidor en

  • 8/3/2019 Configuracin de NTP en Servidor Linux y RAC10G

    4/9

    11) Ya con el servidor agregado queda as:

  • 8/3/2019 Configuracin de NTP en Servidor Linux y RAC10G

    5/9

    12) Luego hay que poner a correr el servicio desde Actions, y se leeRunning.

    13) Finalmente se corre el comando ntpdate u 10.13.12.64 que sera

    el servidor Linux.

    14) Es recomendable revisar el archivo /etc/ntp.conf en este archivo al

    final aparece el servidor de tiempo agregado.

    15) El cambio de tiempo, no presenta ningn problema.

  • 8/3/2019 Configuracin de NTP en Servidor Linux y RAC10G

    6/9

    16) La informacin se saco del siguiente tutorial:

    The /etc/ntp.conf File

    The /etc/ntp.conf file is the main configuration file for Linux NTP in which you place the

    IP addresses of the stratum 1 and stratum 2 servers you want to use. Here are the steps to

    create a configuration file using a pair of sample Internet-based NTP servers:

    1) First we specify the servers you're interested in:

    server otherntp.server.org # A stratum 1 server at server.org

    server ntp.research.gov # A stratum 2 server at research.gov

    2) Restrict the type of access you allow these servers. In this example the servers are notallowed to modify the run-time configuration or query your Linux NTP server.

    restrict otherntp.server.org mask 255.255.255.255 nomodify notrap

    noquery

    restrict ntp.research.gov mask 255.255.255.255 nomodify notrap

    noquery

    The mask 255.255.255.255 statement is really a subnet mask limiting access to the single

    IP address of the remote NTP servers.

    3) If this server is also going to provide time for other computers, such as PCs, other Linuxservers and networking devices, then you'll have to define the networks from which thisserver will accept NTP synchronization requests. You do so with a modified restrict

    statement removing the noquery keyword to allow the network to query your NTP server.

    The syntax is:

    restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

  • 8/3/2019 Configuracin de NTP en Servidor Linux y RAC10G

    7/9

    In this case the mask statement has been expanded to include all 255 possible IP addresses

    on the local network.

    4) We also want to make sure that localhost (the universal IP address used to refer to aLinux server itself) has full access without any restricting keywords:

    restrict 127.0.0.1

    5) Save the file and restart NTP for these settings to take effect. You can now configureother Linux hosts on your network to synchronize with this new master NTP server in a

    similar fashion.

    How To Get NTP Started

    You have to restart the NTP process every time you make a change to the configuration file

    for the changes to take effect on the running process.

    To get NTP configured to start at boot, use the line:

    [root@bigboy tmp]# chkconfig ntpd on

    To start, stop and restart NTP after booting, follow these examples:

    [root@bigboy tmp]# service ntpd start

    [root@bigboy tmp]# service ntpd stop

    [root@bigboy tmp]# service ntpd restart

    Testing And Troubleshooting NTP

    After configuring and starting NTP, you should test it to make sure it is working. Here aresome guidelines you can follow to get NTP working correctly.

    Verifying NTP is Running

    To test whether the NTP process is running use the command

    [root@bigboy tmp]# pgrep ntpd

    You should get a response of plain old process ID numbers.

  • 8/3/2019 Configuracin de NTP en Servidor Linux y RAC10G

    8/9

    Doing An Initial Synchronization

    If the time on the local server is very different from that of its primary time server your

    NTP daemon will eventually terminate itself leaving an error message in the/var/log/messages file. You should run the ntpdate -u command to force your server to

    become instantly synchronized with its NTP servers before starting the NTP daemon for thefirst time. The ntpdate command doesn't run continuously in the background, you will stillhave to run the ntpd daemon to get continuous NTP updates.

    Take a look at some sample output of the ntpdate command in which a server whose initial

    time was set to midnight, was correctly set to 8:03 am.

    The date was originally set to midnight which was verified by using the datecommand.

    [root@smallfry tmp]# date

    Thu Aug 12 00:00:00 PDT 2004[root@smallfry tmp]#

    The ntpdate command is run three times to synchronize smallfry's clock to server

    192.168.1.100, but it must be run while the ntpd process is stopped. So you'll haveto stop ntpd, run ntpdate and then start ntpd again.

    [root@smallfry tmp]# service ntpd stop

    [root@smallfry tmp]# ntpdate -u 192.168.1.100

    Looking for host 192.168.1.100 and service ntp

    host found : bigboy.my-site.com

    12 Aug 08:03:38 ntpdate[2472]: step time server 192.168.1.100 offset

    28993.084943 sec

    [root@smallfry tmp]# ntpdate -u 192.168.1.100

    Looking for host 192.168.1.100 and service ntp

    host found : bigboy.my-site.com

    12 Aug 08:03:40 ntpdate[2472]: step time server 192.168.1.100 offset

    2.467652 sec

    [root@smallfry tmp]# ntpdate -u 192.168.1.100

    Looking for host 192.168.1.100 and service ntp

    host found : bigboy.my-site.com

    12 Aug 08:03:42 ntpdate[2472]: step time server 192.168.1.100 offset

    0.084943 sec

    [root@smallfry tmp]# service ntpd start

    [root@smallfry tmp]#

    The date is now corrected.

    [root@smallfry tmp]# date

    Thu Aug 12 08:03:45 PDT 2004

    [root@smallfry tmp]#

  • 8/3/2019 Configuracin de NTP en Servidor Linux y RAC10G

    9/9

    Determining If NTP Is Synchronized Properly

    Use the ntpq command to see the servers with which you are synchronized. It provided you

    with a list of configured time servers and the delay, offset and jitter that your server isexperiencing with them. For correct synchronization, the delay and offset values should be

    non-zero and the jitter value should be under 100.

    [root@bigboy tmp]# ntpq -p