这里说复制虚拟机
hadoop单机安装 在这
:
开启远程免密登录配置
ssh-copy-id -i .ssh/id_rsa.pub -p22 root@192.168.106.101
远程登录
ssh -p 22 root@192.168.106.101
vi /hadoop/hdfs-site.xml
vi etc/hadoop/slaves :
hadoop04
hadoop05
hadoop06
在传到其他两个
格式化HDFS
hadoop namenode -format
启动hadoop
start-all.sh(jps查看进程)
安装ZooKeeper
修改zookeepr/conf/zoo.cfg)(修改完后改名)
配置里面的server是zookeeper服务器的主机名。
# The number of milliseconds of each tick
tickTime=2000
maxClientCnxns=0
# The number of ticks that the initial
# synchronization phase can take
initLimit=50
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
dataDir=/opt/hadoop/zookeeperdata
# the port at which the clients will connect
clientPort=2181
server.1=hadoop01:2888:3888
server.2=hadoop02:2888:3888
server.3=hadoop03:2888:3888
新建目录
在各新建/opt/hadoop/zookprdata/中配置的目录,并添加myid文件,里面内容是该节点对应的server号,如上例hadoop01对应的myid文件内容就是:
1
启动zookeeper
在各zookeeper节点上运行zkServer.sh start
cd /opt/zookeeper
./bin/zkServer.sh start
会有时区错误 附加Linux配置ntp时间服务器(全)
Hbase的安装
修改hbase/conf/hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://hadoop01:9000/hbase</value>
<description>The directory shared by region servers.</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>hadoop01,hadoop02,hadoop03</value>
</pro