Cloudera,Spark – spark-shell,Error:Caused by: ERROR XJ041: Failed to create database ‘/var/lib/hive/metastore/metastore_db’, see the next exception for details.

By | 2018年7月13日

在使用Spark的spark-shell的时候你可能会遇到如题所示的错误。
具体如下:

原因:
因为缺少Hive。

解决:
将Hive配置上去,在我的环境里,指定后端DB到Oracle即可:

然后再试一次:

然后,在YARN中,也可以看到信息:

后端DB中,Hive的样子:
class=”alignnone size-full wp-image-11859″ />
SQL> conn metastore/oracle
Connected.
SQL> select table_name from user_tables;

no rows selected

SQL>
SQL> /

TABLE_NAME
——————————
SEQUENCE_TABLE
NUCLEUS_TABLES
PART_COL_PRIVS
CDS
COLUMNS_V2
PARTITION_KEY_VALS
DBS
PARTITION_PARAMS
SERDES
TYPES
PARTITION_KEYS

TABLE_NAME
——————————
ROLES
PARTITIONS
INDEX_PARAMS
TBL_COL_PRIVS
IDXS
BUCKETING_COLS
TYPE_FIELDS
SD_PARAMS
GLOBAL_PRIVS
SDS
TABLE_PARAMS

TABLE_NAME
——————————
SORT_COLS
TBL_PRIVS
DATABASE_PARAMS
ROLE_MAP
SERDE_PARAMS
PART_PRIVS
DB_PRIVS
TBLS
PARTITION_EVENTS
SKEWED_STRING_LIST
SKEWED_STRING_LIST_VALUES

TABLE_NAME
——————————
SKEWED_COL_NAMES
SKEWED_COL_VALUE_LOC_MAP
MASTER_KEYS
DELEGATION_TOKENS
SKEWED_VALUES
TAB_COL_STATS
VERSION
PART_COL_STATS
FUNCS
FUNC_RU
NOTIFICATION_LOG

TABLE_NAME
——————————
NOTIFICATION_SEQUENCE
TXNS
TXN_COMPONENTS
COMPLETED_TXN_COMPONENTS
NEXT_TXN_ID
HIVE_LOCKS
NEXT_LOCK_ID
COMPACTION_QUEUE
NEXT_COMPACTION_QUEUE_ID
METASTORE_DB_PROPERTIES

54 rows selected.

SQL>

——————————
Done。

打赏

说点什么

avatar

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
提醒