hive-site.xml
# vi hive-site.xmljavax.jdo.option.ConnectionURL jdbc:mysql://sd-9c1f-2eac:3306/hive?createDatabaseIfNotExist=true javax.jdo.option.ConnectionDriverName com.mysql.jdbc.Driver Driver class name for a JDBC metastore javax.jdo.option.ConnectionUserName hive username to use against metastore database javax.jdo.option.ConnectionPassword hive password to use against metastore database hive.hwi.listen.host 0.0.0.0 This is the host address the Hive Web Interface will listen on hive.hwi.listen.port 9999 This is the port the Hive Web Interface will listen on hive.hwi.war.file lib/hive-hwi-2.1.1.war This is the WAR file with the jsp content for Hive Web Interface hive.exec.local.scratchdir /home/hadoop/iotmp Local scratch space for Hive jobs hive.downloaded.resources.dir /home/hadoop/iotmp Temporary local directory for added resources in the remote file system. hive.server2.transport.mode binary hive.server2.thrift.http.port 10001 hive.server2.thrift.http.max.worker.threads 500 hive.server2.thrift.http.min.worker.threads 5 hive.server2.thrift.http.path cliservice hive.server2.thrift.min.worker.threads 5 hive.server2.thrift.max.worker.threads 500 hive.server2.thrift.port 10000 hive.server2.thrift.bind.host sd-9c1f-2eac hive.server2.authentication NONE
启动mysql
[Dev root @ sd-9c1f-2eac /usr/local/src/apache-hive-2.1.1-bin/conf]# service mysql startStarting MySQL...
启动hiveserver2
# hive --service metastore &# hive --service hiveserver2 &
hiveserver2 连接 mysql
[Dev root @ sd-9c1f-2eac /usr/local/src/apache-hive-2.1.1-bin]# $HIVE_HOME/bin/beeline -u jdbc:hive2://localhost:10000
which: no hbase in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/local/src/jdk1.8.0_112/bin:/usr/local/src/hadoop-2.7.3/bin:/usr/local/src/apache-hive-2.1.1-bin/bin:/home/pl62716/spark-2.1.0-bin-hadoop2.6/bin:/home/pl62716/apache-maven-3.3.9/bin://home/pl62716/sbt-launcher-packaging-0.13.13/bin:/root/bin)SLF4J: Class path contains multiple SLF4J bindings.SLF4J: Found binding in [jar:file:/usr/local/src/apache-hive-2.1.1-bin/lib/hive-jdbc-2.1.1-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]SLF4J: Found binding in [jar:file:/usr/local/src/apache-hive-2.1.1-bin/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]SLF4J: Found binding in [jar:file:/usr/local/src/hadoop-2.7.3/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]Connecting to jdbc:hive2://localhost:10000Connected to: Apache Hive (version 2.1.1)Driver: Hive JDBC (version 2.1.1)17/05/08 03:38:46 [main]: WARN jdbc.HiveConnection: Request to set autoCommit to false; Hive does not support autoCommit=false.Transaction isolation: TRANSACTION_REPEATABLE_READBeeline version 2.1.1 by Apache Hive0: jdbc:hive2://localhost:10000>