Hadoop集群服务器更换IP,集群mngt服务无法使用



1、由于网络原因,整套Hadoop集群换了新的ip地址,mngt监控服务启动时报错:

 

2015-11-26 10:40:44,045  WARN [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2:resourcepool.BasicResourcePool@1841] com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@7e543cb1 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:

org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

……

Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!

 

由以上信息可以判断,是由于一些服务器的访问信息需要修改ip)才能使得服务起来。

但是在哪里修改,做什么样的修改,一无所知。

经过大量搜索:终于找到办法:

方法的主要思想是:

由于cloudera-manager在安装的时候,会配置相应的数据库,该数据库是用来存储集群的所有的配置信息。cloudera-mamanger每次启动的时候,都会从数据库中读取这些配置信息,因此想修改主机的ip,只需要修改存在数据库中的主机的IPHadoop集群无论是按着主机名还是IP搜索主机,都是要记录主机的IP地市记录到数据库里。

具体方法:

1)首先在安装cloudera-manager的主机上,停止所有的cloudera管理进程

  service cloudera-scm-agent stop  

  service cloudera-scm-server stop

2)查看postgresql scm用户的密码

  grep password /etc/cloudera-scm-server/db.properties

3)登陆postgresql 数据库

  输入命令:psql -h localhost -p 7432 -U scm

  提示你输入密码,密码就是上面步骤(2)的密码。

4)修改postgresql数据库中的数据(即主机的IP

查看pg中存储情况

   select host_id, host_identifier, name, ip_address from hosts;

查询的结果如下:

host_id |   host_identifier   |             name           |   ip_address
  
  
------------------------------------------------------------------------------------
         3      |   hadoop.slave1   |           hadoop1         |  192.10.1.217

5)修改各主机的ip(分别修改各主机的ip

 update hosts set (ip_address) = ('192.10.2.217') where name='hadoop1';

 退出postgresql数据库

 输入命令:Ctrl+D

修改所有机器的cloudera-scm-agent的配置文件

 1、打开cloudera-scm-agent的配置文件

      vi /ect/cloudera-scm-agent/config.ini

 2、修改server_host的值(这个是指定cloudera-scm-serverip)

  将该值设置为cloudera-scm-serverip即可。

6)修改各主机的 /etc/hosts文件,将现在的hostnameIP地址对应上

7)重启服务

service cloudera-scm-server start

service cloudera-scm-agent start

  注:如果agent启动失败,查看是否90009001端口被占用

    netstat -nap | grep 9000

    netstat -nap | grep 9001

  如果被占用,kill –9 相关进程,再重新启动agent服务即可.

8)重启cloudera-manager上的服务。

如果除了master节点,slave节点服务无法启动的话,需要重启agent服务:

 

/etc/init.d/cloudera-scm-agent stop

/etc/init.d/cloudera-scm-agent start

Hbase服务需要ntp服务做时间同步,否则RegionServer容易异常退出。

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值