使用MySQL作为Hive的Metastore
先确保你已经成功安装了HIVE和MYSQL在hive-site.xml中添加如下内容,指定METASTORE的地址以及连接方式lt;propertygt; lt;
先确保你已经成功安装了HIVE和MYSQL
在hive-site.xml中添加如下内容,指定METASTORE的地址以及连接方式
然后登陆到HIVE客户端,创建一个表试试
[gpadmin1@Hadoop5 hive-0.6.0]$ bin/hive
Hive history file=/tmp/gpadmin1/hive_job_log_gpadmin1_201106081130_1156785421.txt
hive> show tables;
FAILED: Error in metadata: javax.jdo.JDOFatalDataStoreException: Unknown database 'hive'
NestedThrowables:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'hive'
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
报错了,提示很明显,识别不到名称为hive的database,,难道要自己创建?试试
[Intranet root@ /var/lib/mysql]
#mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 41
Server version: 5.5.12 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
mysql> create database hive;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| hive |
| mysql |
| performance_schema |
| test |
+--------------------+
5 rows in set (0.00 sec)
再登陆到HIVE里看看
[gpadmin1@hadoop5 hive-0.6.0]$ bin/hive
Hive history file=/tmp/gpadmin1/hive_job_log_gpadmin1_201106081130_544334815.txt
hive> show table;
FAILED: Parse Error: line 0:-1 mismatched input '
hive> show tables;
OK
Time taken: 5.173 seconds
hive> CREATE TABLE u_tmp1 (id1 INT,
> id2 int
> )
> ROW FORMAT DELIMITED
> FIELDS TERMINATED BY ',';
OK
Time taken: 0.266 seconds
hive> show tables;
OK
u_tmp1
Time taken: 0.197 seconds
hive>
OK了,果然是这个问题
上一篇: Nginx的http配置结构体的组织结构
推荐阅读
-
查询当前使用的默认的存储引擎_MySQL
-
sysbench的安装与使用_MySQL
-
在服务器上安装使用MySQL的注意事项_MySQL
-
hive中实现类似MySQL中的group_concat功能
-
Mysql中Count函数的正确使用
-
Django2.2使用mysql数据库pymysql版本不匹配问题的解决过程与总结
-
django的使用INNODE的方式,排除错误MySQL Strict Mode is not set for database connection 'default'
-
MySQL数据库的基本使用和管理
-
Linux(CentOS7)使用 RPM 安装 mysql 8.0.11的教程
-
Zabbix 2.4.5自带MySQL监控的配置使用教程