...
To deploy your extension, run these steps on both your master and slave clusters:
Create an extension directory
Code Block $ mkdir -p /opt/cdap/master/ext/hbase/repl
Copy your jar to the directory
Code Block $ cp myextension.jar /opt/cdap/master/ext/hbase/repl/
Modify cdap-site.xml to use your implementation of HBaseDDLExecutor
Code Block <property> <name>hbase.ddlexecutor.extension.dir</name> <value>/opt/cdap/master/ext/hbase</value> </property>
Modify cdap-site.xml with any properties required by your executor. Anything prefixed by 'cdap.hbase.spi.hbase.' will be available through the Context object passed into your executor's initialize method
Code Block <property> <name>cdap.hbase.spi.hbase.zookeeper.quorum</name> <value>hbase-master-i18003-1000.dev.continuuity.net:2181/cdap</value> </property> <property> <name>cdap.hbase.spi.hbase.zookeeper.session.timeout</name> <value>60000</value> </property> <property> <name>cdap.hbase.spi.hbase.cluster.distributed</name> <value>true</value> </property> <property> <name>cdap.hbase.spi.hbase.bulkload.staging.dir</name> <value>/tmp/hbase-staging</value> </property> <property> <name>cdap.hbase.spi.hbase.replication</name> <value>true</value> </property>
Before starting CDAP on the master cluster, run a command on the slave cluster to load the HBase coprocessors required by CDAP onto the slave cluster 's HDFS
Code Block |
---|
$slave$ cdap setup coprocessors |
Start CDAP on the master cluster
Code Block |
---|
$master$ cdap master start |
Manual Failover Procedure
- Stop all CDAP programs on the master cluster
- Stop CDAP on the master cluster
- Copy any hdfs files that have not yet been copied using your distro's solution or distcp
Run the replication status tool to get cluster state
Code Block $master$ cdap run co.cask.cdap.data.tools.ReplicationStatusTool -m -o /tmp/master_state
Copy the master state onto your slave cluster
Code Block $master$ scp /tmp/master_state <slave-master>:/tmp/master_state
Verify replication has copied required data on the slave
Code Block $slave$ cdap run co.cask.cdap.data.tools.ReplicationStatusTool -i /tmp/master_state ... Master and Slave Checksums match. HDFS Replication is complete. HBase Replication is complete.
Run Hive's metatool to update locations for Hive tables
Code Block $slave$ hive --service metatool -updateLocation hdfs://[master-namenode-host]:[master-namenode-port] hdfs://[slave-namenode-host]:[slave-namenode-port] -tablePropKey avro.schema.url -serdePropKey avro.schema.url
Start CDAP on the slaveslave
Code Block slave$ cdap master start