Professional Documents
Culture Documents
Creating Hbase Cluster and Replication On Aws
Creating Hbase Cluster and Replication On Aws
AWS
1 Setting up Amazon EC2 Instances
Creating two clusters on same regions with 3 node on one cluster and 3 nodes on
other Clusters with minimum volume of 8GB.
Click Generate ,
.
Repeat this for slave nodes.
Select the pem file clusterkey.pem file and drag it to other right pane.
Now we need to add the AWS EC2 Key Pair identity Clusterkey.pem to ssh profile In
order to do that we will need to use following ssh utilities
ssh-add command prompts the user for a private key password and adds it
to the list maintained by ssh-agent. Once you add a password to ssh-agent,
you will not be asked to provide the key when using SSH or SCP to connect to
hosts with your public key.
Amazon EC2 Instance has already taken care of authorized_keys on master server,
execute following commands to allow password-less SSH access to slave servers.
Steps:
In a command line shell, change directories to the location of the private key file
that you created when you launched the instance.
Use the chmod command to make sure your private key file isn't publicly
viewable. For example, if the name of your private key file is my-key-pair.pem, you
would use the following command:
chmod 400 Clusterkey.pem
Use the ssh command to connect to the instance. You'll specify the private key
(.pem) file and username@public_dns_name. For Amazon Ubuntu, the default user
name is ubuntu. For RHEL5, the user name is often root but might be ec2-user. For
Ubuntu, the user name is ubuntu. For SUSE Linux, the user name is root. Otherwise,
check with your AMI provider.
(Optional) If you've launched a public AMI, verify that the fingerprint in the security alert
matches the fingerprint that you obtained in step 1. If these fingerprints don't match, someone
might be attempting a "man-in-the-middle" attack. If they match, continue to the next step
Enter yes.
You'll see a response like the following.
Warning: Permanently added 'ec2-54-241-10-95.compute-1.amazonaws.com' (RSA)
to the list of known hosts.
Sample screenshot for the password-less ssh,
Click Yes,
Note down the http://localhost:7180/ this is used to open the Cloudera Manager
Console using browser.
Click continue,
Login as Ubuntu user and click browse to upload the .pem file and click continue
Click Continue,
Choose the CDH services whichever required, and click inspect Assignments,
Click continue,
Check the health status and configuration issues it should shows good health
HBase Replication:
Step1:
Enable the replication In the Cloudera Manager as below
Step2:
Add the following code to HBase's configuration file (hbase-site.xml) to enable
replication on the master cluster:
hadoop@master1$ vi $HBASE_HOME/conf/hbase-site.xml
<property>
<name>hbase.replication</name>
<value>true</value>
</property>
Sync the change to all the servers, including the client nodes in the cluster, and
restart HBase.
Repeat this to slave node.
Step3:
hbase(main):019:0>put 'emp','row1','Details:mobile','90000101011'
0 row(s) in 0.0140 seconds
hbase(main):021:0> put 'emp','row1','Details:Year','2013'
Step6:
Connect to HBase Shell on the peer cluster and do a scan on the table to see if the
data has been replicated:
$HBASE_HOME/bin/hbase shell
COLUMN+CELL
column=Details:name,
column=Details:Eid,
Step6:
Stop the replication on the master cluster by running the following command:
hbase> stop_replication
Step7:
Remove the replication peer from the master cluster by using the following
command:
hbase> remove_peer '1'