以下授权步骤可省略
[root@localhost ~]# whereis sudoers
[root@localhost ~]# ls -l /etc/sudoers
[root@localhost ~]# vi /etc/sudoers
## Allow root to run any commands anywher
root ALL=(ALL) ALL
hadoop ALL=(ALL) ALL #这个是新增的用户
[root@localhost ~]# chmod -v u-w /etc/sudoers
[root@localhost ~]# su hadoop
安装jdk1.8
[hadoop@localhost jdk1.8]# tar -zxvf jdk-8u171-linux-x64.tar.gz –C /bd
设置 Java 环境变量
[hadoop@localhost jdk1.8.0_171]# vi /etc/profile
在文件最后添加
export JAVA_HOME=/bd/jdk/jdk1.8
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
[root@localhost jdk1.8.0_171]# source /etc/profile
[root@localhost jdk1.8.0_171]# java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)