Upgrade Hue

To upgrade Hue installations to version 3.8.1, or 3.9, complete the following steps as a user with admin permissions:
Note: If you installed Hue with the MapR Installer, use the latest version of the MapR Installer to perform the upgrade.
  1. If you have modified the configuration files in your current installation of Hue and you want to apply those changes to the updated version, create a backup of the configuration files in a location outside of the MapR installation directory.
    Configuration properties are located in /opt/mapr/hue/hue-<version>/desktop/conf/.
  2. Stop the Hue service.
    maprcli node services -name hue -action stop -nodes <ip_address>
  3. Create a Hue database dump as a JSON object:
    For MySQL, PostgreSQL, or Oracle
    cd /opt/mapr/hue/hue-<version>/build/env/bin/
    source /opt/mapr/hue/hue-<version>/build/env/bin/activate
    ./hue dumpdata > dump-hue-<version>.json
    For SQLite
    cd /opt/mapr/hue/hue-<version>/desktop
    sqlite3 desktop.db .dump > ~/dump-hue-<version>-sqlite.bak
  4. Upgrade Hue packages:
    • On Ubuntu:
      apt-get install mapr-hue-base mapr-hue
    • On RedHat/CentOS:
      yum upgrade mapr-hue-base mapr-hue
  5. Copy the changes that you made for required services in your existing hue.ini file into the latest version of the file:
  6. If Hue is configured to use the SQLite database, perform the following steps:
    1. If the Hue node runs on Ubuntu, install sqlite3.
      apt-get install sqlite3
    2. Run the following commands:
      cd /opt/mapr/hue/hue-<new_version>/desktop
      sudo sqlite3 desktop.db
      DELETE FROM django_content_type;
  7. If Hue is installed on CentOS/RedHat 7.x nodes, complete the following steps:
    1. Create the following symlink to the Cyrus SASL library:
      ln -s /lib64/libsasl2.so.3.0.0 /lib64/libsasl2.so.2
    2. If Hue is also configured to use a MySQL database, run the following commands to install MariaDB and the Redhat 6 compatibility library:
      yum install mariadb  
      ver=$(rpm -qa mariadb|cut -d- -f2)
      rpm -ivh --nodeps http://yum.mariadb.org/$ver/rhel7-amd64/rpms/MariaDB-$ver-centos7-x86_64-compat.rpm 
  8. Upload the JSON dump file to the Hue database:
    For MySQL, PostgreSQL, or Oracle
    cd /opt/mapr/hue/hue-<new_version>/build/env/bin/
    source /opt/mapr/hue/hue-<new_version>/build/env/bin/activate
    ./hue loaddata dump-hue-<old_version>.json
    For SQLite
    cd /opt/mapr/hue/hue-<new_version>/desktop
    mv desktop.db desktop.db.old
    sqlite3 desktop.db < ~/dump-hue-<old_version>-sqlite.bak
    For example, run the following commands to upload the Hue 3.8.1 JSON dump file for MySQL into the Hue 3.9.0 installation directory:
    cd /opt/mapr/hue/hue-3.9.0/build/env/bin/
    source /opt/mapr/hue/hue-3.9.0/build/env/bin/activate 
    ./hue loaddata dump-hue-3.8.1.json
  9. Update the old database schema so that it is compatible with the new upgraded version:
    source /opt/mapr/hue/hue-<new_version>/build/env/bin/activate
    /opt/mapr/hue/hue-<new_version>/build/env/bin/hue syncdb --noinput
    /opt/mapr/hue/hue-<new_version>/build/env/bin/hue migrate --merge
    For example, run the following commands to update the database schema so that it is compatible with Hue 3.9.0:
    source /opt/mapr/hue/hue-3.9.0/build/env/bin/activate
    /opt/mapr/hue/hue-3.9.0/build/env/bin/hue syncdb --noinput
    /opt/mapr/hue/hue-3.9.0/build/env/bin/hue migrate --merge
  10. If you are using Hadoop MRv1, complete the following steps to establish communication between Hue and the JobTracker processes:
    1. Remove existing Hue plugins from the MapReduce lib directory:
      rm /opt/mapr/hadoop/hadoop-0.20*/lib/hue-plugins-*.jar
    2. Copy new Hue plugins to the MapReduce lib directory:
      cp /opt/mapr/hue/hue-<new_version>/desktop/libs/hadoop/java-lib/hue-plugins-*.jar /opt/mapr/hadoop/hadoop-0.20*/lib/
    3. Restart the JobTracker services:
      maprcli node services -jobtracker restart -nodes <ip_addresses>
  11. Start the Hue service:
    maprcli node services -name hue -action start -nodes <ip_address>