场景:
linux centos6.9 Ambari + HDP + Kerberos
目前集群节点有3个,运行一切正常。由于客户ip发生变化,需要统一将原先的ip全部替换。

注:首先将dataNode目录下的数据进行备份

1、通过Ambari界面将所有服务停了

2、修改hosts(win/linux)

(1)修改linux 之hosts(所有节点都得修改)
[root@hdp39 network-scripts]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.22.103 hdp39
192.168.22.40 hdp40
192.168.22.41 hdp41
192.168.22.103 hdp39.bigdata.com
192.168.22.40 hdp40.bigdata.com
192.168.22.41 hdp41.bigdata.com

注:只修改ip不修改映射名,原因是在原先环境中有很多地方用的是映射名,如果映射名没改那些地方便不需要再进行修改,如下为原先的hosts文件内容
(2)修改window 之host

      C:\Windows\System32\drivers\etc\hosts

(3)修改当前ip映射的信息

        /etc/sysconfig/network-scripts/ifcfg-Auto_eth0查找当前映射信息配置文件的命令
[root@hdp39 network-scripts]# cd /etc/sysconfig/network-scripts
[root@hdp39 network-scripts]# grep -rn 192.168.22.39
ifcfg-Auto_eth0_bak:4:IPADDR=192.168.22.39
Binary file .ifcfg-Auto_eth0.swp matches

(4)重启网络服务

 命令:service network restart或/etc/init.d/network restart[root@hdp39 network-scripts]# service network restart
Shutting down interface Auto_eth0:  Device state: 3 (disconnected)[  OK  ]
Shutting down interface Auto_eth0_bak:                     [  OK  ]
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface Auto_eth0:  Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/2
state: activated
Connection activated[  OK  ]
Bringing up interface Auto_eth0_bak:  Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/3[  OK  ]
Bringing up interface eth0:  Error: No suitable device found: no device found for connection 'System eth0'.[FAILED] 

解决:

cd /etc/udev/rules.d
rm 70-persistent-cd.rules

验证网络访问是否正常

ping baidu.com

(5)重启服务器

 init 6 或reboot

(6)检查防火墙是否开启

[root@hdp39 ~]# service iptables status
iptables: Firewall is not running.

(7)重启 Ldap

[root@hdp39 ~]# find / -name 'ldap.sh'/usr/hdp/2.5.3.0-37/knox/bin/ldap.sh
[root@hdp39 bin]# ./ldap.sh startStarting LDAP succeeded with PID 5330. 

(8)开启Ambari并登录Ambari

    启动Ambariambari-server start 通过界面访问ambarihttp://<your.ambari.server>:8080
由于Ambari之前配置了knox单点登录,因此会自动跳转到knox单点登录对应的 为了让其不跳转到knox中,因此在跳转之前快速停止浏览器的跳转,
也就是直接跳转到ambari主页,其url 为http://<your.ambari.server>:8080

(9)通过Abmari 界面修改有写了固定 IP 地址的地方。

 修改 yarn、hdfs、mapreduce、zookeeper 等组件中有写了ip地址的配置文件。

遇到的坑:

一、修改完之后ambari 后与hosts 后,重启服务器发现登录不进ambari 主界面
原因一:重启服务器后防火墙被重新打开了
原因二:knox 对应的Ldap 服务没有开户

参考文档: knox官方文档
http://knox.apache.org/books/knox-0-12-0/user-guide.html

[root@hdp39 bin]# ./ldap.sh start
Starting LDAP succeeded with PID 46528.

解决方法:在集群正常运行的情况下先将knox 停了,修改knox主机ip


二、Ambari Metrics 启动失败
报的错如下:

 org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.DefaultPhoenixDataSource:Unable to connect to HBase store using Phoenix.
org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table undefined. tableName=SYSTEM.CATALOG.

This is usually due to AMS Data being corrupt.

1、Shut down Ambari Monitors, and Collector via Ambari
2、Cleared out the /var/lib/ambari-metrics-collector dir for fresh restart
3、From Ambari -> Ambari Metrics -> Config -> Advanced ams-hbase-site get the hbase.rootdir and hbase-tmp directory

4、Delete or Move the hbase-tmp and hbase.rootdir directories to an archive folder

Started AMS.
All services will came online and graphs started to display, after a few minutes

