This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

placed code in more appropriate places

  • Loading branch information...
koaning committed Jul 7, 2015
1 parent f9af12c commit 0d617d44db6be26750f58259df22ddac89bc844b
Showing with 12 additions and 8 deletions.
  1. +3 −6 rstudio/init.sh
  2. +4 −0 setup-slave.sh
  3. +5 −2 templates/root/spark/conf/spark-env.sh
View
@@ -12,9 +12,6 @@ adduser rstudio
# otherwise this might be a security issue.
echo 'rstudio' | passwd --stdin rstudio
-sudo chmod a+w /mnt/spark
-sudo chmod a+w /mnt/spark2
-
# create a Rscript that connects to Spark, to help starting user
echo "cat('Now connecting to Spark for you.')
@@ -32,6 +29,6 @@ cat('Spark Context available as \"sc\". \\n')
cat('Spark SQL Context available as \"sqlContext\". \\n')
" > /home/rstudio/startSpark.R
-# this is to set the ulimit for root and rstudio user
-echo '* soft nofile 1000000' >> /etc/security/limits.conf
-echo '* hard nofile 1000000' >> /etc/security/limits.conf
+# make sure that the temp dirs can be written to by any user
+sudo chmod a+w /mnt/spark
+sudo chmod a+w /mnt/spark2
View
@@ -128,3 +128,7 @@ echo 'readlink -e "$@"' >> /usr/bin/realpath
chmod a+x /usr/bin/realpath
popd > /dev/null
+
+# this is to set the ulimit for root and other users
+echo '* soft nofile 1000000' >> /etc/security/limits.conf
+echo '* hard nofile 1000000' >> /etc/security/limits.conf
@@ -26,5 +26,8 @@ export SPARK_PUBLIC_DNS
# Used for YARN model
export YARN_CONF_DIR="/root/ephemeral-hdfs/conf"
-# Set a high ulimit for large shuffles
-ulimit -n 1000000
+# Set a high ulimit for large shuffles, only root can do this
+if [ $(id -u) == "0" ]
+then
+ ulimit -n 1000000
+fi

0 comments on commit 0d617d4

Please sign in to comment.