Start HiveServer2:
CD $HIVE _home/bin
HiveServer2 (default port is 10000) after default port: Hiveserver2 &
Start by specifying the port in the next mode: Hiveserver2--hiveconf hive.server2.thrift.port=14000 &
Connect HiveServer2 using beeline:
CD $HIVE _home/bin
Beeline-u jdbc:hive2://hadoop000:10000
Parameter description:
hadoop000: Is the name of the hive installation machine;
10000 is the hiveserver default port number;
If you need to specify the user name and password to access, use:-N username-p password.
How to query the port number used by HiveServer2: Ps-ef|grep HiveServer2
Ps-Ef|grep HiveServer2
Spark22195 9828 Ten One: .Pts/2 xx:xx: - /Usr/Java/Jdk1.7.0_ $/Bin/Java-xmx256m-Djava.net.preferIPv4Stack=True-Dhadoop.Log. Dir=/Home/Spark/App/Hadoop-2.3.0-Cdh5.0.0/Logs-Dhadoop.Log.file=Hadoop.Log -Dhadoop.home.dir=/Home/Spark/App/Hadoop-2.3.0-Cdh5.0.0 -Dhadoop.id.Str=Spark-Dhadoop.root.logger=Info,console-Djava.library.path=/Home/Spark/App/Hadoop-2.3.0-Cdh5.0.0/Lib/Native-Dhadoop.policy.file=Hadoop-Policy.xml-Djava.net.preferIPv4Stack=True-xmx512m-Dhadoop.security.logger=Info,nullappender Org.apache.hadoop.util.RunJar/Home/Spark/App/Hive-0.12.0-Cdh5.0.0/Lib/Hive-Service-0.12.0-Cdh5.0.0. Jar Org.apache.hive.service.server.HiveServer2--hiveconf hive.server2.thrift.port=14000
The use of the hive base HiveServer2 JDBC