Hive安装配置

news/2024/4/17 7:08:17

1 在conf目录下vim 创建hive-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration><property><name>javax.jdo.option.ConnectionURL</name><value>jdbc:mysql://bigdata1:3306/metastore?useSSL=false</value></property><property><name>javax.jdo.option.ConnectionDriverName</name><value>com.mysql.jdbc.Driver</value></property><property><name>javax.jdo.option.ConnectionUserName</name><value>root</value></property><property><name>javax.jdo.option.ConnectionPassword</name><value>123456</value></property><property><name>hive.metastore.warehouse.dir</name><value>/user/hive/warehouse</value></property><property><name>hive.server2.thrift.port</name><value>10000</value></property><property><name>hive.server2.thrift.bind.host</name><value>bigdata1</value></property><property><name>hive.metastore.uris</name><value>thrift://bigdata1:9083</value></property><property><name>hive.metastore.event.db.notification.api.auth</name><value>false</value></property><property><name>hive.metastore.schema.verification</name><value>false</value></property><property><name>hive.server2.active.passive.ha.enable</name><value>true</value></property>
</configuration>

2 配置hive-log4j2.propertieslate

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.status = INFO
name = HiveLog4j2
packages = org.apache.hadoop.hive.ql.log# list of properties
property.hive.log.level = INFO
property.hive.root.logger = DRFA
#property.hive.log.dir = ${sys:java.io.tmpdir}/${sys:user.name}
property.hive.log.dir = /opt/module/hive-3.1.2/logs
property.hive.log.file = hive.log
property.hive.perflogger.log.level = INFO# list of all appenders
appenders = console, DRFA# console appender
appender.console.type = Console
appender.console.name = console
appender.console.target = SYSTEM_ERR
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{ISO8601} %5p [%t] %c{2}: %m%n# daily rolling file appender
appender.DRFA.type = RollingRandomAccessFile
appender.DRFA.name = DRFA
appender.DRFA.fileName = ${sys:hive.log.dir}/${sys:hive.log.file}
# Use %pid in the filePattern to append <process-id>@<host-name> to the filename if you want separate log files for different CLI session
appender.DRFA.filePattern = ${sys:hive.log.dir}/${sys:hive.log.file}.%d{yyyy-MM-dd}
appender.DRFA.layout.type = PatternLayout
appender.DRFA.layout.pattern = %d{ISO8601} %5p [%t] %c{2}: %m%n
appender.DRFA.policies.type = Policies
appender.DRFA.policies.time.type = TimeBasedTriggeringPolicy
appender.DRFA.policies.time.interval = 1
appender.DRFA.policies.time.modulate = true
appender.DRFA.strategy.type = DefaultRolloverStrategy
appender.DRFA.strategy.max = 30# list of all loggers
loggers = NIOServerCnxn, ClientCnxnSocketNIO, DataNucleus, Datastore, JPOX, PerfLogger, AmazonAws, ApacheHttplogger.NIOServerCnxn.name = org.apache.zookeeper.server.NIOServerCnxn
logger.NIOServerCnxn.level = WARNlogger.ClientCnxnSocketNIO.name = org.apache.zookeeper.ClientCnxnSocketNIO
logger.ClientCnxnSocketNIO.level = WARNlogger.DataNucleus.name = DataNucleus
logger.DataNucleus.level = ERRORlogger.Datastore.name = Datastore
logger.Datastore.level = ERRORlogger.JPOX.name = JPOX
logger.JPOX.level = ERRORlogger.AmazonAws.name=com.amazonaws
logger.AmazonAws.level = INFOlogger.ApacheHttp.name=org.apache.http
logger.ApacheHttp.level = INFOlogger.PerfLogger.name = org.apache.hadoop.hive.ql.log.PerfLogger
logger.PerfLogger.level = ${sys:hive.perflogger.log.level}# root logger
rootLogger.level = ${sys:hive.log.level}
rootLogger.appenderRefs = root
rootLogger.appenderRef.root.ref = ${sys:hive.root.logger}

