Linux系统(centos)同步时间方式

.删除本地时间并设置时区为上海

rm -rf /etc/localtime

ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

1 yum install ntp ntpdate

2 ntpdate -u ntp.sjtu.edu.cn 202.120.2.101

3 date(同步成功后 查看日期时间  有时候同步不上 需要多同步几次)

4 写入硬件 hwclock -w

以下是国内常见的NTP服务器 ntp.sjtu.edu.cn 202.120.2.101 上海交通大学网络中心 s1a.time.edu.cn 北京邮电大学

s1b.time.edu.cn 清华大学
s1c.time.edu.cn 北京大学
s1d.time.edu.cn 东南大学
s1e.time.edu.cn 清华大学
s2a.time.edu.cn 清华大学
s2b.time.edu.cn 清华大学
s2c.time.edu.cn 北京邮电大学
s2d.time.edu.cn 西南地区网络中心
s2e.time.edu.cn 西北地区网络中心
s2f.time.edu.cn 东北地区网络中心
s2g.time.edu.cn 华东南地区网络中心
s2h.time.edu.cn 四川大学网络管理中心
s2j.time.edu.cn 大连理工大学网络中心
s2k.time.edu.cn CERNET桂林主节点
s2m.time.edu.cn 北京大学

原文地址:https://www.cnblogs.com/Samuel-Leung/p/10490839.html

时间: 2024-08-29 15:41:35

Linux系统(centos)同步时间方式的相关文章

U盘移动硬盘引导启动安装linux系统Centos 6.4

U盘.移动硬盘引导启动安装linux系统[Centos 6.4 ] U盘.移动硬盘引导启动安装linux系统[Centos 6.4 ]( rhel基本相同) 本文案例是我安装32系统的,64位时U盘单个文件大于4G不能fat32格式问题暂时没提供,有条件时一定研究下在补上,现在是老爷机. <p style=\"\\"padding:0px;color:#333333;font-family:tahoma,\"> 6.0 .6.3live cd均试验过只是存放位置有

每天进步一点点——Linux系统中的时间处理

转载请说明出处:http://blog.csdn.net/cywosp/article/details/25839551 在程序中时间处理往往是一个麻烦的事,Linux系统提供了很多关于时间处理的函数,我们可以用这些函数来完成我们所需要的功能.那么在程序中一般会关心哪些时间问题呢? 真实时间:程序运行的时间,即程序启动到程序消亡所用时间或程序运行到现在所经过的时间 进程时间:一个进程所使用的CPU时间总量,适用于对程序.算法性能的检查或优化 本文只关注真实时间的处理与转换 一.Epoch 无论地

查看linux系统的开机时间/重启历史记录

查看linux系统的开机时间/重启历史记录1.who -b命令[[email protected] opt]# who -b ---查看最后一次(上次)系统启动的时间 system boot Dec 27 05:06 2.who -r命令[[email protected] opt]# who -r ---查看最后一次(上次)系统启动的时间,及运行级别 run-level 5 Dec 27 05:06 3.last reboot命令 [[email protected] opt]# last r

linux设置时区同步时间

linux设置时区同步时间 一.运行tzselect sudo tzselect 在这里我们选择亚洲 Asia,确认之后选择中国(China),最后选择北京(Beijing) 如图: 二.复制文件到/etc目录下 sudo cp /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime 三.更新时间 sudo ntpdate time.windows.com 四.写入硬件 sudo hwclock -w

centos 同步时间

centos系统时间同步和网络同步 一般新装的centos系统服务器有的时间可能不对或者设置了错误的时区,可以使用NTP从时间服务器同步. 1.把当前时区调整为上海+8区,想改其他时区也可以.在/usr/share/zoneinfo目录 cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 2.安装ntpdate yum install -y ntpdate 3.使用ntpdate同步标准时间(或者同步其他的时间服务器) ntpdate us.p

centos 同步时间和更改时区

在我们使用CentOS系统的时候,也许时区经常会出现问题,有时候改完之后还是会出错,下面我们就来学习一种方法来改变这个状况.如果没有安装,而你使用的是 CentOS系统 那使用命令 yum install ntp 然后:ntpdate us.pool.ntp.org . 因为CentOS系统是用rhas的源码再编译的,很多地方是完全一样的. rhas5的时区是以文件形式存在的,当前的时区文件是在/etc/localtime 那么其他时区的文件存放在哪里呢? 在/usr/share/zoneinf

linux通过ntp同步时间

1.安装服务 yum install ntpd ##安装ntp服务,这个和ntpdate不一样哦,用这个比较好 systemctl start ntpd.service ###启动服务 systemctl enable ntpd ###设置开机自启 ntpq -p ###查看同步 2.使用服务查看信息 [[email protected] ~]# ntpq -p remote refid st t when poll reach delay offset jitter =============

Linux系统CentOS下mysql的安装日志

今天自己捣鼓了一下,在linux系统CentOs6.5下使用源码方式安装和配置mysql,这里记录一下步骤. a) 下载mysql,source版本.Mysql-5.6.20.tar.gz b) 安装编译源码所需的工具和库 yum install gcc gcc-c++ ncurses-devel perl c) 安装cmake   wget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz tar -xzvf cmake-2.8.10.

Linux系统自动更新时间

转载自:http://www.cnblogs.com/choyaooo/p/8012923.html NTP服务器(上海) :ntp.api.bz    中国ntp服务器:cn.pool.ntp.org  pool.ntp.org    安装NTP客户端:    yum -y install ntp修改时区为Asia:    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime     vim  /etc/sysconfig/clock