centos修改时区并同步时间
查看服务器时间及所在时区
[root@localhost ~]# date -R
Fri, 07 Dec 2018 04:38:28 -0500
修改时区
先使用 tzselect 根据提示选择所在地区,最终生成时区
You can make this change permanent for yourself by appending the line
TZ='Asia/Shanghai'; export TZ
to the file '.profile' in your home directory; then log out and log in again.
然后编辑 /etc/profile 文件,添加 TZ='Asia/Shanghai'; export TZ,编辑完成后保存,运行 source /etc/profile
再次使用 date -R 查看时间
Fri, 07 Dec 2018 17:42:28 +0800
同步时间
安装 ntpdate
[root@localhost ~]# yum install ntpdate -y
前往 http://www.ntp.org.cn 查询可用的NTP服务,同步时间
[root@localhost ~]# ntpdate cn.ntp.org.cn
如同步出现错误 no server suitable for synchronization found,可尝试使用
[root@localhost ~]# ntpdate -u cn.ntp.org.cn
或者将域名改为ip
centos修改时区并同步时间的更多相关文章
- centos修改时区,同步时间
查看当前系统时区 ls -la /etc/localtime 查看支持的时区 timedatectl list-timezones # 查看所有时区 timedatectl list-timezone ...
- Linux修改时区以及同步时间
Centos7为例:修改时区 timedatectl list-timezones |grep Shanghai #查找中国时区的完整名称 Asia/Shanghai timedatectl set- ...
- centos7 修改时区,同步时间,Mysql修改时区
查看时区 timedatectl status [root@localhost nova-back]# timedatectl status Local time: Thu 2019-05-23 15 ...
- centos 修改时区以及修正时间
1.查看系统当前的时区 [app@127-0-0-1 shine]$ timedatectl Local time: Wed 2019-10-23 17:56:17 CST Universal tim ...
- 怎么让CentOS集群自动同步时间
怎么让CentOS集群自动同步时间?首先机器要连外网,这样才能从互联网上同步时间,这是首先要了解的.好了,主要的方法如下: 在除了运行ntpd之外的机器上,执行: [html] # chkconfig ...
- CentOS集群自动同步时间的一种方法
CentOS集群自动同步时间的一种方法 之前有篇日志是手动同步时间的 http://www.ahlinux.com/os/201304/202456.html 之所以这么干,是因为我们实验室的局域网只 ...
- Debian CentOS修改时区
Debian修改时区: dpkg-reconfigure tzdata https://wiki.debian.org/TimeZoneChanges CentOS修改时区: timedatectl ...
- 修改centos服务器时区并同步最新时间
rm -rf /etc/localtime ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ntpdate cn.pool.ntp.org ...
- centos修改时区,设置时间
在我们使用CentOS系统的时候,也许时区经常会出现问题,有时候改完之后还是会出错,下面我们就来学习一种方法来改变这个状况.如果没有安装,而你使用的是 CentOS系统 那使用命令 yum insta ...
随机推荐
- appJSON["window"]["navigationBarTextStyle"] 字段需为 black 或 white
appJSON["window"]["navigationBarTextStyle"] 字段需为 black 或 white 改动成这个就可以了 &qu ...
- python中的while循环和for循环
1.while循环 Gif 演示 Python while 语句执行过程 while 语句时还有另外两个重要的命令 continue,break 来跳过循环,continue 用于跳过该次循环,bre ...
- 在react-native项目中使用iconfont自定义图标库(android)
1. 安装react-native-vector-icons yarn add react-native-vector-icons react-native link 如果没有关联成功的话,可以参考官 ...
- rabbitmq重启时报错,并导致erlang崩溃和Rabbit的常用命令
-------------------------------------------------------------------------------------------------- R ...
- centos没有可用软件包 libgtk2
在编写一个C程序,使用基于文本的终端图形编程库(curses)或图形界面(QT/GTK),分窗口显示三个并发进程的运行,因为centos并未安装gtk,所以运行命令行安装gtksudo yum -y ...
- 一天带你入门到放弃vue.js(一)
写在前面的话! 每个新的框架入手都会进行一些列的扯犊子!这里不多说那么多!简简单单说一下vue吧! Vue.js是目前三大框架(angular,vue,react)之一,是渐进式js框架,据说是摒弃了 ...
- python面试必问 知识整理
一 数据类型 1 数字 整型与浮点型 #整型int 作用:年纪,等级,身份证号,qq号等整型数字相关 定义: age=10 #本质age=int(10) #浮点型float 作用:薪资,身高, ...
- 2017-11-4—LTspice
LTspice这个软件基本上上手就能用,没什么好说的. ADI的一些器件下载的spice文件可能是.cir的需要使用cadence的pspice软件打开后另存为.dir文件使用.(比如ad4096) ...
- Scrapy基础(十四)————Scrapy实现知乎模拟登陆
模拟登陆大体思路见此博文,本篇文章只是将登陆在scrapy中实现而已 之前介绍过通过requests的session 会话模拟登陆:必须是session,涉及到验证码和xsrf的写入cookie验证的 ...
- vue_过滤器: 对要显示的数据进行特定格式化后再显示
过滤器 对要显示的数据进行特定格式化后再显示 并未改变原本的数据,可是产生新的对应的数据 <!DOCTYPE html> <html lang="en"> ...