Modify/etc/ntp. conf file content: add a line: serverasia. pool. ntp. orgprefer comment out this line: server127.127.1.0 start the ntp service: servicentpdstart modify the/etc/sysconfig/ntpd file, and change SYNC_HWCLOCKno to SYNC_H... modify/etc/ntp. conf file content:
Add a row: server asia.pool.ntp.org prefer
Comm
Configure the time synchronization server ntp on centos7
Method 1: simple, efficient, and easy to useNtpdate-u ntp. api. bzMethod 2: Time Server:1) sudo yum install ntp2) sudo nano/etc/ntp. confComment a lineRestrict default ignoreAdd a rowRestrict 192.168.1.0 mask 255.255.
The local clock in the Xen Linux machine is by default (done) synchronized with the physical host clock, in order to change the time it uses the Sync Service for NTP, the kernel parameters must be set by the virtual machine:Shell CodeEcho 1 >/proc/sys/xen/independent_wallclock
The/etc/sysctl.conf configuration file in the virtual machine adds the following two and takes effect after reboot.Config code# Set
1. Download NTP time software2, configure the beach time zone3, start this time software, and boot from the start4. Set the time manually to turn off the sync time provided by Red Hat5, open the configuration file configuration, r
Configuration from server:2.1 Package Installation:[email protected] ~]# Yum install-y bind Bind-chroot Bind-utlis2.2 Copy profile Template:[Email protected] ~]# cp-rv/usr/share/doc/bind-9.8.2/sample/etc/*/var/named/chroot/etc/2.3 Changing the server from the configuration file[Email protected] etc]# vi/var/named/chroot/etc/named.confOptions{ // Put files that named is allowed to write in the data/ directory: directory "/var/named"; // "Working" directory dump-f
Configure NTP Automatic Update timeInstalling the Ntpdate Program
shell># yum–y Install Ntpdate
Use Crontab to set the system to synchronize time with the NTP server 0:00 per dayshell># crontab–e
0 0 * * * ntpdate your_ntp_server_domain_name or YOUR_NTP_SERVER_IP_ADDR
Save Exit,For our steps to go on, we perfo
Windows is used for several years, and there is always a time to change the system time. However, it is easy to adjust the system time. It is not that easy to call up a correct one. A few years ago (when I was still in college, it was about a junior) I used C # To write an NTP
Program But when the
If you only need to synchronize once, then execute the following command to rdate-stime.nist.gov where time.nist.gov is a time server, of course you can also use another time server. If the time of multiple servers needs to be fully synchronized, it is best to configure a unified automatic synchronization task for thes
1. change the system time zone to the Shanghai time zone cp/usr/share/zoneinfo/Asia/Shanghai/etc/localtime2. write a script ntp. cron #! /Bin/bash/usr/sbin/ntpdatentp.fudan.edu.cn | logger-tNTP put the script in/etc/cron. daily...
1. change the system time zone to the Shanghai tim
Tags: exiting execute command not and the technology share port syncerror message:Error reason analysis:Because the XNTPD is already bound to the Socket. When you run Ntpdate, it broadcasts first, and then listens on port 123.If XNTPD is running and a process is already listening on that port, it will cause ntpdate to fail to run on it. Run the following command to find the PID of the XNTPDSolution:Appears: pts/0 00:00:00 grep xntpd indicates that no PID was found.Using lsof–i:123Output:-bash:ls
If "the NTP socket is in use, exiting" is displayed when ntpdate is used for synchronization, you can solve the problem as follows.
1. Disable ntpdate first
Service ntpdate stop
2. Execute time synchronization again
Ntpdate us.pool.ntp.org
3. Check whether the time is correct.
Date
If the time zone is
or test it.
[root@localhost ~]# ntpdate time.nist.gov 22 Oct 21:11:43 ntpdate[5014]: adjust time server 207.200.81.113 offset -0.018788 sec
If the above content shows that the synchronization is successful. Add the following content to the crontab.
*/10 * ntpdate time.nist.gov # domain name or IP address
Synchronize data every 10 minutes. Several time servers
Start Multiple tomcat servers and tomcat servers at the same time during local development
1. Do not set CATALINA_HOME in environment variables;
2. Modify the server. xml file in the conf subdirectory of the installation directory respectively:
A. Modify the http access port (port 8080 by default) and set port 8080 to a port number that is not used by tomcat.
Standalone host
Rm-rf/etc/localtime
Ln-s/usr/share/zoneinfo/asia/shanghai/etc/localtime #修改时区到东8区.
Date-r #查看的时区设置.
Next, adjust the system time to time server synchronization
The Debian system installs the NTP school pack:
The code is as follows:
Apt-get Install Ntpdate #安装ntp
CentOS System Install
Since the company's games need to be launched in Vietnam and South Korea, the time in Vietnam is one hour slower than ours, and the time in South Korea is one hour faster than ours, therefore, when configuring the system environment on the server, you need to set the time point for the Vietnamese server to synchronize with Vietnam, and the
this yearSelect dateadd (yyyy, datediff (yyyy, 0, getdate (), 0)-- On the last day of this month, note that SQL is accurate to 3 ms...Select dateadd (MS,-3, dateadd (mm, datediff (mm, 0, getdate () + ))-- On the last day of the week, note that SQL is accurate to 3 ms...Select dateadd (MS,-3, dateadd (wk, datediff (wk, 0, getdate () + ));-- The first Monday of this monthSelect dateadd (wk, datediff (wk, 0, dateadd (DD, 6-datepart (day, getdate (), getdate (), 0 );
Note: This example cannot be
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.