Summary of Hive built stepping pits under windows


Hive is a data warehouse tool based on Hadoop, which operates Hadoop data warehouse (HDFS, etc.) with a kind of SQL HQL statement. Therefore, Hadoop needs to be built before installing local windows. The previous article has roughly introduced the environment construction and pit stepping summary, so here is still only the basic installation method. Because there are many articles about hive installation on the Internet. Here is more about the summary and solutions of various pits encountered by Xiaobei in the installation process.

Environmental Science:

1. windows10

2. hadoop2.7.7

3. mysql-connector-java-5.1.7-bin.jar

4. hive2.1.1 , click download

Easy installation:

1. Hadoop is built locally. Skip.

2. Hive download and installation, environment variable configuration, skip.

3. Hive config configuration.

(1). Find the following four files under hive's conf and modify them as follows.

4. Create a directory.

(1). First, mysql-connector-java-5.1.7-bin Move the jar file to hive's lib, as shown below.

(2). Now create a my in the hive root directory_ Hive creates the following four directories.

5. Modify HIV Env sh

(1). Find HIV Env under conf SH and add the following configurations.

6. Modify hive site xml

(1). Find hive site under hive's conf xml.

(2). Modify the following options.

    <description>Local scratch space for Hive jobs</description>

    <description>Temporary local directory for added resources in the remote file system.</description>

      JDBC connect string for a JDBC metastore.
      To use SSL to encrypt/authenticate the connection, provide database-specific SSL flag in the connection URL.
      For example, jdbc:postgresql://myhost/db?ssl=true for postgres database.

    <description>Driver class name for a JDBC metastore</description>

    <description>Username to use against metastore database</description>

    <description>password to use against metastore database</description>

7. Create HDFS directory on Hadopp

(1). Create the following directory and grant 777 permissions.

(2). View on the hadoop console.

8. Create MySQL database

(1). Create hive database, which can be created by command or navicat.

create database if not exists hive default character set latin1;

9. Start Hive metastore

(1). After installation, you only need to start it once. After startup, the following tables will appear in Mysql hive database.

hive --service metastore

10. Start hive

(1). If the hive environment variable is configured, if not, enter the bin file in the hive directory and enter hive.

(2). The startup is successful and no error is reported. The example creates a table and enters the following HQL statement to create it.

create table stu(id int, name string)

(3). Enter the hadoop console to view it.

11. Several common commands of HQL

 start-up hive

show databases;
View all databases

use default;
Open the specified database

show tables;
Display all data tables according to the specified database

desc movie;
see movie Table structure

create movie(id int, name string);
Created a id and name Two field table

sign out hive

Collection of error reports

1. HiveConf of name hive.metastore.local does not exist

Remove < property > < name > hive.metastore.local </name> <value>true</value> </property>

2. Version information not found in metastore. hive.metastore.schema.verification is not enabled so recording the schema version 2.1.0

Add a record in the version of hive database as follows

3. applying authorization policy on hive configuration: Relative path in absolute URI: ${$ Beeline version 2.1.1 by Apache Hive

Open hive site XML, find hive exec. local. Scratchdir, remove all identifiers with system:, as follows

4. hadoop's web console file system, open a directory and report an error: Permission denied: user=dr.who, access=READ_EXECUTE, inode="/tmp/hive/Administrator":Administrator:supergroup:drwx------

Enter the hadoop command and enter hadoop fs -chmod 777 /tmp/hive


Default data warehouse default location: under: / user/hive/warehouse Path on hdfs

	<description>location of default database for the warehouse</description>

Communication learning

Keywords: Big Data Hadoop hive

Added by Ben Cleary on Mon, 21 Feb 2022 03:58:02 +0200