安装步骤 略( 可以看我的 虚拟机安装 centos7 文章)
2.配置免秘钥访问略(可以看我的免秘钥配置文章)
3.JKD 安装1.8略
4.Hadoop官网下载3.1.2网址 http://hadoop.apache.org/ https://archive.apache.org/dist/hadoop/common/hadoop-3.1.2/5.解压
tar -zxvf hadoop-3.1.2.tar.gz mv hadoop-3.1.2 /opt/test/ cd /opt/test/hadoop-3.1.2/etc/hadoop/6.修改环境变量
vi hadoop-env.sh
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_111 export HDFS_NAMENODE_USER=root export HDFS_DATANODE_USER=root export HDFS_ZKFC_USER=root export HDFS_JOURNALNODE_USER=root export YARN_RESOURCEMANAGER_USER=root export YARN_NODEMANAGER_USER=root7.修改配置文件
vi core-site.xml
fs.defaultFS hdfs://hdfs-test hadoop.tmp.dir /var/test/hadoop/ha hadoop.http.staticuser.user root ha.zookeeper.quorum 10.1.1.201:2181,10.1.1.158:2181,10.1.1.185:2181
vi hdfs-site.xml
dfs.nameservices hdfs-test dfs.ha.namenodes.hdfs-test nn1,nn2 dfs.namenode.rpc-address.hdfs-test.nn1 10.1.1.58:8020 dfs.namenode.rpc-address.hdfs-test.nn2 10.1.1.152:8020 dfs.namenode.http-address.hdfs-test.nn1 10.1.1.58:9870 dfs.namenode.http-address.hdfs-test.nn2 10.1.1.152:9870 dfs.namenode.shared.edits.dir qjournal://10.1.1.58:8485;10.1.1.152:8485;10.1.1.195:8485/hdfs-test dfs.journalnode.edits.dir /var/test/hadoop/ha/qjm dfs.client.failover.proxy.provider.hdfs-test org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxy Provider dfs.ha.fencing.methods sshfence shell(true) dfs.ha.fencing.ssh.private-key-files /root/.ssh/id_rsa dfs.ha.automatic-failover.enabled true dfs.replication 2
-vi workers
10.1.1.58 10.1.1.152 10.1.1.1958.分发
scp -r hadoop-3.1.2 root@10.1.1.152:/opt/test scp -r hadoop-3.1.2 root@10.1.1.195:/opt/test9.修改环境变量
vi /etc/profile
export HADOOP_HOME=/opt/test/hadoop-3.1.2 export PATH=$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH
分发
scp /etc/profile root@10.1.1.152:/etc/profile
scp /etc/profile root@10.1.1.195:/etc/profile
source /etc/profile
10.首先启动Zookeeper三节点都启动
[root@node01 ]#zkServer.sh start [root@node02 ]#zkServer.sh start [root@node03 ]#zkServer.sh start zkServer.sh status11.启动JournalNode
三节点都启动
[root@node01 ]# hdfs --daemon start journalnode [root@node02 ]# hdfs --daemon start journalnode [root@node03 ]# hdfs --daemon start journalnode12.格式化NameNode
[root@node01 ]# hdfs namenode -format [root@node01 ]# hdfs --daemon start namenode [root@node02 ]# hdfs namenode -bootstrapStandby [root@node01 ]# hdfs zkfc -formatZK [root@node01 ]# start-dfs.sh13.测试
http://10.1.1.58:9870 http://10.1.1.152:9870
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)