谷歌云计算引擎/etc/hosts [英] google cloud compute engine /etc/hosts

查看:83
本文介绍了谷歌云计算引擎/etc/hosts的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Google云计算引擎中,/etc/hosts文件在一定时间后会自动被覆盖.

In my google cloud compute engine, the /etc/hosts file is overwritten automatically after a certain time.

请向我建议为什么会发生这种情况以及如何预防.

Please suggest to me why it is happening and how to prevent it.

最初的条目如下:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

10.128.0.2 instance-1.c.concrete-craft-123421.internal instance-1  # Added by Google

并且我将其更改为以下内容以启动cloudera服务.

and I have changed it to as below to start cloudera services.

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

#10.128.0.2 instance-1.c.concrete-craft-123421.internal instance-1  # Added by Google

10.128.0.2 instance-1 instance-1

但是一段时间后,原始条目会重新出现.知道是什么原因造成的吗?

But after sometime, the original entries reappear. Any idea what is causing this?

谢谢,
南达

推荐答案

您可以代替此操作

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

#10.128.0.2 instance-1.c.concrete-craft-123421.internal instance-1  # Added by Google

10.128.0.2 instance-1 instance-1

也添加了您的行

10.128.0.2 instance-1 instance-1

在Google行之前.不需要cron;)它不会被删除!

before the google line. And no need to have cron ;) it won't be deleted !

这样做->

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

10.128.0.2 instance-1 instance-1

#10.128.0.2 instance-1.c.concrete-craft-123421.internal instance-1  # Added by Google

这篇关于谷歌云计算引擎/etc/hosts的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