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 ...
随机推荐
- Application Security Per-Engagement
1. an SQLi vulnerability will allow you to do the following query the database using select statem ...
- 关于Idea模块化部署web项目,Web Resource Directories作用
问题由来:接到某个所谓“将web工程中部分代码抽出打包,但待打包部分代码还需要在现场部署时能做微调”的需求. 解决方法:将待打包部分代码作为一个module,让工程依赖该模块,满足抽离打包与现场可调试 ...
- CodeForces 528D Fuzzy Search 多项式 FFT
原文链接http://www.cnblogs.com/zhouzhendong/p/8782849.html 题目传送门 - CodeForces 528D 题意 给你两个串$A,B(|A|\geq| ...
- net core 获取配置文件
IConfiguration服务是net core 默认依懒注入的一个对象 直接注入(推荐使用) 新建控制器 然后构造函数直接注入 [Route("api/[controller]" ...
- es elasticsearch-head安装
---恢复内容开始--- 参考 https://www.jianshu.com/p/36d7f97a20cd 1.下载安装git clone git://github.com/mobz/elastic ...
- SpringBoot2 task scheduler 定时任务调度器四种方式
github:https://github.com/chenyingjun/springboot2-task 使用@EnableScheduling方式 @Component @Configurabl ...
- 开源搜索引擎solr elasticsearch学习计划
其实不单单是研究solr elasticsearch把,进行调研性技术学习时,应该制定一些目标以及里程碑.新的技术调研 学习是一件很爽的事,能学到新技术新东西.但是在学习新技术同时,有几个问题是需要我 ...
- C语言编译器CL.exe
下载地址CL.7z版权问题:仅供学习交流,请于24小时内删除,本人不承担版权问题… 基本使用: 1.解压缩,例如解压缩到E盘根目录下 2.打开cmd命令行界面(快捷方式win+R输入cmd回车)cd命 ...
- scrapy 爬虫返回json格式内容unicode编码转换为中文的问题解决
最近在基于python3.6.5 的环境使用scrapy框架爬虫获取json数据,返回的数据是unicode格式的,在spider里面的parse接口中打印response.text出来如下: cla ...
- linux locate命令
1.命令简介 locate(locate) 命令用来查找文件或目录. locate命令要比find -name快得多,原因在于它不搜索具体目录,而是搜索一个数据库/var/lib/ml ...