参考文档:
https://community.hortonworks.com/articles/11805/how-to-solve-ambari-metrics-corrupted-data.html


三、dfs.data.dir 配置导致datanode无法启动

报错如下所示:

查看日志如下:(日志为:less /var/log/hadoop/hdfs/hadoop-hdfs-datanode-hdp40.log)2017-12-20 12:51:21,201 WARN  datanode.DataNode (DataNode.java:checkStorageLocations(2524)) - Invalid dfs.datanode.data.dir /bigdata/hadoop/hdfs/data :
java.io.FileNotFoundException: File file:/bigdata/hadoop/hdfs/data does not existat org.apache.hadoop.fs.RawLocalFileSystem.deprecatedGetFileStatus(RawLocalFileSystem.java:624)at org.apache.hadoop.fs.RawLocalFileSystem.getFileLinkStatusInternal(RawLocalFileSystem.java:850)at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:614)at org.apache.hadoop.fs.FilterFileSystem.getFileStatus(FilterFileSystem.java:422)at org.apache.hadoop.util.DiskChecker.mkdirsWithExistsAndPermissionCheck(DiskChecker.java:139)at org.apache.hadoop.util.DiskChecker.checkDir(DiskChecker.java:156)at org.apache.hadoop.hdfs.server.datanode.DataNode$DataNodeDiskChecker.checkDir(DataNode.java:2479)at org.apache.hadoop.hdfs.server.datanode.DataNode.checkStorageLocations(DataNode.java:2521)at org.apache.hadoop.hdfs.server.datanode.DataNode.makeInstance(DataNode.java:2503)at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:2395)at org.apache.hadoop.hdfs.server.datanode.DataNode.createDataNode(DataNode.java:2442)at org.apache.hadoop.hdfs.server.datanode.DataNode.secureMain(DataNode.java:2623)at org.apache.hadoop.hdfs.server.datanode.SecureDataNodeStarter.start(SecureDataNodeStarter.java:77)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:243)
2017-12-20 12:51:21,203 ERROR datanode.DataNode (DataNode.java:secureMain(2630)) - Exception in secureMain
java.io.IOException: All directories in dfs.datanode.data.dir are invalid: "/bigdata/hadoop/hdfs/data" at org.apache.hadoop.hdfs.server.datanode.DataNode.checkStorageLocations(DataNode.java:2530)at org.apache.hadoop.hdfs.server.datanode.DataNode.makeInstance(DataNode.java:2503)at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:2395)at org.apache.hadoop.hdfs.server.datanode.DataNode.createDataNode(DataNode.java:2442)at org.apache.hadoop.hdfs.server.datanode.DataNode.secureMain(DataNode.java:2623)at org.apache.hadoop.hdfs.server.datanode.SecureDataNodeStarter.start(SecureDataNodeStarter.java:77)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:243)
2017-12-20 12:51:21,204 INFO  util.ExitUtil (ExitUtil.java:terminate(124)) - Exiting with status 1
2017-12-20 12:51:21,208 INFO  datanode.DataNode (LogAdapter.java:info(47)) - SHUTDOWN_MSG: 

解决:
(1)确认在更换了Ip 之后,该机器确实不存在该目录了

[root@hdp40 hdfs]# cd /bigdata/hadoop/hdfs/data
-bash: cd: /bigdata/hadoop/hdfs/data: No such file or directory

(2)手动创建对应的目录

     mkdir -p hdfs/data

(3)改变指定目录以及其子目录下的所有文件的拥有者和群组

