cenos 安装hadoop
作者:互联网
1 创建hadoop用户
2 下载jdk和hadoop安装包
3 在root用户下解压jdk到/usr/java
4 配置JAVA_HOME
编辑/etc/profile,在文件最后添加
# set java environment
export JAVA_HOME=/usr/java/jdk1.8.0_191/
export JRE_HOME=/usr/java/jdk1.8.0_191/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
5 在hadoop用户下解压hadoop安装包到,/usr/hadoop/
6 配置hadoop
编辑 hadoop-env.sh文件,修改JAVA_HOME
export JAVA_HOME=/usr/java/jdk1.8.0_191/
编辑core-site.xml
<configuration> <property> <name>hadoop.tmp.dir</name> <value>/usr/hadoop/tmp</value> <description>A base for other temporary directories.</description> </property> <!-- file system properties --> <property> <name>fs.default.name</name> <value>hdfs://192.168.31.101:9000</value> </property> </configuration>
编辑hdfs-site.xml
<configuration> <property> <name>dfs.replication</name> <value>1</value> </property> </configuration>
编辑mapred-site.xml
<configuration> <property> <name>mapred.job.tracker</name> <value>http://192.168.31.101:9001</value> </property> </configuration>
7 格式化存储
hadoop namenode -format
8 启动hadoop
./sbin/start-all.sh
9关闭防火墙
systemctl stop firewall
标签:JAVA,cenos,java,hadoop,site,usr,HOME,安装 来源: https://www.cnblogs.com/Leechg/p/10588102.html