Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

 

To deploy your extension, run these steps on both your master and slave clusters:

  1. Create an extension directory 

    Code Block
    $ mkdir -p /opt/cdap/master/ext/hbase/repl
  2. Copy your jar to the directory 

    Code Block
    $ cp myextension.jar /opt/cdap/master/ext/hbase/repl/
  3. 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>
  4. 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

  1. Stop all CDAP programs on the master cluster
  2. Stop CDAP on the master cluster
  3. Copy any hdfs files that have not yet been copied using your distro's solution or distcp
  4. 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
  5. Copy the master state onto your slave cluster 

    Code Block
    $master$ scp /tmp/master_state <slave-master>:/tmp/master_state
  6. 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.
  7. 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
  8. Start CDAP on the slaveslave 

    Code Block
    slave$ cdap master start