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 |
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
Edit Conf/master
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:
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
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: