By default, hive runs with embedded derby metastore, which allows only one connection. This article is about how to hive with derby network server. Assume hive is installed to /opt/hive folder
- Download derby https://db.apache.org/derby/derby_downloads.html to /opt/derby folder
- Start derby server nohup /opt/derby/bin/startNetworkServer &
- Edit /opt/hive/conf/hive-site.xml
123456789<property><name>javax.jdo.option.ConnectionURL</name><value>jdbc:derby://localhost:1527/metastore_db;create=true</value></property><property><name>javax.jdo.option.ConnectionDriverName</name><value>org.apache.derby.jdbc.ClientDriver</value><description>Driver class name for a JDBC metastore. EmbeddedDriver or ClientDriver</description></property> - Start derby
1nohup /opt/derby/bin/startNetworkServer & - Init metastore
1/opt/hive/bin/schematool -initSchema -dbType derby - Start hiveserver2 and beeline, should work both simultaneously
1nohup /opt/hive/bin/hiveserver2 &
and check in browser http://localhost:10002
1/opt/hive/bin/beeline -u jdbc:hive2://localhost:10000