Linux modified/etc/hosts hostname and modified after the issue does not take effect?

Source: Internet
Author: User

Modify the Hosts file, vi/etc/hosts, generally can not remove the localhost, removed after zookeeper and other frameworks may be problematic, as follows:

1234 127.0.0.1 localhost.localdomain localhost192.168.1.91 master192.168.1.93 slave1192.168.1.94 slave2

192.168.1.91 is both native local

Linux modifies the native alias/etc/hosts hostname often does not take effect, at this time there are 2 kinds of scenarios

    1. Restart, which is the most direct and reliable way to stabilize, if sometimes inconvenient to restart, you can use the second method.

    2. Modify the/etc/sysconfig/network file to change the hostname to the corresponding alias, as follows:

12 NETWORKING=yesHOSTNAME=host1

Restart Network Service after modification

1 service network restart

Linux modified/etc/hosts hostname and modified after the issue does not take effect?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.