CDH6.3.2更换主机名HostName

修改HostName

hostname xxx
永久修改
vim /etc/hostname
在该文件中写上hostname名称即可

修改/etc/hosts文件

vim /etc/hosts
在该文件中写上所有节点的ip和hostname,如:
10.169.xx.xxx slave01.wc.prod

停止大数据服务

 

停掉所有的服务

停止cloudera的服务

 systemctl stop cloudera-scm-server  
systemctl stop cloudera-scm-agent 

不然会反复提交当前的主机名

修改CM Server的元数据

我当时使用的是mysql数据库,因此先登录mysql数据库

  • 切换数据库
  • use cm;
    
  • 查看几个重要字段
  • select host_id, host_identifier, name, ip_address  from HOSTS;
    

    结果大概如下:

  • +---------+--------------------------------------+---------------+--------------+
    | host_id | host_identifier                      | name          | ip_address   |
    +---------+--------------------------------------+---------------+--------------+
    |       1 | 1134ea20-6039-4ac7-b5e3-7a67d556f20e | Utility01     | 10.169.xx.xxx  |
    |       2 | 50d9ad8b-d858-45ae-b727-9764eaf347d9 | slave05       | 10.169.xx.xxx |
    ...
    ...
    |      20 | 59be2b8f-7103-4a40-b623-241c87402e29 | INSIDE-PHY349 | 10.169.xx.xxx  |
    

    我们现在就是要把name为 INSIDE-PHY349 的节点,修改为master01

  • 修改hostname
  • set 属性=值,这个值要加引号
  • update HOSTS set name='master01' where host_id=20;
    
  • 启动CM和集群即可
  • 之后会让你更新一下集群的配置 更新完即可恢复正常
  • 如果要修改ip,也是类似的
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值