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 ...
随机推荐
- 微信支付的安全漏洞之XXE
1.场景:国外安全社区公布微信支付官方SDK存在严重漏洞,可导致商家服务器被入侵(绕过支付的效果).目前,漏洞详细信息以及攻击方式已被公开,影响范围巨大(已确认陌陌.vivo因使用该SDK而存在该漏洞 ...
- SpringBoot Redis缓存 @Cacheable、@CacheEvict、@CachePut
文章来源 https://blog.csdn.net/u010588262/article/details/81003493 1. pom.xml <dependency> <gro ...
- Java Web项目漏洞:检测到目标URL存在http host头攻击漏洞解决办法
检测到目标URL存在http host头攻击漏洞 详细描述 为了方便的获得网站域名,开发人员一般依赖于HTTP Host header.例如,在php里用_SERVER["HTTP_HOST ...
- maven无法下依赖jar文件的解决方案
问题描述: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be ...
- 在使用mysql8.0的时候遇到的密码链接问题
问题概述 SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client SQLSTAT ...
- 潭州课堂25班:Ph201805201 tornado 项目 第九课 深入应用 WebSockets(课堂笔记)
tornado 相关说明 在 handler 中创建一个 chat.py 文件,用来处理聊天室 在 templates 模板文件夹下创建 room.html 文件,是个聊天室 做好服务器的准备
- XVII Open Cup named after E.V. Pankratiev. GP of Tatarstan
A. Arithmetic Derivative 形如$p^p(p是质数)$的数的比值为$1$,用$k$个这种数相乘得到的数的比值为$k$,爆搜即可. #include<cstdio> # ...
- Asia-Tsukuba 2017
A. Secret of Chocolate Poles DP,$f[i][j]$表示高度为$i$,顶层颜色为$j$的方案数. 时间复杂度$O(l)$. #include<cstdio> ...
- ElasticSearch + Canal 开发千万级的实时搜索系统
公司是做社交相关产品的,社交类产品对搜索功能需求要求就比较高,需要根据用户城市.用户ID昵称等进行搜索. 项目原先的搜索接口采用SQL查询的方式实现,数据库表采用了按城市分表的方式.但随着业务的发展, ...
- BOM 浏览器对象模型_XMLHttpRequest 对象
XMLHttpRequest 对象 浏览器与服务器之间,采用 HTTP 协议 通信. 用户在浏览器地址栏键入一个网址,或者通过网页表单向服务器提交内容,这时浏览器就会向服务器发出 HTTP 请求 AJ ...