hbase单点:
1、在regionserver集群上,通过如下命令启动master:./hbase-daemon.sh start master(可以在多个regionserver集群上启动master,主master进程死掉后会重新选举一个新的master)
hadoop单点:
1、修改core-site.xml配置文件,参考如下:
<property>
<name>hadoop.tmp.dir</name>
<value>/ysh/hadoop/tmp</value>
</property>
<property>
<name>fs.trash.interval</name>
<value>1440</value>
</property>
<property>
<name>io.compression.codecs</name>
<value>com.hadoop.compression.lzo.LzoCodec,com.hadoop.compression.lzo.LzopCodec</value>
</property>
<property>
<name>io.compression.codec.lzo.class</name>
<value>com.hadoop.compression.lzo.LzoCodec</value>
</property>
<property>
<name>fs.defaultFS</name>
<value>hdfs://mycluster</value>
</property>
<property>
<name>ha.zookeeper.quorum</name>
<value>192.168.22.134:2181</value>
</property>
2、修改hdfs-site.xml配置文件,参考如下:
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/ysh/hadoop/dfs/name</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/ysh/hadoop/dfs/data</value>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.support.append</name>
<value>false</value>
</property>
<property>
<name>dfs.permissions</name>
<value>false</value>
</property>
<property>
<name>dfs.datanode.max.xcievers</name>
<value>5000</value>
</property>
<property>
<name>dfs.nameservices</name>
<value>mycluster</value>
</property>
<property>
<name>dfs.ha.namenodes.mycluster</name>
<value>nn1,nn2</value>
</property>
<property>
<name>dfs.namenode.rpc-address.mycluster.nn1</name>
<value>redhat-1:8020</value>
</property>
<property>
<name>dfs.namenode.rpc-address.mycluster.nn2</name>
<value>redhat-2:8020</value>
</property>
<property>
<name>dfs.namenode.http-address.mycluster.nn1</name>
<value>redhat-1:50070</value>
</property>
<property>
<name>dfs.namenode.http-address.mycluster.nn2</name>
<value>redhat-2:50070</value>
</property>
<property>
<name>dfs.namenode.shared.edits.dir</name>
<value>qjournal://redhat-1:8485;redhat-2:8485;redhat-3:8485/mycluster</value>
</property>
<property>
<name>dfs.journalnode.edits.dir</name>
<value>/ysh/hadoop/dfs/journal</value>
</property>
<property>
<name>dfs.client.failover.proxy.provider.mycluster</name>
<value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
</property>
<property>
<name>dfs.ha.automatic-failover.enabled</name>
<value>true</value>
</property>
<property>
<name>dfs.ha.fencing.methods</name>
<value>shell(/bin/true)</value>
</property>
其他配置文件和单namenode配置一样
3、修改完,启动zookeeper,到hadoop的bin目录下执行命令:./hdfs zkfc -formatZK
4、再启动journalnode,到hadoop的sbin目录下,命令如下:./hadoop-daemons.sh start journalnode
5、初始化其中一个namenode,命令如下:./hadoop namenode -format
6、同步2台namenode的name目录,用scp命令
7、启动hadoop集群,命令如下:./start-all.sh
8、hadoop配置ha模式,hbase的 hbase-site.xml的hbase.rootdir作如下修改:
参考:
<property>
<name>hbase.rootdir</name>
<value>hdfs://mycluster/hbase</value>
</property>