腾讯云工单中的工程师很水?

2018-11-13 11:33:48 +08:00
 Bisn
想修改腾讯云中的 /etc/hosts,打开提示
# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
# /etc/cloud/cloud.cfg or cloud-config from user-data
#
127.0.0.1 localhost.localdomain VM-0-4-ubuntu
127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

各种改,重启都失效,然后提了一个工单,腾讯云工程师回复:
您好:
ubuntu 是普通用户应该没有该文件写权限;
建议您提权使用编辑命令,使用命令:sudo vim /etc/hosts

我也是醉了
4350 次点击
所在节点    云计算
19 条回复
pwrliang
2018-11-13 11:37:10 +08:00
那个文件不是提示你,如果想 persist,需要修改以下两个。
geminil
2018-11-13 11:40:44 +08:00
有点。。。
有时候常年回复,牛头不对马嘴的
Bisn
2018-11-13 11:41:41 +08:00
@pwrliang 就因为按照提示,各种改都没用才提交的工单
xi2008wang
2018-11-13 12:50:51 +08:00
ls /etc/cloud/templates/ 看一下有那些文件, /etc/cloud/cloud.cfg 的内容是什么
xi2008wang
2018-11-13 12:54:05 +08:00
网易云解释比较清楚。。。https://www.163yun.com/help/documents/56874406220320768
搜索了一下 https://cloudinit.readthedocs.io/en/latest/topics/modules.html 对 cloud-init 有介绍
This module will update the contents of /etc/hosts based on the hostname/fqdn specified in config. Management of /etc/hosts is controlled using manage_etc_hosts. If this is set to false, cloud-init will not manage /etc/hosts at all. This is the default behavior.
SSyang
2018-11-13 13:04:20 +08:00
云环境一般会使用开源的 Cloud-init 进行一些初始化操作,实例每次启动时 Cloud-Init 会根据 /etc/cloud/templates/hosts.${os_type}.tmpl 模板生成一份新的 /etc/hosts 文件覆盖原有的 /etc/hosts。如果想要重启后不失效,需要同时修改 /etc/hosts 与对应的模板文件 hosts.tmpl。
ZL122320
2018-11-13 20:22:09 +08:00
# a.) make changes to the master file in /etc/cloud/templates/hosts.tmpl 文件里写的这么清楚你还要问,你也是水的够了
ZL122320
2018-11-13 20:23:04 +08:00
# a.) make changes to the master file in /etc/cloud/templates/hosts.tmpl 文件里写的这么清楚你还要问,你也是水的够了多学学把孩子
workworld
2018-11-13 20:35:30 +08:00
六楼老哥说的没错,归根结底是你不太了解 cloud-init 的工作原理,云上的机器都有这个组件的,我用的阿里的机器,刚开始也不清楚怎么改,后台仔细看了边 hosts 文件后,才发现人家已经说的非常明白了 ,唉 这能怪谁呢
19zero
2018-11-14 11:04:16 +08:00
腾讯云客服不都是外包的么?
julyclyde
2018-11-14 12:04:20 +08:00
一是 lz 不看注释也不懂 cloud-init
二是居然连客服也不懂 cloud-init
lannyst
2018-11-14 21:25:10 +08:00
据我观察这个工单被一线比较水的派单员拦截了,没流转到二线的工程师手里……
Bisn
2018-11-15 15:00:51 +08:00
@ZL122320
@workworld 我就是修改相关的文件,重启后还是被还原了,才提交的工单
见图片,是重启后的截图
[![tx.png]( https://i.loli.net/2018/11/15/5bed1936973e0.png)]( https://i.loli.net/2018/11/15/5bed1936973e0.png)
Bisn
2018-11-15 15:02:53 +08:00
@julyclyde 见上面回复的图片吧
julyclyde
2018-11-16 08:10:26 +08:00
@Bisn 俩都 404 呢

你就按照 cloud-init 来改然后重启动吧
liuxu
2018-11-16 19:43:57 +08:00
这个大概的意思就是,你在 /etc/cloud/cloud.cfg or cloud-config 配置文件中打开了 manage_etc_hosts 属性,如果你想改 host 文件,二选一:
1.直接更改 /etc/cloud/templates/hosts.tmpl
这样重启就会用 hosts.tmpl 覆盖 /etc/hosts

2.删除 /etc/cloud/cloud.cfg or cloud-config 配置文件中的 manage_etc_hosts 属性,然后改 host
这样你修改了 /etc/hosts 就不会被 hosts.tmpl 覆盖
liuxu
2018-11-16 19:45:25 +08:00
@liuxu

2 说错了,应该是修改 /etc/cloud/cloud.cfg 配置全局配置文件或用 cloud-config 命令修改用户配置
mydns
2018-11-17 13:54:57 +08:00
我一个问题工单前前后后折腾了 4 天还没有解决
root0day
2018-11-19 09:59:11 +08:00
经常 你在工单后面加一句 请直接转工程师就完事了 没有客服愿意自讨苦吃

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/507324

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX