I am setting certain environment variables for the command pyspark
to work. When I set the variables in /etc/environment
and source it, it doesn't work. However, when I set them in command line they do work but ofcourse only for this session. My intent is to set them globally so that even if I re-open the session I can just type pyspark
Setting in /etc/environment
[root@localhost ~]# more /etc/environment
[root@localhost ~]# echo "export SPARK_HOME=/srv/spark" >> /etc/environment
[root@localhost ~]# echo "export PATH="$SPARK_HOME"/bin:"$PATH >> /etc/environment
[root@localhost ~]# echo "export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk" >> /etc/environment
[root@localhost ~]# source /etc/environment
[root@localhost ~]# pyspark --version
-bash: pyspark: command not found
Setting on command line
[root@localhost ~]# export SPARK_HOME=/srv/spark
[root@localhost ~]# export PATH=$SPARK_HOME/bin:$PATH
[root@localhost ~]# export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk
[root@localhost ~]# pyspark --version
Welcome to
____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/___/ .__/\_,_/_/ /_/\_\ version 1.6.1
/_/
Type --help for more information.