Compile and run hbase source, install Hadoop cluster

Source: Internet
Author: User
Tags zookeeper ssh git clone

Node1:namenode, Datanode, Jobtracker, Tasktracker,zookeeper, Hmaster, Hregionserver

Node2:datanode, Tasktracker, Hregionserver

Install maven, Edit/etc/profile:

Export m2_home=/home/apache-maven-3.1.1

Export path= $M 2_home/bin: $PATH

Source/etc/profile

Edit/etc/hosts

192.168.20.24 Node1

192.168.20.98 Node2

Configuring Key baased Login:

ssh-keygen–t RSA

Cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

chmod 0600 ~/.ssh/authorized_keys

SCP ~/.ssh/authorized_keys root@node2:/root/.ssh/

1. Install Hadoop

Download Hadoop:

http://www.apache.org/dyn/closer.cgi/hadoop/common/

Edit Conf/core-site.xml

<configuration>

<property>

<name>fs.default.name</name>

<value>hdfs://node1:9000</value>

</property>

<property>

<name>dfs.permissions</name>

<value>false</value>

</property>

</configuration>

Edit Conf/hdfs-site.xml

<configuration>

 

<property>

         <name>dfs.data.dir</name>

        <value >/opt/hadoop/hadoop/dfs/name/data</value>

        <final >true</final>

</property>

<property>

         <name>dfs.name.dir</name>

        <value >/opt/hadoop/hadoop/dfs/name</value>

        <final> true</final>

</property>

<property>

         <name>dfs.replication</name>

        <value>2 </value>

</property>

 

</configuration>

Edit Conf/mapred-site.xml

<configuration>

<property>

<name>mapred.job.tracker</name>

<value>node2:9001</value>

</property>

</configuration>

Edit conf/slaves

Node1

Node2

Edit Conf/master

Node1

Edit conf/hadoop-env.sh

Export java_home=/usr/java/jdk1.7.0_21

Hadoop format:

Bin/hadoop Namenode-format

Copy the code to Node2:

Scp-r hadoop-1.2.1/root@node2:/opt/

Start Hadoop:

bin/start-all.sh

2. Compile and Install HBase

Download HBase

git clone https://github.com/apache/hbase.git

Edit Conf/hbase-site.xml

<configuration>

<property>

<name>hbase.rootdir</name>

<value>hdfs://node1:9000/hbase</value>

</property>

<property>

<name>hbase.cluster.distributed</name>

<value>true</value>

</property>

<property>

<name>hbase.zookeeper.quorum</name>

<value>node1</value>

</property>

<property>

<name>hbase.assignment.maximum.attempts</name>

<value>1</value>

</property>

</configuration>

Edit conf/hbase-env.sh

Export Hbase_manages_zk=true

Export java_home=/usr/java/jdk1.7.0_21

Edit conf/regionservers

Node1

Node2

Build HBase:

MVN Clean package-dskiptests-dhadoop.profile=1.1-dhadoop.version=1.2.1

Copy the code to Node2:

Scp-r hbase-trunk/root@node2:/opt/

Start HBase:

bin/start-hbase.sh

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.