Azure虚拟机时间同步问题
场景描述:在Azure上新创建虚拟机默认是UTC时区的,因为业务在国内,所以要修改在CST
注:协调世界时(英语:Coordinated Universal Time,法语:Temps Universel Coordonné,简称UTC)是最主要的世界时间标准,其以原子时秒长为基础,在时刻上尽量接近于格林尼治标准时间;
CST: China Standard Time 北京时间
Azure虚拟机时区修改方法1:
Azure官方提供方法:AzureDoc
描述:操作到最后一步时一直报echo write error: no device,echo写错误,没有这个设备
Azure虚拟机时区修改方法2:
描述:尝试后一段时间,还是修改转换成原来的UTC
#确定时间
[root@test ~]# date -R
Fri, 23 Mar 2018 03:50:13 +0000 #设定时区
[root@test ~]# tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean.
1) Africa
2) Americas
3) Antarctica
4) Arctic Ocean
5) Asia
6) Atlantic Ocean
7) Australia
8) Europe
9) Indian Ocean
10) Pacific Ocean
11) none - I want to specify the time zone using the Posix TZ format.
#? 5
Please select a country.
1) Afghanistan 18) Israel 35) Palestine
2) Armenia 19) Japan 36) Philippines
3) Azerbaijan 20) Jordan 37) Qatar
4) Bahrain 21) Kazakhstan 38) Russia
5) Bangladesh 22) Korea (North) 39) Saudi Arabia
6) Bhutan 23) Korea (South) 40) Singapore
7) Brunei 24) Kuwait 41) Sri Lanka
8) Cambodia 25) Kyrgyzstan 42) Syria
9) China 26) Laos 43) Taiwan
10) Cyprus 27) Lebanon 44) Tajikistan
11) East Timor 28) Macau 45) Thailand
12) Georgia 29) Malaysia 46) Turkmenistan
13) Hong Kong 30) Mongolia 47) United Arab Emirates
14) India 31) Myanmar (Burma) 48) Uzbekistan
15) Indonesia 32) Nepal 49) Vietnam
16) Iran 33) Oman 50) Yemen
17) Iraq 34) Pakistan
#? 9
Please select one of the following time zone regions.
1) Beijing Time
2) Xinjiang Time
#? 1 The following information has been given: China
Beijing Time Therefore TZ='Asia/Shanghai' will be used.
Local time is now: Fri Mar 23 11:50:33 CST 2018.
Universal Time is now: Fri Mar 23 03:50:33 UTC 2018.
Is the above information OK?
1) Yes
2) No
#? 1 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. Here is that TZ value again, this time on standard output so that you
can use the /bin/tzselect command in shell scripts:
Asia/Shanghai [root@test ~]# date
Fri Mar 23 03:50:42 UTC 2018 ##移除本地软件链接文件localtime
[root@test~]# rm /etc/localtime
rm: remove symbolic link ‘/etc/localtime’? y
[root@test ~]# ll /etc/localtime
ls: cannot access /etc/localtime: No such file or directory ##重新创建软链接
[root@test ~]# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[root@test ~]# date
Fri Mar 23 11:51:43 CST 2018 #重启
[root@test ~]# reboot
Azure虚拟机时区修改方法三:
描述:直接使用shanghai时区文件覆盖
[root@test ~]# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[root@test ~]# hwclock
[root@test ~]# reboot
注释:
a. 在/usr/share/zoneinfo/Asia下存放是各国时区的文件
b. /etc/localtime主要是redhat、centos系统控制时区的文件,/etc/timezone主要是ubuntu
Azure虚拟机时间同步问题的更多相关文章
- 如何禁用 Azure 虚拟机的日期时间同步
问题描述 由于 Azure 虚拟机的特殊性,物理主机会实时同步虚拟机的时间和日期.当有特殊需求时,客户想要停止日期时间的同步,但是一些常见的关闭 NTP 服务等操作都会失败. 解决方案 Importa ...
- Azure Backup (3) 使用Azure备份服务,备份Azure虚拟机
<Windows Azure Platform 系列文章目录> 本将介绍,如何使用Azure备份服务,备份Azure虚拟机. 我们先预先创建2台Windows VM (命名为LeiVM00 ...
- 使用mysqlslap对mysql进行压测,观察Azure虚拟机cpu使用率
一直想做这个测试,原因很简单,很多人一直比较怀疑Azure的虚拟机性能,说相同的配置凭啥比阿里的虚拟机贵那么多,其实,我自己以前也怀疑过,但是接触Azure的几个月,确实发现Azure的虚拟机性能真的 ...
- Azure PowerShell (5) 使用Azure PowerShell创建简单的Azure虚拟机和Linux虚拟机
<Windows Azure Platform 系列文章目录> 本文介绍的是国外的Azure Global.如果是国内由世纪互联运维的Azure China,请参考这篇文档: Azure ...
- Azure PowerShell (11) 使用自定义虚拟机镜像模板,创建Azure虚拟机并绑定公网IP(VIP)和内网IP(DIP)
<Windows Azure Platform 系列文章目录> 前提要求: 1.假设笔者捕获一个Azure虚拟机模板,命名为leistorage 关于Azure虚拟机模板,请参考下图: 2 ...
- Windows Azure Virtual Machine (31) 迁移Azure虚拟机
<Windows Azure Platform 系列文章目录> 为什么要写这篇Blog? 之前遇到过很多客户提问: (1)我之前创建的虚拟机,没有加入虚拟网络.现在需要重新加入虚拟机网络, ...
- Windows Azure Virtual Machine (33) Azure虚拟机删除重建
<Windows Azure Platform 系列文章目录> 注意:本文介绍的重建Azure虚拟机,必须在同一个订阅内删除重建,必须在同一个订阅内删除重建,必须在同一个订阅内删除重建. ...
- Windows Azure 虚拟机备份
如果我们要在Windows Azure的虚拟机上进行一些“重要且高危”的操作,我们通常会想到使用快照或者备份功能.但是在Windows Azure上是没有虚拟机快照功能的,尽管我们可以对虚拟机的磁盘文 ...
- 使用Windows Azure PowerShell远程管理Windows Azure虚拟机
对于Windows Azure,如果你还在使用windowsazure.com门户来管理虚拟机,那就显得不怎么高上大了.Windows Azure PowerShell 是一个功能强大的脚本环境,可用 ...
随机推荐
- CodeForces 15D Map
洛谷题目页面传送门 & CodeForces题目页面传送门 题意见洛谷里的翻译.(注意翻译里有错误,应该是优先选上面的矩阵,在同一行的优先选左边的矩阵) 这题一看就会做啊 (以下设大矩阵是\( ...
- ORACLE中添加删除主键
本文转自:http://blog.chinaunix.net/uid-17079336-id-2832443.html 1.创建表的同时创建主键约束(1)无命名create table student ...
- 服务注册组件——Eureka高可用集群搭建
服务注册组件--Eureka高可用集群搭建 什么是Eureka? 服务注册组件:将微服务注册到Eureka中. 为什么需要服务注册? 微服务开发重点在一个"微"字,大型应用拆分成微 ...
- Kaggle比赛(一)Titanic: Machine Learning from Disaster
泰坦尼克号幸存预测是本小白接触的第一个Kaggle入门比赛,主要参考了以下两篇教程: https://www.cnblogs.com/star-zhao/p/9801196.html https:// ...
- 在Android Studio配置google protobuf
1.在project的build.gradle中配置 buildscript { repositories { jcenter() mavenCentral() } dependencies { cl ...
- 【畅通工程 HDU - 1232 】【并查集模板】
并查集讲解和模板 有一个博文对此分析的很透彻,附链接 为避免原链接失效,现摘录如下: 为了解释并查集的原理,我将举一个更有爱的例子. 话说江湖上散落着各式各样的大侠,有上千个之多.他们没有什么正当职业 ...
- jmeter+Fiddler:通过Fiddler抓包生成jmeter脚本
Fiddler是目前最常用的抓包工具之一,它作为客户端和服务器端之间的代理,记录客户端和服务器之间的所有请求(http/https),可以针对特定的请求过滤,分析请求和响应的数据.设置断点.调试.修改 ...
- Mybatis实现一对一查询 对ResultType和ResultMap分析
实现一对一查询: ResultMap:使用ResultType实现较为简单,如果pojo中没有包括查询出来的列名,需要增加 列名对应的属性,即可完成映射. 如果没有查询结果的特殊要求建议使用Resul ...
- 提交中文数据乱码问题---web.xml
前端时间,做了个纯springmvc框架的一个后台系统,遇到了不少问题.特别是编码问题,让我纠结了很久.每次ajax传入数据的时候需要将form中的数据先进行编码 encodeURI(AA); 利用a ...
- 剑指Offer(二十二):从上往下打印二叉树
剑指Offer(二十二):从上往下打印二叉树 搜索微信公众号:'AI-ming3526'或者'计算机视觉这件小事' 获取更多算法.机器学习干货 csdn:https://blog.csdn.net/b ...