ambari升级
备份元数据
ambari-server backup
备份mysql数据库
mysql -u ...... > ambari.sql
备份ambari配置文件
cp /etc/ambari-server/conf/ambari.properties /etc/ambari-server/conf/ambari.properties.bak
停止相关服务(不影响集群正常服务)
ambari-server stop
ambari-agent stop
配置ambari.repo源
安装包地址:
http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.2.0/ambari-2.6.2.0-centos7.tar.gz
http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.5.0/HDP-2.6.5.0-centos7-rpm.tar.gz
http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7/HDP-UTILS-1.1.0.22-centos7.tar.gz
修改好后将这个/etc/yum.repos.d/ambari.repo文件scp复制到其他各个节点
[hdfs@hz16-hadoop 2.6.2.0-155]$ pwd
/var/www/html/ambari/ambari/centos7/2.6.2.0-155
[hdfs@hz16-hadoop 2.6.2.0-155]$ ls
ambari ambari.repo artifacts.txt build.id build_metadata.txt repodata RPM-GPG-KEY smartsense tars
[hdfs@hz16-hadoop 2.6.2.0-155]$ cat /etc/yum.repos.d/ambari.repo.bak
[ambari-2.6.2.2]
name=ambari Version - ambari-2.6.2.2
baseurl=http://ip/ambari/ambari/centos7/2.6.2.0-155
gpgcheck=1
gpgkey=http://ip/ambari/ambari/centos7/2.6.2.0-155/RPM-GPG-KEY/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
升级 Ambari Server
在 Ambari Server服务器上执行
yum clean all
yum info ambari-server
yum -y upgrade ambari-server
ambari-server upgrade
ambari-server start
重新设置Mysql驱动
ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar
升级Ambari Agent
yum upgrade ambari-agent
ambari-agent start
升级其他Ambari相关组件
在所有运行Ambari Infra服务的节点上执行如下命令
yum clean all
yum -y upgrade ambari-infra-solr-client
在所有运行Metrics Monitor服务的节点上执行如下命令,集群中每个节点都有此服务
yum clean all
yum -y upgrade ambari-metrics-monitor ambari-metrics-hadoop-sink
在所有运行Metrics Collector服务的节点上执行如下命令
yum -y upgrade ambari-metrics-collector
在运行 Grafana 服务的节点上执行如下命令
yum -y upgrade ambari-metrics-grafana
hdp升级
配置本地数据仓库
[hdfs@hz16-hadoop 2.6.2.0-155]$ pwd
/var/www/html/ambari/ambari/centos7/2.6.2.0-155
[hdfs@hz16-hadoop 2.6.2.0-155]$ cat /etc/yum.repos.d/hdp.repo
[HDP-2.6.5.0]
name=HDP Version - HDP-2.6.5.0
baseurl=http://ip/ambari/HDP/centos7/2.6.5.0-292
gpgcheck=1
gpgkey=http://ip/ambari/HDP/centos7/2.6.5.0-292/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[HDP-UTILS-1.1.0.22]
name=HDP Utils Version - HDP-UTILS-1.1.0.22
baseurl=http://ip/ambari/HDP-UTILS/HDP-UTILS/centos7/1.1.0.22
gpgcheck=1
gpgkey=http://ip/ambari/HDP-UTILS/HDP-UTILS/centos7/1.1.0.22/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
查看是否配置成功
yum clean all
yum list
升级
- 点击右上角Admin > Stack and Versions
- 点击Versions > Manager Versions
- 点击Register Version进行注册,填写自己配置的yum源本地仓库地址(在Versions中的show details也可以配置本地仓库)
- 点击Install > 集群名称
注意
hdfs的safemode需要关闭
安装到百分90的时候需要点击finalized
- 滚动升级的过程中(Rolling Upgrade),需要点击Service Actions的Run Service Check