How to upgrade to Jethro 3 - step by step
- Backup existing Jethro instance (not mandatory for development environment).
- As part of the upgrade from V2.X to V3.X you will need to drop the existing cubes. You can use the following to generate a script to regenerate the cubes once the upgrade is completed.
JethroClient {instance-name} <host>:<port> -p <password> -q "SHOW CUBES;" -c -d '|' --no_header -o {Show_Cubes_Output} cat {Show_Cubes_Output} | awk -F'|' '{ print "GENERATE CUBES " $1 " FROM " $12 ";" }' > {Generate cubes output file}
For example:
JethroClient sanity_sales localhost:9111 -p jethro -q "SHOW CUBES;" -c -d '|' --no_header -o Show_Cubes_Output.csv cat Show_Cubes_Output.csv | awk -F'|' '{ print "GENERATE CUBES " $1 " FROM " $12 ";" }' > Generate_Cubes.sql
The Generate_Cubes.sql will have lines similar to the following:
GENERATE CUBES cube1 FROM SELECT store_country, store_name, SUM(net_profit) FROM sales_demo GROUP BY store_country, store_name;
Using Jethro Client run the following to drop cubes and adaptive cache.
DROP ADAPTIVE STORAGE;
Stop Jethro services on all nodes:
service jethro stop
If your existing Jethro version is earlier than 2.1.0 you should perform the following, otherwise skip to next step. To find your current version of Jethro you can run the command show version via Jethro Client.
Backup schema files.
For HDFS instance:hadoop fs –copyToLocal {instance-location}/metadata/schema* /backup20X/
For local instance:
cp {instance-location}/metadata/schema* /backup20X/
Instance-location can be found in local-conf.ini file as the value of storage.root.path variable.
Upgrade to Jethro 2.1.4 (latest 2.X release) on all nodes:
Download the relevant rpm:
For CDH:wget https://jethrodownload.s3.amazonaws.com/jethro-2.1.4-15313.x86_64.rpm
For MapR:
wget https://jethrodownload.s3.amazonaws.com/jethro-MapR.2.1.4-15313.x86_64.rpm
For local instance:
wget https://jethrodownload.s3.amazonaws.com/jethro-2.1.4-15313.x86_64.rpm
Install the downloaded rmp file:
sudo rpm –Uvh {downloaded rpm}
Start Jethro services with user "jethro":
su - jethro service jethro start
Test a random query via Jethro CLI.
Update schema.
For example:CREATE TABLE TEST(A INTEGER);
Stop Jethro services on all nodes:
service jethro stop
Backup schema files to allow easy downgrade if needed (data model is changed by the new version, therefore schema files will be edited).
For HDFS instance:hadoop fs –copyToLocal {instance-location}/metadata/schema* /backup214/
For local instance:
cp {instance-location}/metadata/schema* /backup214/
Instance-location can be found in local-conf.ini file as the value of storage.root.path variable.
Upgrade to Jethro 3.X on all nodes:
Download the relevant rpm:
For CDH:wget http://jethrodownload.s3.amazonaws.com/jethro-3.3.0-17456.x86_64.rpm
For MapR:
wget http://jethrodownload.s3.amazonaws.com/jethro-MapR.3.3.0-17456.x86_64.rpm
For local instance:
wget http://jethrodownload.s3.amazonaws.com/jethro-3.3.0-17456.x86_64.rpm
Install the downloaded rpm file:
sudo rpm –Uvh {downloaded rpm}
Copy updated log properties file to local instance folder with user "jethro" on all nodes:
su - jethro cp /opt/jethro//current/conf/default-log4j.properties /opt/jethro/instances/{instance-name}/log4j.properties cp /opt/jethro//current/conf/default-jethrolog.properties /opt/jethro/instances/{instance-name}/jethrolog.properties
Start Jethro services:
service jethro start
In case you captured the cubes you had before the upgrade as previously instructed, you can now regenerate them using the following command.
JethroClient {instance-name} <host>:<port> -p <password> -i <Generate cubes output file> JethroClient sanity_sales localhost:9111 -p jethro -i Generate_Cubes.sql
If you want to turn on auto cube update and generation, run the following commands via JethroClient.
set global dynamic.aggregation.auto.generate.new.cubes.enable=1; set global dynamic.aggregation.auto.regenerate.cubes.enable=1; set global dynamic.aggregation.auto.update.final.cubes.enable=1; set global dynamic.aggregation.auto.update.incremental.cubes.enable=1;