Hive2.3.3+Hadoop3.1.0创建表失败:元数据缺失及SLF4J绑定冲突
Fixing Hive Startup & Table Creation Errors with Hive 2.3.3 + Hadoop 3.1.0
Hey there, let's tackle the issues you're hitting one by one. I've dealt with these exact problems before, so here's how to fix each error step by step:
1. Fix the readlink: illegal option -- f Error
This pops up because macOS uses BSD-style readlink which doesn't support the -f flag, but Hive's startup scripts expect the GNU version of readlink. Here's the fix:
- Install GNU coreutils via Homebrew (if you don't have Homebrew, set it up first):
brew install coreutils - Locate your Hive installation's
hivescript (usually in$HIVE_HOME/bin), open it in a text editor, and replace every instance ofreadlink -fwithgreadlink -f(GNU readlink is namedgreadlinkon macOS).
2. Resolve SLF4J Multiple Bindings Warning
The SLF4J warning happens because both Hive and Hadoop include their own SLF4J implementation JARs, causing a conflict. To fix this:
- Navigate to your Hadoop installation's
share/hadoop/common/libdirectory. - Find the JAR file named something like
slf4j-log4j12-*.jar(the version number might vary) and either rename it (e.g., toslf4j-log4j12-*.jar.bak) or move it to a backup folder. This removes the conflicting binding from Hadoop's classpath, letting Hive's preferred implementation take over.
3. Fix MetaException: Version information not found in metastore
This is the critical issue stopping you from creating tables—it means your Hive metastore hasn't been initialized yet. Here's how to fix it:
- First, make sure your Hadoop cluster is up and running. Start HDFS and YARN with these commands:
start-dfs.sh start-yarn.sh - Initialize the metastore using Hive's schematool. Since you're using the default Derby database, run:
(If you're using a different database like MySQL for the metastore, replaceschematool -dbType derby -initSchemaderbywith your database type and ensure you've configured the JDBC settings inhive-site.xmlfirst.) - After running the initialization command, restart the Hive shell and try creating your table again—it should work now.
内容的提问来源于stack exchange,提问作者claudio gugliotta
相关产品推荐
相关产品推荐

