分析:
1.配置好IP
2.修改好主机名
3.配置好IP映射
4.关闭防火墙
5.SSH免密登入
6.Java安装
7.Hadoop安装(伪分布式就可)
8.使用HadoopHDFS搭建Hbase数据库
软件提取链接:https://pan.baidu.com/s/1oxBcv6xRavVtxmBPzEWHuQ 提取码:1000
[root@localhost ~]#vim /etc/sysconfig/network-scripts/ifcfg-ens33
#修改
ONBOOT=yes
BOOTPROTO=static
#添加,网关以当前实际网关为主
IPADDR=192.168.15.100
NETMASK=255.255.255.0
GATEWAY=192.168.15.2
DNS1=114.114.114.114
DNS2=192.168.15.2
如果使用ifconfig命令能看到inet显示为192.168.17.100即IP配置成功。此处我使用的IP为104请以实际配置为主。
[root@localhost ~] # vim /etc/sysconfig/network
#删除原有内容,添加如下字段
HOSTNAME=hadoop
[root@localhost ~] #hostname hadoop
[root@localhost ~] #exit
[root@hadoop ~] # vim /etc/hosts
#添加一行
192.168.15.100 hadoop
[root@hadoop ~] #systemctl stop firewalld.service
[root@hadoop ~] #systemctl disable firewalld.service
https://blog.csdn.net/qq_50835159/article/details/117632199?spm=1001.2014.3001.5501
[root@hadoop ~]#cd .ssh
如果显示没有就执行 mkdir .ssh再执行cd .ssh
[root@hadoop .ssh] #ssh-keygen -t rsa
三下回车
[root@hadoop .ssh] #ssh-copy-id hadoop
输入yes,然后输入密码就完成了免密登入
(Hadoop软件安装包统一发/opt/software)
[root@hadoop software]#tar -zxvf hadoop-2.7.2.tar.gz -C /usr/local/
[root@hadoop software]#cd /usr/local/hadoop-2.7.2
[root@hadoop hadoop-2.7.2]#cd etc/hadoop
配置全局变量
[root@hadoop hadoop]#vim /etc/profile
#将hadoop载入全局变量
export HADOOP_HOME=/usr/local/hadoop-2.7.2
export PATH=$HADOOP_HOME/bin:$PATH
export PATH=$HADOOP_HOME/sbin:$PATH
[root@hadoop hadoop]#source /etc/profile
配置hadoop-env.sh
[root@hadoop hadoop]#vim hadoop-env.sh
#修改JAVA_HOME,引入JAVA变量
export JAVA_HOME=/usr/local/jdk1.8.0_144
配置core-site.xml
[root@hadoop hadoop]#vim core-site.xml
fs.defaultFS
hdfs://hadoop:9000
hadoop.tmp.dir
/usr/local/hadoop-2.7.2/data/tmp
配置hdfs-site.xml
[root@hadoop hadoop]#vim hdfs-site.xml
dfs.replication
1
dfs.namenode.name.dir
/usr/local/hadoop-2.7.2/data/tmp/dfs/name
dfs.datanode.data.dir
/usr/local/hadoop-2.7.2/data/tmp/dfs/data
配置yarn-env.sh
[root@hadoop hadoop]#vim yarn-env.sh
#修改JAVA_HOME,引入JAVA变量
export JAVA_HOME=/usr/local/jdk1.8.0_144
配置yarn-site.xml
[root@hadoop hadoop]#vim yarn-site.xml
yarn.nodemanager.aux-services
mapreduce_shuffle
yarn.resourcemanager.hostname
hadoop
配置mapred-env.sh
[root@hadoop hadoop]#vim mapred-env.sh
#修改JAVA_HOME,引入JAVA变量
export JAVA_HOME=/usr/local/jdk1.8.0_144
配置mapred-site.xml
[root@hadoop hadoop]#cp mapred-site.xml.template mapred-site.xml
[root@hadoop hadoop]#vim mapred-site.xml
mapreduce.framework.name
yarn
格式化Hadoop
[root@hadoop hadoop]#cd /usr/local/hadoop-2.7.2
[root@hadoop hadoop-2.7.2]#hadoop namenode -format
启动Hadoop-dfs、Hadoop-yarn
[root@hadoop hadoop-2.7.2]#start-all.sh
启动resourcemanager
[root@hadoop hadoop-2.7.2]#yarn-daemon.sh start resourcemanager
[root@hadoop hadoop-2.7.2]#jps
13586 NameNode
13668 DataNode
13786 Jps
14687 SecondaryNameNode
14267 ResourceManager
13514 NodeManager
关闭集群
[root@hadoop hadoop-2.7.2]# sbin/stop-all.sh
(解压安装Hbase)
[root@ hadoop software]# tar -zxvf hbase-1.3.6-bin.tar.gz -C /usr/local
配置Hbase全局环境变量
[root@hadoop software]#vim /etc/profile
#将Hbase载入全局变量
export HBASE_HOME=/usr/local/hbase-1.3.6
export PATH=$HBASE_HOME/bin:$PATH
[root@hadoop software]#source /etc/profile
配置hbase-env.sh
[root@ hadoop software]# cd /usr/local/hbase-1.3.6/conf/
[root@ hadoop conf]#vim hbase-env.sh
#指定java路径
export JAVA_HOME=/usr/local/jdk1.8.0_144
配置hbase-site.sh
[root@ hadoop conf]#vim hbase-site.sh
hbase.rootdir
hdfs://hadoop:9000/hbase
hbase.cluster.distributed
true
hbase.zookeeper.property.dataDir
/usr/local/hbase-1.3.6/zookeeper/data/zkdata
启动Hbase
[root@ hadoop conf]#cd ../bin
[root@ hadoop bin]#./start-hbase.sh