集群环境下配置hadoop1.0,zookeeper,hbase
来源:互联网 发布:mac android 真机调试 编辑:程序博客网 时间:2024/05/19 19:32
192.168.56.101
192.168.56.102
分别修改两台机器的/etc/hosts文件,增加如下内容:
192.168.56.101 master
192.168.56.102 slave
我们以master作为namenode服务器,slave为datenode服务器,首先安装jdk并配置环境变量和ssh(安装过程省略,请参考
网上资料)
2.安装hadoop,修改如下配置文件:
两台机器的hadoop安装路径要相同,切记,切忌!!!
1)修改core-site.xml为:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://master:9000</value>
</property>
</configuration>
2)修改hdfs-site.xml为:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.support.append</name>
<value>true</value>
</property>
<property>
<name>dfs.datanode.max.xcievers</name>
<value>4096</value>
</property>
</configuration>
3)修改mapred-site.xml为:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>master:9001</value>
</property>
</configuration>
4)修改masters为:
master
5)修改slaves为:
slave
6)格式化hadoop文件系统:
hadoop namenode -format
7)启动hadoop:
start-all.sh
3.安装zookeeper,修改配置文件:
两台机器的zookeeper安装路径要相同,切记,切忌!!!
1)cp zoo_sample.cfg zoo.cfg
2)修改zoo.cfg为:
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
#...
#...
#...
server.1=master:2888:3888
server.2=slave:2888:3888
3)在master的/tmp/zookeeper路径下增加myid文件,内容为:1
4)在master的/tmp/zookeeper路径下增加myid文件,内容为:2
补充说明:如果要单独使用zookeeper集群服务器,则使用zkServer.sh start命令分别启动每个zookeeper节点
4.安装hbase,修改配置文件
1)修改:hbase_env.sh的两个属性:
# The java implementation to use. Java 1.6 required.
export JAVA_HOME=/opt/java
# Tell HBase whether it should manage it's own instance of Zookeeper or not.
export HBASE_MANAGES_ZK=true
2)在两台机器上的hadoop文件系统中创建hbase目录:
hadoop fs -mkdir /hbase
3)修改master上的hbase-site.xml文件:
<configuration>
<property>
<name>dfs.support.append</name>
<value>true</value>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://master:9000/hbase</value>
<description>The directory shared by RegionServers.
</description>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
<description>The replication count for HLog and HFile storage. Should not be greater than HDFS datanode count.
</description>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.master.port</name>
<value>60000</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>master,slave</value>
</property>
</configuration>
4)修改slave上的hbase-site.xml文件:
<configuration>
<property>
<name>dfs.support.append</name>
<value>true</value>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://master:9000/hbase</value>
<description>The directory shared by RegionServers.
</description>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
<description>The replication count for HLog and HFile storage. Should not be greater than HDFS datanode count.
</description>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.master.port</name>
<value>60000</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>master,slave</value>
</property>
</configuration>
5)修改regionservers文件为:
master
slave
6)启动hbase并测试:
start-hbase.sh
hbase shell
list
哈哈,完毕!
- 集群环境下配置hadoop1.0,zookeeper,hbase
- hadoop1.2.1+zookeeper-3.4.5+hbase-0.94.1集群安装
- hadoop1.0.4+zookeeper-3.4.5+hbase-0.94.1集群安装
- hadoop1.2.1+zookeeper-3.4.5+hbase-0.94.1集群安装
- Hadoop+ZooKeeper+HBase集群配置
- Zookeeper集群环境配置
- Zookeeper集群环境配置
- 分布式集群环境hadoop1.2.0、hbase0.94.4、zookeeper、elasticsearch搭建
- HBase集群配置之Zookeeper安装配置
- Hadoop 、Hbase、zookeeper 集群环境搭建
- Hadoop+HBase+ZooKeeper分布式集群环境搭建
- Hadoop+Hbase+Zookeeper集群环境搭建
- hadoop、zookeeper、hbase、spark集群环境搭建
- hadoop、zookeeper、hbase、spark集群环境搭建
- Hadoop+HBase+ZooKeeper分布式集群环境搭建
- hadoop、zookeeper、hbase、spark集群环境搭建
- 基于hadoop1.0集群环境搭建
- hadoop1集群环境搭建
- JAVA中数字、日期、字符串的格式化输出
- 图论之最短路径-------Dijkstra算法
- 流体力学学习笔记1(Two-way of coupling of fluids to rigid and deformable solids and shells)
- 实模式、保护模式、长模式
- UC的定义初析
- 集群环境下配置hadoop1.0,zookeeper,hbase
- 继承ViewGroup的自定义类
- #define 定义函数简单例子
- 搜索中的剪枝技术
- 实模式->保护模式->实模式 的切换步骤
- 解析JSONArray
- 字符串全排列
- 图论之最小生成树-----克鲁斯卡尔(Kruskal)算法
- MinGW编译错误“错误:converting to execution character set:Illegal byte sequence”的解决方案