机器ip变动后的相关替换
1./etc/hosts 下 ip 映射替换
2.lava 元数据替换
- lava 的 pg 库里操作
- 两张表 clusternode machinepool
- SQL 里的 ip 自己替换成对应的即可
-- 备份数据
create table clusternode_bak as select * from clusternode;
-- 创建临时表clusternode_temp
create table clusternode_temp(like clusternode);
-- 向临时表写入数据
insert into clusternode_temp
select
clusternodeid,
clusterid,
vmtypeid,
role,
host,
case
when ip='192.168.80.111' then '15.154.95.41'
when ip='192.168.80.112' then '15.154.95.42'
when ip='192.168.80.113' then '15.154.95.43'
when ip='192.168.80.114' then '15.154.95.44'
else ip end,
case
when privateip='192.168.80.111' then '15.154.95.41'
when privateip='192.168.80.112' then '15.154.95.42'
when privateip='192.168.80.113' then '15.154.95.43'
when privateip='192.168.80.114' then '15.154.95.44'
else privateip end,
machineid,
status
FROM clusternode_bak;
-- 更新原表数据
delete from clusternode;
insert into clusternode select * from clusternode_temp;
-- 备份数据
create table machinepool_bak as select * from machinepool;
-- 创建临时表machinepool_temp
create table machinepool_temp(like machinepool);
-- 向临时表写入数据
insert into machinepool_temp
select
machineid,
userid,
hostname,
username,
password,
master,
slaveport,
sshport,
case
when manageip='192.168.80.111' then '15.154.95.41'
when manageip='192.168.80.112' then '15.154.95.42'
when manageip='192.168.80.113' then '15.154.95.43'
when manageip='192.168.80.114' then '15.154.95.44'
else manageip end,
case
when dataip='192.168.80.111' then '15.154.95.41'
when dataip='192.168.80.112' then '15.154.95.42'
when dataip='192.168.80.113' then '15.154.95.43'
when dataip='192.168.80.114' then '15.154.95.44'
else dataip end,
status,
error
FROM machinepool_bak;
-- 更新原表数据
delete from machinepool;
insert into machinepool select * from machinepool_temp;
3.assist 通信协议 ip 替换
vim /usr/local/oushu/oushu-assist/sbin/assist_ctl.conf
修改其中gossipIp对应的地址,为本地新的ip地址
每个节点都要替换
4.littleboy 的数据存储在 hdfs 的 master 节点 ip 替换
- 在 littleboy 的 master 节点下操作
vim /usr/local/oushu/littleboy/conf/littleboy-site.xml
修改basic.master.namenodes的值中相关的ip信息