title: configure Apache Hive local multi users or in Spark standalone without Hadoop
body: <p>We run Apache Spark stand alone for teaching purposes on Fedora 27. I have it configured with MySQL for the metastore_db.</p>
  
  <p>I am trying to follow <a href="http://hadoop-pig-hive-thejas.blogspot.com/2013/04/running-hive-in-local-mode.html" rel="nofollow noreferrer">this tip running Hive in local mode</a>, so running the export command:
   <code>export  HIVE_OPTS='-hiveconf mapred.job.tracker=local -hiveconf fs.default.name=file:///tmp -hiveconf hive.metastore.warehouse.dir=file:///tmp/warehouse'</code> before starting <code>hive</code>. <a href="http://whatsbuzzingapachehive.blogspot.com/2016/01/how-to-install-and-run-apache-hive-in.html" rel="nofollow noreferrer">Another blog suggested</a> this command: </p>
  
  <pre><code>export HIVE_OPTS='-hiveconf mapred.job.tracker=local -hiveconf fs.default.name=file:///tmp -hiveconf hive.metastore.warehouse.dir=file:///tmp/warehouse -hiveconf javax.jdo.option.ConnectionURL=jdbc:derby:;databaseName=/tmp/metastore_db;create=true'
  </code></pre>
  
  <p>So I ran <code>chmod 777 /tmp/warehouse</code> but won't any subsequent users just rewrite over everything in this local file database? Is there a better way to achieve this? Whenever I try to use Hive within Spark or without any export of a local file database I get the <code>localhost:8020 failed on connection exception: java.net.ConnectException: Connection refused;</code> errors, i.e. the port that Hadoop runs on. We're trying to do this without Hadoop for teaching purposes. Should each user just specify a different path to either <code>warehouse</code> or <code>databaseName</code>, perhaps in their home directory?</p>