场景描述:在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虚拟机时间同步问题的更多相关文章

  1. 如何禁用 Azure 虚拟机的日期时间同步

    问题描述 由于 Azure 虚拟机的特殊性,物理主机会实时同步虚拟机的时间和日期.当有特殊需求时,客户想要停止日期时间的同步,但是一些常见的关闭 NTP 服务等操作都会失败. 解决方案 Importa ...

  2. Azure Backup (3) 使用Azure备份服务,备份Azure虚拟机

    <Windows Azure Platform 系列文章目录> 本将介绍,如何使用Azure备份服务,备份Azure虚拟机. 我们先预先创建2台Windows VM (命名为LeiVM00 ...

  3. 使用mysqlslap对mysql进行压测,观察Azure虚拟机cpu使用率

    一直想做这个测试,原因很简单,很多人一直比较怀疑Azure的虚拟机性能,说相同的配置凭啥比阿里的虚拟机贵那么多,其实,我自己以前也怀疑过,但是接触Azure的几个月,确实发现Azure的虚拟机性能真的 ...

  4. Azure PowerShell (5) 使用Azure PowerShell创建简单的Azure虚拟机和Linux虚拟机

    <Windows Azure Platform 系列文章目录> 本文介绍的是国外的Azure Global.如果是国内由世纪互联运维的Azure China,请参考这篇文档: Azure ...

  5. Azure PowerShell (11) 使用自定义虚拟机镜像模板,创建Azure虚拟机并绑定公网IP(VIP)和内网IP(DIP)

    <Windows Azure Platform 系列文章目录> 前提要求: 1.假设笔者捕获一个Azure虚拟机模板,命名为leistorage 关于Azure虚拟机模板,请参考下图: 2 ...

  6. Windows Azure Virtual Machine (31) 迁移Azure虚拟机

    <Windows Azure Platform 系列文章目录> 为什么要写这篇Blog? 之前遇到过很多客户提问: (1)我之前创建的虚拟机,没有加入虚拟网络.现在需要重新加入虚拟机网络, ...

  7. Windows Azure Virtual Machine (33) Azure虚拟机删除重建

    <Windows Azure Platform 系列文章目录> 注意:本文介绍的重建Azure虚拟机,必须在同一个订阅内删除重建,必须在同一个订阅内删除重建,必须在同一个订阅内删除重建. ...

  8. Windows Azure 虚拟机备份

    如果我们要在Windows Azure的虚拟机上进行一些“重要且高危”的操作,我们通常会想到使用快照或者备份功能.但是在Windows Azure上是没有虚拟机快照功能的,尽管我们可以对虚拟机的磁盘文 ...

  9. 使用Windows Azure PowerShell远程管理Windows Azure虚拟机

    对于Windows Azure,如果你还在使用windowsazure.com门户来管理虚拟机,那就显得不怎么高上大了.Windows Azure PowerShell 是一个功能强大的脚本环境,可用 ...

随机推荐

  1. 多线程 共享资源 同步锁 java

    Java多线程编程:Lock   synchronized是java中的一个关键字,也就是说是Java语言内置的特性.那么为什么会出现Lock呢? 如果一个代码块被synchronized修饰了,当一 ...

  2. Linux之各程序安装

    python安装 安装python3.6 安装python前的库环境,非常重要 yum install gcc patch libffi-devel python-devel zlib-devel b ...

  3. hadoop2.7作业提交详解之文件分片

    在前面一篇文章中(hadoop2.7之作业提交详解(上))中涉及到文件的分片. JobSubmitter.submitJobInternal方法中调用了int maps = writeSplits(j ...

  4. SynchronousQueue队列程序的执行结果分析

    public static void main(String[] args) throws Exception { /** * SynchronousQueue队列程序的执行结果分析 * Blocki ...

  5. xcode简介及安装

    1. 简介 Xcode 是运行在操作系统Mac OS X上的集成开发工具(IDE),由苹果公司开发. Xcode是开发OS X 和 iOS 应用程序的最快捷的方式. Xcode 具有统一的用户界面设计 ...

  6. 2019nc#2

    A Eddy Walker 题意 你有n个点(0-n-1),按顺序形成一个环,初始时你在0的位子,你随机顺时针走一步或者逆时针走一步, 一旦你走到一个点后,环上所有点都被经过至少一次后,你就必须停下来 ...

  7. 18年ACM赛后总结

    今天,我们浙理养老队在18年赛季的比赛正式宣布结束了,先恭喜我们队在3场区域赛中拿了两块金牌,一块银牌,损失我的身份证我的U盘我的耳机,老天啊,队友不是拿来顶替自己的霉运的嘛,让他们的丢东西啊,别让我 ...

  8. CF - 1111D Destroy the Colony DP

    题目传送门 题意: 这个题目真的是最近遇到的最难读. 有一个长度n的字符串,每一位字符都代表的是该种种类的敌人. 现在如果一个序列合法的话,就是同一种种类的敌人都在字符串的左半边或者右半边. 现在有q ...

  9. CodeForces 375D Tree and Queries 莫队||DFS序

    Tree and Queries 题意:有一颗以1号节点为根的树,每一个节点有一个自己的颜色,求出节点v的子数上颜色出现次数>=k的颜色种类. 题解:使用莫队处理这个问题,将树转变成DFS序区间 ...

  10. codeforces 688 E. The Values You Can Make(01背包+思维)

    题目链接:http://codeforces.com/contest/688/problem/E 题解:设dp[s1][s2]表示s1状态下出现s2是否合理.那么s1显然可以更具01背包来得到状态.首 ...