[root@hdp40 hdfs]# chown -R -v hdfs:hadoop data
changed ownership of `data' to hdfs:hadoop
[root@hdp40 hdfs]# ll
total 4
drwxr-xr-x 2 hdfs hadoop 4096 Dec 20 16:07 data如果权限不是755则给他授权
[root@hdp40 hdfs]# chmod -R 755 data/

注:上述操作需要在所有做为datanode节点的机器上进行操作。

执行完上述步骤后:
重启dataNode,执行正常(笔者第一次重启的时候依然是报错,但是有点奇怪的是第二重启便可以正常启动了,只是启动的时间久了点)

四、Ranger启动失败

报错如下所示:

Watcher org.apache.solr.common.cloud.ConnectionManager@7b1083f6 name:ZooKeeperConnection Watcher:hdp39:2181,hdp40:2181,hdp41:2181/infra-solr got event WatchedEvent state:AuthFailed type:None path:null path:null type:None
zkClient received AuthFailed
makePath: /configs/ranger_audits/managed-schema
Error uploading file /usr/hdp/current/ranger-admin/contrib/solr_for_audit_setup/conf/managed-schema to zookeeper path /configs/ranger_audits/managed-schema
java.io.IOException: Error uploading file /usr/hdp/current/ranger-admin/contrib/solr_for_audit_setup/conf/managed-schema to zookeeper path /configs/ranger_audits/managed-schemaat org.apache.solr.common.cloud.ZkConfigManager$1.visitFile(ZkConfigManager.java:69)at org.apache.solr.common.cloud.ZkConfigManager$1.visitFile(ZkConfigManager.java:59)at java.nio.file.Files.walkFileTree(Files.java:2670)at java.nio.file.Files.walkFileTree(Files.java:2742)at org.apache.solr.common.cloud.ZkConfigManager.uploadToZK(ZkConfigManager.java:59)at org.apache.solr.common.cloud.ZkConfigManager.uploadConfigDir(ZkConfigManager.java:121)at org.apache.ambari.logsearch.solr.commands.UploadConfigZkCommand.executeZkConfigCommand(UploadConfigZkCommand.java:39)at org.apache.ambari.logsearch.solr.commands.UploadConfigZkCommand.executeZkConfigCommand(UploadConfigZkCommand.java:29)at org.apache.ambari.logsearch.solr.commands.AbstractZookeeperConfigCommand.executeZkCommand(AbstractZookeeperConfigCommand.java:38)at org.apache.ambari.logsearch.solr.commands.AbstractZookeeperRetryCommand.createAndProcessRequest(AbstractZookeeperRetryCommand.java:38)at org.apache.ambari.logsearch.solr.commands.AbstractRetryCommand.retry(AbstractRetryCommand.java:45)at org.apache.ambari.logsearch.solr.commands.AbstractRetryCommand.run(AbstractRetryCommand.java:40)at org.apache.ambari.logsearch.solr.AmbariSolrCloudClient.uploadConfiguration(AmbariSolrCloudClient.java:218)at org.apache.ambari.logsearch.solr.AmbariSolrCloudCLI.main(AmbariSolrCloudCLI.java:469)
Caused by: org.apache.zookeeper.KeeperException$AuthFailedException: KeeperErrorCode = AuthFailed for /configsat org.apache.zookeeper.KeeperException.create(KeeperException.java:123)at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1045)at org.apache.solr.common.cloud.SolrZkClient$4.execute(SolrZkClient.java:294)at org.apache.solr.common.cloud.SolrZkClient$4.execute(SolrZkClient.java:291)at org.apache.solr.common.cloud.ZkCmdExecutor.retryOperation(ZkCmdExecutor.java:60)at org.apache.solr.common.cloud.SolrZkClient.exists(SolrZkClient.java:291)at org.apache.solr.common.cloud.SolrZkClient.makePath(SolrZkClient.java:486)at org.apache.solr.common.cloud.SolrZkClient.makePath(SolrZkClient.java:408)at org.apache.solr.common.cloud.ZkConfigManager$1.visitFile(ZkConfigManager.java:67)... 13 more

解决方式:

  • 将各服务器的时间同步便解决了。观察上述日志发现有关Kerberos认证的错误,因而想到的第一点可能是服务器时间不同步所引起的。

五、有些服务启动成功后又立刻失败

  • 当遇到那些启动成功后又很快就自动停止的,首先是确认该服务是否已有一个启动了,但是还没有关闭或者看该服务端口是否被占用了。
  • 如:hive 的metastore 启动成功又立马自动停止。查看对应的端口发现已有对应的服务启动了,这种情况kill掉,重启便可。

HDP2.5更换集群IP相关推荐

  1. mongodb 3.4.10 更换集群IP

    原有集群配置: 服务器信息:192.168.200.155/156/157 服务器155 服务器156 服务器157 mongos mongos mongos config server config ...

  2. MapReduce Service更换集群外部时钟源,仅需10步

    摘要:MapReduce Service 集群使用NTP进行时钟同步.本文简要介绍了MapReduce Service集群NTP机制及NTP的配置方式. 本文分享自华为云社区<MapReduce ...

  3. 机房搬迁更改集群IP

    作者: weixiaobing 原文来源: https://tidb.net/blog/2db20d98 1.查看当前集群状态 [tidb@vm172-16-201-64 ~]$ tiup clust ...

  4. CEPH集群更换ip(更换ip前的防范和更换ip后的恢复)

    文章目录 修改`/etc/hosts`中的ip设置 修改`ceph.conf`中的ip地址 获取monmap 将`monmap`注入到集群 最近测试部在测试一些功能,在我们不知情得情况下更换了集群内外 ...

  5. MongoDB最新4.2.7版本三分片集群修改IP实操演练

    背景 重新组网,需要对现有MongoDB分片集群服务器的IP进行更改,因此也需要对MongoDB分片集群的IP也进行相应的更新,而MongoDB分片集群的IP修改不能单纯的通过配置来进行,需要一番折腾 ...

  6. db文件怎么修改_MongoDB最新4.2.7版本三分片集群修改IP实操演练

    背景 重新组网,需要对现有MongoDB分片集群服务器的IP进行更改,因此也需要对MongoDB分片集群的IP也进行相应的更新,而MongoDB分片集群的IP修改不能单纯的通过配置来进行,需要一番折腾 ...

  7. mysql 集群 增加服务器_MYSQL集群服务配置

    MYSQL集群服务配置 篇文档旨在介绍如何安装配置基于2台服务器的MySQL集群.并且实现任意一台服务器出现问题或宕机时MySQL依然能够继续运行. 注意! 虽然这是基于2台服务器的MySQL集群,但 ...

  8. 完美避坑!记一次Elasticsearch集群迁移架构实战

    作者介绍 李猛(ynuosoft),Elastic-stack产品深度用户,ES认证工程师,2012年接触Elasticsearch,对Elastic-Stack开发.架构.运维等方面有深入体验,实践 ...

  9. mysql集群2台linux_安装配置基于两台服务器的MySQL集群(2)

    以下为引用的内容: # mkdir /usr/src/mysql-mgm # cd /usr/src/mysql-mgm # tar -zxvf mysql-max-4.1.9-pc-linux-gn ...

最新文章

  1. 物联网网关市场预计到2026年将增长21.5亿美元
  2. 如何计算空中四个点是不是在一个平面上
  3. linux下文件的压缩和解压缩
  4. Wix 安装部署教程(十四) -- 多语言安装包之用户许可协议
  5. 重构-打造爱因斯坦谜题最快算法
  6. VM中Windows server 2012 R2系统安装SQL SERVER 2012的安装步骤
  7. html元素data属性设置变量,HTML5 自定义属性 data-* 和 jQuery.data 详解
  8. ubuntu1804系统设置在哪里_Ubuntu1804(Server 版) 安装及使用
  9. 如何使用Java创建AWS Lambda函数
  10. 爬虫小案例:基于Bing关键词批量下载图片(第二版)
  11. bootstrapValidator验证的remote中data属性里获取select一直是默认值
  12. matlab雷诺曲线,多重网格法求解雷诺方程的MATLAB编程 - 程序语言 - 小木虫 - 学术 科研 互动社区...
  13. 支持IE8的文件上传
  14. 找种子你还在用百度?七个你绝没用过的搜索引擎
  15. 设计模式之单例模式:饿汉模式(懒汉模式)及优缺点分析
  16. 第二章、Magick命令组合多个图像处理操作
  17. vue2.0生命周期数据共享
  18. 替换请求输出文件和日志文件
  19. GitLab-Runner 从安装到配置到入门
  20. ADS Assignment of DP

热门文章

  1. Python-Django毕业设计医院住院部管理系统(程序+Lw)
  2. (附源码)SSM医院住院部管理系统JAVA计算机毕业设计项目
  3. Flash 命令大全
  4. Word中分隔符 分页符 分栏符 换行符 分节符的用法
  5. 【Tensorflow 复习3】使用Tensorboard 可视化神经网络
  6. 网络变压器 10G base-T 1000base-T 对比
  7. 微信小程序实现文字长按复制、一键复制功能
  8. 瑞昱RTL8710对标乐鑫ESP8266 谁将成为物联网首选-新版
  9. 微信商业化的背后 七星级产品经理的蜕变-张小龙
  10. 看到华为人的工作方式,我心动了