Linux下Hadoop(伪分布) + Zookeeper + HBase(一个节点) 部署
2015-10-19 15:59
477 查看
下面将介绍,Hbase的部署过程。
前期准备:
1.安装配置好hadoop(我这里是伪分布),并确认能够使用
core-site.xml文件配置如下:
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://172.16.43.10:9000</value>
</property>
<property>
<name>dfs.datanode.socket.write.timeout</name>
<value>3000000</value>
</property>
<property>
<name>dfs.socket.timeout</name>
<value>3000000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/home/hadoop/tmp</value>
<description>A base for other temporary directories.</description>
</property>
</configuration>
2.安装配置好Zookeeper(我在本机通过三个tomcat搭建了一个三个节点的环境)
第一个zoo.cfg:
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=5
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=2
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/home/hadoop/zookeeper/zookeeper0/data
dataLogDir=/home/hadoop/zookeeper/zookeeper0/logs
# the port at which the clients will connect
clientPort=2181
server.0=172.16.43.10:8880:7770
server.1=172.16.43.10:8881:7771
server.2=172.16.43.10:8882:7772 第二个:
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=5
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=2
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/home/hadoop/zookeeper/zookeeper0/data
dataLogDir=/home/hadoop/zookeeper/zookeeper0/logs
# the port at which the clients will connect
clientPort=2182
server.0=172.16.43.10:8880:7770
server.1=172.16.43.10:8881:7771
server.2=172.16.43.10:8882:7772
第三个:
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=5
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=2
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/home/hadoop/zookeeper/zookeeper0/data
dataLogDir=/home/hadoop/zookeeper/zookeeper0/logs
# the port at which the clients will connect
clientPort=2182
server.0=172.16.43.10:8880:7770
server.1=172.16.43.10:8881:7771
server.2=172.16.43.10:8882:7772 3.hbase-1.1.2-bin.tar
一、正式开始部署
1.上传hbase-1.1.2-bin.tar到linux系统上,并解压(我解压在 /home/hadoop/hbase 文件夹中)
tar -zxvf hbase-1.1.2-bin.tar
注:解压后,请确认好,该文件夹的权限,以免出现不必要的问题
2.开始配置hbase,进入 /home/hadoop/hbase/hbase-1.1.2/conf,并修改hbase-site.xml文件
cd /home/hadoop/hbase/hbase-1.1.2/conf
vi hbase-site.xml
修改后的hbase-site.xml内容为:
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://hadoop:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.master</name>
<value>hadoop:60000</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>172.16.43.10:2181,172.16.43.10:2182,172.16.43.10:2183</value>
</property>
<property>
<name>hbase.tmp.dir</name>
<value>/home/hadoop/hbase-tmp</value>
</property>
<property>
<name>hbase.master.info.port<
4000
;/name>
<value>60010</value>
</property>
</configuration> 注:1.hbase.rootdir 属性值设置时,请直接写主机名,我这里为 hadoop 对应的是 172.16.43.10
2.hbase.zookeeper.quorum 设置时,请根据Zookeeper的zoo.cfg配置文件的内容进行配置,这里需要制定端口号,如果直接写172.16.43.10,则Hbase只会去连接一个Zookeeper节点
3.需要配置hbase.master.info.port的值,否则在浏览器无法访问到Hbase管理界面,设置了后,直接访问 172.16.43.10:60010
3.修改hbase-ebv.sh
修改指定几个属性的内容为:
export JAVA_HOME=/home/hadoop/java/jdk1.7.0_75
export HBASE_CLASSPATH=/home/hadoop/hadoop-src/hadoop-2.5.1/etc/hadoop
export HBASE_MANAGES_ZK=false JAVA_HOME 为你安装的JAVA的目录
HBASE_CLASSPATH 为你安装的hadoop的配置文件的目录
HBASE_MANAGES_ZK 设置为false 或者不设置,使用外部Zookeeper
4.修改完毕后,先确保hadoop,Zookeeper启动正常后,启动Hbase
cd /home/hadoop/hbase/hbase-1.1.2/bin
./start-hbase.sh 注:如果出现错误,可以到logs文件夹底下进行相应的查看
5.简单验证是否启动成功,在bin目录下,进入hbase shell 客户端
./hbase shell 进入成功,则代表启动成功,或者直接在浏览器中访问 172.16.43.10:60010。
至此,Hbase部署完毕
前期准备:
1.安装配置好hadoop(我这里是伪分布),并确认能够使用
core-site.xml文件配置如下:
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://172.16.43.10:9000</value>
</property>
<property>
<name>dfs.datanode.socket.write.timeout</name>
<value>3000000</value>
</property>
<property>
<name>dfs.socket.timeout</name>
<value>3000000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/home/hadoop/tmp</value>
<description>A base for other temporary directories.</description>
</property>
</configuration>
2.安装配置好Zookeeper(我在本机通过三个tomcat搭建了一个三个节点的环境)
第一个zoo.cfg:
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=5
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=2
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/home/hadoop/zookeeper/zookeeper0/data
dataLogDir=/home/hadoop/zookeeper/zookeeper0/logs
# the port at which the clients will connect
clientPort=2181
server.0=172.16.43.10:8880:7770
server.1=172.16.43.10:8881:7771
server.2=172.16.43.10:8882:7772 第二个:
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=5
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=2
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/home/hadoop/zookeeper/zookeeper0/data
dataLogDir=/home/hadoop/zookeeper/zookeeper0/logs
# the port at which the clients will connect
clientPort=2182
server.0=172.16.43.10:8880:7770
server.1=172.16.43.10:8881:7771
server.2=172.16.43.10:8882:7772
第三个:
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=5
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=2
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/home/hadoop/zookeeper/zookeeper0/data
dataLogDir=/home/hadoop/zookeeper/zookeeper0/logs
# the port at which the clients will connect
clientPort=2182
server.0=172.16.43.10:8880:7770
server.1=172.16.43.10:8881:7771
server.2=172.16.43.10:8882:7772 3.hbase-1.1.2-bin.tar
一、正式开始部署
1.上传hbase-1.1.2-bin.tar到linux系统上,并解压(我解压在 /home/hadoop/hbase 文件夹中)
tar -zxvf hbase-1.1.2-bin.tar
注:解压后,请确认好,该文件夹的权限,以免出现不必要的问题
2.开始配置hbase,进入 /home/hadoop/hbase/hbase-1.1.2/conf,并修改hbase-site.xml文件
cd /home/hadoop/hbase/hbase-1.1.2/conf
vi hbase-site.xml
修改后的hbase-site.xml内容为:
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://hadoop:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.master</name>
<value>hadoop:60000</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>172.16.43.10:2181,172.16.43.10:2182,172.16.43.10:2183</value>
</property>
<property>
<name>hbase.tmp.dir</name>
<value>/home/hadoop/hbase-tmp</value>
</property>
<property>
<name>hbase.master.info.port<
4000
;/name>
<value>60010</value>
</property>
</configuration> 注:1.hbase.rootdir 属性值设置时,请直接写主机名,我这里为 hadoop 对应的是 172.16.43.10
2.hbase.zookeeper.quorum 设置时,请根据Zookeeper的zoo.cfg配置文件的内容进行配置,这里需要制定端口号,如果直接写172.16.43.10,则Hbase只会去连接一个Zookeeper节点
3.需要配置hbase.master.info.port的值,否则在浏览器无法访问到Hbase管理界面,设置了后,直接访问 172.16.43.10:60010
3.修改hbase-ebv.sh
修改指定几个属性的内容为:
export JAVA_HOME=/home/hadoop/java/jdk1.7.0_75
export HBASE_CLASSPATH=/home/hadoop/hadoop-src/hadoop-2.5.1/etc/hadoop
export HBASE_MANAGES_ZK=false JAVA_HOME 为你安装的JAVA的目录
HBASE_CLASSPATH 为你安装的hadoop的配置文件的目录
HBASE_MANAGES_ZK 设置为false 或者不设置,使用外部Zookeeper
4.修改完毕后,先确保hadoop,Zookeeper启动正常后,启动Hbase
cd /home/hadoop/hbase/hbase-1.1.2/bin
./start-hbase.sh 注:如果出现错误,可以到logs文件夹底下进行相应的查看
5.简单验证是否启动成功,在bin目录下,进入hbase shell 客户端
./hbase shell 进入成功,则代表启动成功,或者直接在浏览器中访问 172.16.43.10:60010。
至此,Hbase部署完毕
相关文章推荐
- Linux socket 初步
- 从源码安装Mysql/Percona 5.5
- linux lsof详解
- linux 文件权限
- Linux 执行数学运算
- 10 篇对初学者和专家都有用的 Linux 命令教程
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- 详解HDFS Short Circuit Local Reads
- 运维入门
- 运维提升
- Linux 自检和 SystemTap
- Ubuntu Linux使用体验
- c语言实现hashmap(转载)
- Linux 信号signal处理机制
- linux下mysql添加用户
- Scientific Linux 5.5 图形安装教程
- Hadoop_2.1.0 MapReduce序列图