在ubuntu16.04中由于环境变量设置有问题,导致系统不能登录:
发生问题的地方 :/etc/profile
ctrl+alt+F5(F1到F7切换)到shell下,login的时候输入用户名,
进去的时候有可能 有些命令失效,比如 ls, ll, 可以设置临时的环境变量解决:
export PATH=$PATH:/usr/bin
这样就可以用vim等
#set hbase
export HBASE_INSTALL=/opt/Hadoop/hbase-1.3.1
export PATH=.:$HBASE_INSTALL/bin 这个地方有问题
#set zookeeper classpath
export ZOOKEEPER_INSTALL=/opt/Hadoop/zookeeper-3.4.10
export PATH=.:$ZOOKEEPER_INSTALL/bin 这个地方有问题
#set java classpath
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
export JRE_HOME=$JAVA_HOME/jre
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
export CLASSPATH=$CLASSPATH:.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
# set hadoop classpath
export HADOOP_HOME=/home/hadoop/software/hadoop-2.7.4
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export JAVA_LIBRARY_PATH=$HADOOP_HOME/lib/native
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export YARN_CONF_DIR=$HADOOP_HOME/etc/hadoop
export HADOOP_PREFIX=$HADOOP_HOME
export CLASSPATH=$CLASSPATH:.:$HADOOP_HOME/bin
修改后的/etc/profile
#set hbase
export HBASE_INSTALL=/opt/Hadoop/hbase-1.3.1
export PATH=.:$HBASE_INSTALL/bin:$PATH 修改的地方
#set zookeeper classpath
export ZOOKEEPER_INSTALL=/opt/Hadoop/zookeeper-3.4.10
export PATH=.:$ZOOKEEPER_INSTALL/bin:$PATH 修改的地方
#set java classpath
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
export JRE_HOME=$JAVA_HOME/jre
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
export CLASSPATH=$CLASSPATH:.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
# set hadoop classpath
export HADOOP_HOME=/home/hadoop/software/hadoop-2.7.4
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export JAVA_LIBRARY_PATH=$HADOOP_HOME/lib/native
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export YARN_CONF_DIR=$HADOOP_HOME/etc/hadoop
export HADOOP_PREFIX=$HADOOP_HOME
export CLASSPATH=$CLASSPATH:.:$HADOOP_HOME/bin
转载于:https://www.cnblogs.com/herosoft/p/8134168.html