# 上传解压安装包 cd /export/server/ tar zxvf apache-hive-3.1.2-bin.tar.gz mv apache-hive-3.1.2-bin hive # 解决hadoop、hive之间guava版本差异 cd /usr/local/hive rm -rf lib/guava-19.0.jar cp /usr/local/hadoop/share/hadoop/common/lib/guava-27.0-jre.jar ./lib/ # 添加mysql jdbc驱动到hive安装包lib/文件下 mysql-connector-java-5.1.40.jar # 修改hive环境变量文件 添加Hadoop_HOME cd /usr/local/hive/conf/ mv hive-env.sh.template hive-env.sh vim hive-env.sh export HADOOP_HOME=/usr/local/hadoop export HIVE_CONF_DIR=/usr/local/hive/conf export HIVE_AUX_JARS_PATH=/usr/local/hive/lib # 新增hive-site.xml 配置mysql等相关信息 vim hive-site.xml # 初始化metadata cd /usr/local/hive bin/schematool -initSchema -dbType mysql -verbos #初始化成功会在mysql中创建74装裱 #启动hive服务 bin/hive #------------------------Hive-site.xml------------------------------ javax.jdo.option.ConnectionURL jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true&useSSL=false& useUnicode=true&characterEncoding=UTF-8 hive.metastore.uris javax.jdo.option.ConnectionDriverName com.mysql.jdbc.Driver javax.jdo.option.ConnectionUserName hiveuser javax.jdo.option.ConnectionPassword 123456 hive.metastore.warehouse.dir /user/hive/warehouse location of default database for the warehouse hive.exec.scratchdir /tmp/hive hadoop.home.dir /usr/local/hadoop hive.server2.thrift.port 10000 hive.server2.thrift.bind.host localhost hive.execution.engine mr hive.server2.authentication NONE Client authentication types: NONE, KERBEROS, LDAP, PAM, CUSTOM hive.server2.enable.doAs false