修改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,也是类似的