Centos7 hive stand-alone mode installation and configuration

Please be sure to indicate the original address for reprinting: http://dongkelun.com/2018/03/24/hiveConf/

Foreword:

Because it is only learning on its own virtual machine, hive is only the simplest configuration, and other complex configuration files are not configured.

1、 premise##

1.1 Installation and configuration jdk1.8

1.2 Install hadoop2.x

Hadoop stand-alone mode installation see: [centos7 hadoop stand-alone mode installation configuration] (http://dongkelun.com/2018/03/23/hadoopConf/)

1.3 Install mysql and configure myql to allow remote access. My mysql version is 5.7.18.

Please refer to the MySQL database installation process: Centos 7.2 Install Mysql 5.7.13

2、 Download hive

Download address: http://mirror.bit.edu.cn/apache/hive/, I downloaded apache-hive-2.3.2-bin.tar.gz.

wget http://mirror.bit.edu.cn/apache/hive/hive-2.3.2/apache-hive-2.3.2-bin.tar.gz
Or download to the local, upload to the virtual machine through the tool

3、 Unzip to the /opt directory (directory according to your own habits)

tar -zxvf apache-hive-2.3.2-bin.tar.gz  -C /opt/

<!- - more -->

4、 Configure hive environment variables##

vim /etc/profile
export HIVE_HOME=/opt/apache-hive-2.3.2-bin
export PATH=$PATH:$HIVE_HOME/bin  
source /etc/profile

5、 Configure hive

5.1 Configure hive-site.xml

Among them, ConnectionUserName and ConnectionPassword are the username and password of mysql remote access, and hive_metadata is the mysql database, which is named as you like.

cd /opt/apache-hive-2.3.2-bin/conf/
vim hive-site.xml 
<? xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet type="text/xsl" href="configuration.xsl"?><configuration><property><name>javax.jdo.option.ConnectionURL</name><value>jdbc:mysql://192.168.44.128:3306/hive_metadata?&amp;createDatabaseIfNotExist=true&amp;characterEncoding=UTF-8&amp;useSSL=false</value></property><property><name>javax.jdo.option.ConnectionUserName</name><value>root</value></property><property><name>javax.jdo.option.ConnectionPassword</name><value>Root-123456</value></property><property><name>javax.jdo.option.ConnectionDriverName</name><value>com.mysql.jdbc.Driver</value></property><property><name>datanucleus.schema.autoCreateAll</name><value>true</value></property><property><name>hive.metastore.schema.verification</name><value>false</value></property></configuration>

5.2 Configure hive-site.xml

cp hive-env.sh.template hive-env.sh
vim hive-env.sh
HADOOP_HOME=/opt/hadoop-2.7.5export HIVE_CONF_DIR=/opt/apache-hive-2.3.2-bin/conf

The specific location is as follows:

6、 Load mysql driver (must be consistent with the mysql version installed by yourself)

Download link: http://dev.mysql.com/downloads/connector/j/

What I downloaded is: mysql-connector-java-5.1.46.tar.gz, unzip and put the mysql-connector-java-5.1.46-bin.jar in hive/lib

The specific path is: /opt/apache-hive-2.3.2-bin/lib

7、 Initialize the database##

schematool -initSchema -dbType mysql

8、 Start hive

Start hadoop before starting hive, otherwise it will report Connection refused exception, check whether hadoop started successfully on the command line jps and then start hive

hive

Then simple test:

show databases;

If the following figure appears, it means the configuration is successful!

9、 Simple hive statement test##

Build a table:

CREATE TABLE IF NOT EXISTS test(id INT,name STRING)ROW FORMAT DELIMITED FIELDS TERMINATED BY " " LINES TERMINATED BY "\n";

Insert data

insert into test values(1,'Zhang San');

Inquire

select *from test;

Recommended Posts

Centos7 hive stand-alone mode installation and configuration
Centos mysql installation and configuration
Centos7 installation and configuration prometheus
CentOS 7 installation and configuration PPTP
CentOS installation and configuration cmake
Centos7.5 installation and configuration MongoDB4.0.4
CentOS 7 installation and configuration PPTP
Centos7 installation and configuration of Jenkins
Centos7 hadoop cluster installation and configuration
Java-JDK installation and configuration under CentOS
CentOS 7 Tomcat service installation and configuration
CentOS NTP server installation and configuration
Centos7 mysql database installation and configuration
CentOS 7 system installation and configuration graphic tutorial
Tomcat installation and configuration under CentOS 7 (Tomcat startup)
MySQL 8.0 installation, deployment and configuration under CentOS 6/7
Installation and configuration of redis under centos7
OpenMPI-Ubuntu installation and configuration
Mysql8.0.15 installation configuration (centos7)
Installation and configuration of JDK in CentOS 7 system
CentOS 6.5 system installation and configuration graphic tutorial (detailed graphic)
CentOS 7 installation and configuration graphic tutorials under VMware10
Installation and configuration of rsync server under CentOS 6.5
Installation and configuration of CentOS 7 in VMware Workstation
MySQL 8.0 installation, deployment and configuration tutorial on CentOS 8
Ubuntu16.04 installation and simple configuration
centos7 kvm installation and use
CentOS7 postgresql installation and use
CentOS 7 Redis 5.0.8 sentinel mode configuration
Ubuntu PostgreSQL installation and configuration
Centos7 elk7.1.1 installation and use
Detailed explanation of Spark installation and configuration tutorial under centOS7
CentOS 8 install Git and basic configuration
Centos6.5 installation and deployment of KVM
CentOS7 installation and maintenance of Gitlab
CentOS7.2 and Nginx configuration virtual host
CentOS 7.X system installation and optimization
Centos 7 RAID 5 detailed explanation and configuration
Ubuntu 19.1 installation and configuration Chinese environment
Configuration and beautification after Ubuntu installation (1)
Nginx installation and configuration load (ubuntu12.04)
CentOs7 installation and deployment Zabbix3.4 original
Erlang 20.2 installation and deployment under CentOS 7
Ubuntu configuration source and installation software
2019-07-09 CentOS7 installation
centos7_1708 installation
Installation and use of Mysql under CentOS
Centos7.5 configuration java environment installation tomcat explanation
Centos-6.5 installation and deployment of LNMP environment
Linux kernel compilation and CentOS system installation
Centos7.6 operating system installation and optimization record
Centos7 installation and deployment of gitlab server
Centos python3 compile installation and compile gcc upgrade
Zabbix installation and deployment and localization under CentOS
CentOS7 installation zabbix 4.0 tutorial (graphics and text)
Jenkins installation and deployment tutorial under CentOS 7
KVM installation and preliminary use under CentOS 7.2
DLNA/UPnP Server installation and configuration under Ubuntu 12.04
Centos7 installation and deployment of Airflow detailed
Centos7 configuration host name and IP address
Centos5 installation guide