zoukankan      html  css  js  c++  java
  • 解决openstack实例主机名后缀问题

    参考地址
    https://ask.openstack.org/en/question/26918/change-novalocal-suffix-in-hostname/

    问题现象 可以看到主机名的后缀带.novalocal

    [root@open-controller-1 ~]# source dawn-openstack.sh 
    [root@open-controller-1 ~]# nova list
    +--------------------------------------+-------------+--------+------------+-------------+---------------------+
    | ID                                   | Name        | Status | Task State | Power State | Networks            |
    +--------------------------------------+-------------+--------+------------+-------------+---------------------+
    | 818a137d-61db-41b9-9cbc-699b28227bd3 | CentOS7-1   | ACTIVE | -          | Running     | provider=10.0.8.111 |
    | 14fe356f-bdf9-4ce0-aef6-11833d9d6015 | centos7-119 | ACTIVE | -          | Running     | provider=10.0.8.119 |
    | b410b03a-5358-49d9-b52a-e5bc4fe720c8 | demo1       | ACTIVE | -          | Running     | provider=10.0.8.117 |
    | 5bfb09ea-f53e-43c2-8c42-74d3c51cbfe6 | demo10      | ACTIVE | -          | Running     | provider=10.0.8.118 |
    | 385d5ccb-7efe-4d09-ab2b-8e05619bf3d6 | demo9       | ACTIVE | -          | Running     | provider=10.0.8.106 |
    +--------------------------------------+-------------+--------+------------+-------------+---------------------+
    [root@open-controller-1 ~]# ssh centos@10.0.8.119
    Last login: Tue Dec  4 13:56:16 2018 from 10.0.8.11
    [centos@centos7-119 ~]$ hostname
    centos7-119.novalocal
    [centos@centos7-119 ~]$ exit
    logout
    Connection to 10.0.8.119 closed.
    [root@open-controller-1 ~]#
    

      

    在 Control node修改nova.conf

    去掉这个后缀

    配置为空

    重启nova-api服务

    [root@open-controller-1 ~]# systemctl restart openstack-nova-api.service 
    [root@open-controller-1 ~]# 
    

      

    后面创建的实例查看主机名不带后缀了

    [root@open-controller-1 ~]# sh show_vm.sh
    open-compute-1.inner.hzdgjy.cn           instance-00000018              demo10                         provider=10.0.8.118           
    open-compute-1.inner.hzdgjy.cn           instance-0000000f              demo1                          provider=10.0.8.117           
    -----------------------
    open-compute-2.inner.hzdgjy.cn           instance-0000001b              cent                           provider=10.0.8.119           
    open-compute-2.inner.hzdgjy.cn           instance-0000000e              demo9                          provider=10.0.8.106           
    -----------------------
    [root@open-controller-1 ~]# ssh centos@10.0.8.119
    [centos@cent ~]$ hostname
    cent
    [centos@cent ~]$ sudo su -
    Last login: Mon Nov  5 21:30:33 CST 2018 from 10.0.8.11 on pts/0
    [root@cent ~]# hostname
    cent
    [root@cent ~]# 
    

      

  • 相关阅读:
    《Spark大数据处理:技术、应用与性能优化》PDF电子书下载
    机器学习实战PDF中文版+英文版高清电子书+随书源码下载
    马云内部讲话系列(全3册)PDF电子书下载
    《OpenCV计算机视觉编程攻略(第3版)》高清中文版+英文版PDF+源码下载
    解决 VScode (因为在此系统上禁止运行脚本)报错
    浅谈Vue组件及组件的注册方法
    Win10 如何右键新建.md文件
    身份认证与加密浅谈(PKI)
    Git 代码托管有哪些选择,从 GitHub、GitLab 公共托管到自建服务
    单点登录的三种实现方式
  • 原文地址:https://www.cnblogs.com/nmap/p/10466364.html
Copyright © 2011-2022 走看看