mysql -u root -p mysql> create database hive; mysql> CREATE USER hive@localhost IDENTIFIED BY 'hive'; mysql> GRANT ALL PRIVILEGES ON *.* TO hive@localhost WITH GRANT OPTION; mysql> FLUSH PRIVILEGES;
<configuration> <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value> <description>JDBC connect string for a JDBC metastore</description> </property> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.cj.jdbc.Driver</value> <description>Driver class name for a JDBC metastore</description> </property> <property> <name>javax.jdo.option.ConnectionUserName</name> <value>hive</value> <description>username to use against metastore database</description> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>hive</value> <description>password to use against metastore database</description> </property> <property> <name>hive.server2.thrift.client.user</name> <value>herman</value> <description>Username to use against thrift client</description> </property> <property> <name>hive.server2.thrift.client.password</name> <value>[password]</value> <description>Password to use against thrift client</description> </property> <property> <name>hive.server2.enable.doAs</name> <value>false</value> <description>Setting this property to true will have HiveServer2 execute Hive operations as the user making the calls to it.</description> </property> <property> <name>hive.metastore.uris</name> <value>thrift://localhost:9083</value> </property> <property> <name>hive.metastore.event.db.notification.api.auth</name> <value>false</value> </property> </configuration>
stop(){ if status &>/dev/null then status | awk '{print $2}' | xargs kill -9 echo "HiveMetaStore & HiveServer2 stopped!" else echo "HiveMetaStore & HiveServer2 not found!" fi }
restart(){ stop && start }
case $1 in status) status ;; start) start;; stop) stop;; restart) restart;; *) echo "Usage: $0 <start|stop|status|restart>";; esac