下载安装包 |
hbase-0.95.2-cdh5.0.0-beta-1.tar.gz hbase需对应hadoop版本 |
解压 |
tar zxvf hbase-0.95.2-cdh5.0.0-beta-1.tar.gz ln -s /opt/hbase-0.95.2-cdh5.0.0-beta-1 ~/hbase 所有节点都解压 |
ssh双向认证 |
配置所有机器hosts vi /etc/hosts 10.10.1.1 hadoop1 10.10.1.2 hadoop2 10.10.1.3 hadoop3
使用hostname 设置主机名 修改/etc/sysconfig/network 中的内容改为相应的主机名
在.ssh目录生成id_rsa.pub ,添加到本机~/.ssh/authorized_keys文件里面 ssh-keygen -q -t rsa cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys 本机登入验证:ssh localhost 复制authorized_keys到其他机器上 scp ~/.ssh/id_rsa.pub hadoop3:~/ cat ~/id_rsa.pub >> ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys chmod 700 ~/.ssh 其他机器重复以上步骤 |
修改环境参数 |
vi /etc/profile 增加以下内容: export JAVA_HOME=/opt/jdk1.7.0_51 export CLASSPATH=.:$JAVA_HOME/lib/tools.jar:/lib/dt.jar export PATH=$PATH:$JAVA_HOME/bin export HADOOP_DEV_HOME=/home/hadoop/hadoop export PATH=$PATH:$HADOOP_DEV_HOME/bin
修改ulimit vi /etc/security/limits.d/90-nproc.conf * soft nproc 502400
执行环境参数 source /etc/profile |
修改hadoop配置 |
1.编辑同步脚本:vi hbase/cp2slaves.sh BASE_PATH=`dirname $0` cd $BASE_PATH echo `/bin/pwd` scp conf/* hadoop2:~/hbase/conf/ scp conf/* hadoop3:~/hbase/conf/
2.配置hbase/conf/hbase-env.sh export JAVA_HOME=/opt/jdk1.7.0_51 export HBASE_PID_DIR=${HBASE_LOG_DIR} export HBASE_MANAGES_ZK=true
3.配置hbase/conf/hbase-site.xml <property> <name>hbase.rootdir</name> <value>hdfs://hadoop1:9000/hbase</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>hadoop1</value> </property> <property> <name>zookeeper.session.timeout</name> <value>60000</value> </property> <property> <name>hbase.zookeeper.property.clientPort</name> <value>2181</value> </property> <property> <name>hbase.tmp.dir</name> <value>/home/hadoop/hbase/tmp</value> <description>Temporary directory on the local filesystem.</description> </property> <property> <name>hbase.client.keyvalue.maxsize</name> <value>10485760</value> </property> 4.配置hbase/conf/regionservers hadoop1 hadoop2 hadoop3 5.同步配置文件 sh hadoop/cp2slaves.sh |
启动 |
hbase/bin/start-hbase.sh
|
测试验证 |
http://hadoop1:60010 hbase/bin/hbase shell
|
停止 |
hbase/bin/stop-hbase.sh
|
原文:http://www.cnblogs.com/langke93/p/3667708.html