Monday, November 30, 2015

Manual Upgrade HDP 2.2 to 2.3

  1. option - local repository setting for HDP 2.2 update (temporary internet access)
    1. cd /etc/yum.repos.d
    2. rm -fambari* HDP*
    3. wget http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.1.0/ambari.repo
    4. wget http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.3.0.0/hdp.repo
    5. yum -y install yum-utils createrepo
    6. install and run web server
      1. HTTPD
    7. mkdir -p /var/www/html/
    8. cd /var/www/html/
    9. mkdir -p ambari/centos6
    10. cd ambari/centos6
    11. reposync -r Updates-ambari-2.1.0
    12. createrepo Updates-ambari-2.1.0
    13. cd /var/www/html/
    14. mkdir -p hdp/centos6
    15. cd hdp/centos6
    16. reposync -r HDP-2.3.0.0
    17. reposync -r HDP-UTILS-1.1.0.20
    18. createrepo HDP-2.3.0.0
    19. createrepo HDP-UTILS-1.1.0.20
    20. edit DocumentRoot and Directory at /usr/local/apache2/conf/httpd.conf or
      1. cd /usr/local/apache2/htdocs
      2. ln -s /var/www/html/ambari ambari
      3. ln -s /var/www/html/hdp hdp
    21. http://hostname/ambari/centos6/Updates-ambari-2.1.0
    22. http://hostname/hdp/centos6/HDP-2.3.0.0
    23. http://hostname/hdp/centos6/HDP-UTILS-1.1.0.20
    24. option (If you have multiple repositories configured in your environment)
      1. yum -y install yum-plugin-priorities
      2. vim /etc/yum/pluginconf.d/priorities.conf
        1. [main]
        2. enabled=1
        3. gpgcheck=0
    25. stop web server at the end
      1. /usr/local/apache2/bin/apachectl -k stop
  2. Upgrading ambari 2.0 to 2.1 (HDP)
    1. http://mungeol-heo.blogspot.kr/2015/11/upgrading-ambari-20-to-21-hdp.html
  3. Upgrading ambari metrics (HDP)
    1. http://mungeol-heo.blogspot.kr/2015/11/upgrading-ambari-metrics-hdp.html
  4. ambari web -> admin > stack and versions > manage versions > + register version
  5. enter 0.0
  6. enter 'http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.3.0.0' for HDP base URL
  7. enter 'http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos6' for HDP-UTILS base URL
  8. save
  9. go to dashboard > admin > stack and versions > verions > install packages > ok
  10. record component layoutbrowse to each Service except HDFS and ZooKeeper and perform Stop
    1. http://ambari.server:8080/api/v1/clusters/cluster.name/hosts?fields=host_components
  11. namenode (active) hostlog in to ambari
    1. cd <dfs.namenode.name.dir>
    2. Make sure that only a "/current" directory and no "/previous" directory exists
    3. cp -r current /home/hdfs/
    4. su hdfs
    5. cd
    6. hdfs fsck / -files -blocks -locations > dfs-old-fsck-1.log
    7. hdfs dfsadmin -report > dfs-old-report-1.log
    8. hdfs dfsadmin -safemode enter
    9. hdfs dfsadmin -saveNamespace
    10. hdfs dfsadmin -finalizeUpgrade
  12. Using Ambari Web, stop HDFS service and stop ZooKeeper service
  13. namenode (active) hosthdp-select set all 2.3.0.0-2557 (all hosts)
    1. cd <dfs.namenode.name.dir>/current
    2. hdfs oev -i edits_inprogress_* -o edits.out
    3. Verify edits.out file. It should only have OP_START_LOG_SEGMENT transaction
  14. mkdir -p /work/upgrade_hdp_2
  15. cd /work/upgrade_hdp_2
  16. curl -O https://raw.githubusercontent.com/apache/ambari/branch-2.1/ambari-server/src/main/python/upgradeHelper.py
  17. chmod 777 upgradeHelper.py
  18. curl -O https://raw.githubusercontent.com/apache/ambari/branch-2.1/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.2_to_2.3.json
  19. python upgradeHelper.py --hostname $HOSTNAME --user $USERNAME --password $PASSWORD --clustername $CLUSTERNAME --fromStack $FROMSTACK --toStack $TOSTACK --upgradeCatalog UpgradeCatalog_2.2_to_2.3.json update-configs [config-type]curl -O https://raw.githubusercontent.com/apache/ambari/branch-2.1/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.2_to_2.3_step2.json
    1. ariable
      Value
      $HOSTNAME
      Ambari Server hostname. This should be the FQDN for the host running the Ambari Server.
      $USERNAME
      Ambari Admin user.
      $PASSWORD
      Password for the user.
      $CLUSTERNAME
      Name of the cluster. This is the name you provided when you installed the cluster with Ambari. Login to Ambari and the name can be found in the upper-left of the Ambari Web screen. This is case-sensitive.
      $FROMSTACK
      The “from” stack. Forexample:2.2
      $TOSTACK
      The “to” stack. Forexample:2.3
      config-type
      Optional: the config-type to upgrade. For example:hdfs-site. By default, all configurations are updated.
  20. upgrade zookeeper
    1. start it at ambari web
    2. mv /etc/zookeeper/conf /etc/zookeeper/conf.saved
    3. ln -s /usr/hdp/current/zookeeper-client/conf /etc/zookeeper/conf
  21. upgrade HDFS
    1. \cp -r /etc/hadoop/conf/* /etc/hadoop/2.3.0.0-2557/0/
    2. mv /etc/hadoop/conf /etc/hadoop/conf.saved
    3. ln -s /usr/hdp/current/hadoop-client/conf /etc/hadoop/conf
    4. su -l hdfs -c "/usr/hdp/current/hadoop-client/sbin/hadoop-daemon.sh start namenode -upgrade"
    5. ps -ef | grep -i NameNode
    6. su -l hdfs -c "/usr/hdp/current/hadoop-client/sbin/hadoop-daemon.sh start datanode"
    7. ps -ef | grep DataNode
    8. ambari web > services > HDFS > restart all
    9. run service check
    10. su -l hdfs -c "hdfs dfsadmin -safemode get"
      1. safe mode is off
  22. upgrade YARN and MR2note that you may have to upgrade other services to complete the upgrading which depends on your cluster configuration
    1. su -l hdfs -c "hdfs dfs -mkdir -p /hdp/apps/2.3.0.0-2557/mapreduce/"
    2. su -l hdfs -c "hdfs dfs -put /usr/hdp/current/hadoop-client/mapreduce.tar.gz /hdp/apps/2.3.0.0-2557/mapreduce/."
    3. su -l hdfs -c "hdfs dfs -put /usr/hdp/current/hadoop-mapreduce-client/hadoop-streaming.jar /hdp/apps/2.3.0.0-2557/mapreduce/."
    4. su -l hdfs -c "hdfs dfs -chown -R hdfs:hadoop /hdp" 
    5. su -l hdfs -c "hdfs dfs -chmod -R 555 /hdp/apps/2.3.0.0-2557/mapreduce" 
    6. su -l hdfs -c "hdfs dfs -chmod -R 444 /hdp/apps/2.3.0.0-2557/mapreduce/mapreduce.tar.gz" 
    7. su -l hdfs -c "hdfs dfs -chmod -R 444 /hdp/apps/2.3.0.0-2557/mapreduce/hadoop-streaming.jar"
    8. su -l yarn -c "yarn resourcemanager -format-state-store"
    9. start YARN and MR2 from ambari web
    10. run service check for YARN and MR2
  23. sudo su -l hdfs -c "hdfs dfsadmin -finalizeUpgrade"
  24. ambari-server set-current --cluster-name=dev --version-display-name=HDP-2.3.0.0
  25. option
    1. If your cluster includes Ranger
      1. cd /work/upgrade_hdp_2
        1. python upgradeHelper.py --hostname $HOSTNAME --user $USERNAME --password $PASSWORD --clustername $CLUSTERNAME --fromStack $FROMSTACK --toStack $TOSTACK --upgradeCatalog UpgradeCatalog_2.2_to_2.3_step2.json update-configs [config-type]

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.