3 删除 guava-19.0.jar并将hadoop中的这个jar移动过来

rm -rf guava-19.0.jarcp /opt/module/hadoop-3.1.3/share/hadoop/common/lib/guava-27.0-jre.jar /opt/module/apache-hive-3.1.2-bin/lib/

4 将mysql-connector-java-5.1.37.jar 移动到lib目录下

 cp /opt/software/mysql-connector-java-5.1.37.jar /opt/module/apache-hive-3.1.2-bin/lib/

5 通过schematool相关命令执行初始化

 schematool -dbType mysql -initSchema -verbose


https://www.xjx100.cn/news/3365996.html

相关文章

Qt5.15以上版本在线安装步骤,可选择更多早期版本

以ubuntu系统为例&#xff1a; 1、先去下载在线安装程序&#xff1a; https://download.qt.io/official_releases/online_installers/ 选择合适的版本&#xff0c;这里是在x64机器的ubuntu虚拟机里安装QT&#xff0c;所以选择如下版本&#xff1a; 或者直接在终端执行如下命令…

FPGA的串口的收发程序设计

module uart_tx(input clk,input rst,input start,input [7:0] data,output reg tx_done,output reg tx_out );// 定义状态机的状态typedef enum logic [2:0] {IDLE, START, DATA, STOP} state_t;reg [10:0] count; // 用于计数发送的位数reg [2:0] state; // 用于记录…

C++初学者:像C#一样写代码,示例程序 RViewer

今天用自己写的窗口类&#xff0c;做了一个程序&#xff0c;用于控制远程电脑 &#xff0c;方便自己的工作。 学习编程的目的&#xff0c;就是为了写程序&#xff0c;做出自己软件。于是&#xff0c;我首先要做的事情是编写一个软件&#xff0c;实现了以下几个功能&#xff1a…

【解决问题】排查linux手动删除文件,但是文件标记为deleted,资源未释放

背景&#xff1a; 生产环境我们把程序生成的数据文件手动删除后&#xff0c;但是空间并没有释放&#xff0c;导致硬盘被占用&#xff0c;不够用 问题排查&#xff1a; 1.查看占用文件状态 使用命令&#xff1a; lsof | grep deleted 查看 文件已经删除了&#xff0c;但是都是…

sqlserver ‘INSTR‘ 不是可以识别的 内置函数名称。

在SQL Server中&#xff0c;INSTR 函数对应的功能通常可以使用 CHARINDEX 函数来实现。CHARINDEX 函数用于在字符串中查找子串&#xff0c;并返回子串的起始位置&#xff08;如果找不到&#xff0c;返回0&#xff09;。 解决方法&#xff1a; 将SQL查询中的 INSTR 函数替换为…

鸿蒙实战开发-如何使用Stage模型卡片

介绍 本示例展示了Stage模型卡片提供方的创建与使用。 用到了卡片扩展模块接口&#xff0c;ohos.app.form.FormExtensionAbility 。 卡片信息和状态等相关类型和枚举接口&#xff0c;ohos.app.form.formInfo 。 卡片提供方相关接口的能力接口&#xff0c;ohos.app.form.for…

客户心声 | 匠心铸就辉煌,璞华科技SRM事业部获客户点赞!

时光荏苒&#xff0c;转眼间已是2024年的春天。在这个充满生机与希望的季节里&#xff0c;璞华科技SRM事业部收到了一封来自中建三局的表扬信&#xff0c;而这封信所承载的赞誉&#xff0c;却源自2023年4月那段共同奋斗的日子。 每一封来信&#xff0c;都是对璞华最高的认可与激…

python之while循环

while 循环是一种前测试循环结构&#xff0c;意味着在每次循环开始时先检查条件是否为真&#xff0c;如果为真&#xff0c;则执行循环体中的代码&#xff0c;然后再次检查条件。只有当条件为假时&#xff0c;循环才会终止。 通过结合实际问题和 while 循环&#xff0c;我们可以…