运行配置单元命令后,无法创建数据库
遵循apache网站上的官方“入门”指南
NestedThrowables:
java.sql.SQLException: Unable to open a test connection to the given
database. JDBC url = jdbc:derby:;databaseName=metastore_db;create=true,
username = APP. Terminating connection pool (set lazyInit to true if you
expect to start your database after your app). Original Exception: ------
java.sql.SQLException: Failed to create database 'metastore_db', see the next exception for details.
Caused by: java.sql.SQLException: Directory /opt/hive/bin/metastore_db cannot be created.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
... 80 more
Caused by: ERROR XBM0H: Directory /opt/hive/bin/metastore_db cannot be created.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.services.monitor.StorageFactoryService$10.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.impl.services.monitor.StorageFactoryService.createServiceRoot(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(Unknown Source)
at org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Unknown Source)
... 80 more
3条答案
按热度按时间dnph8jn41#
我刚刚在hive:hive-site.xml和创建/user/hive/warehouse的安装步骤中实现了:
“user”很容易与“usr”混淆,根本没有任何警告。所以请记住:
在hadoop fs下,要创建的是/user/hive/warehouse,它指向metadata\u db文件夹(而不是/usr/hive/warehouse)
iyzzxitl2#
检查特定用户是否有创建的权限
/opt/hive/bin/metastore_db
如果没有,则添加权限希望这有帮助
vsmadaxz3#
用法:chown-rhduser:hduser */hive/(*或您正在使用的任何用户名/用户组)授予所有者(因此具有完全权限…..包括写入/创建)
(我不知道是否有一个名为hive:hive,我创建了此配置单元,但将所有权授予此用户创建的配置单元将不起作用..)
基本上,安装说明假设您(hadoop和继承您权利的hive)拥有足够的权限。
(注意:这相当于在windows中以管理模式运行命令提示符,即使您已经是管理员)。linux在很多方面都很灵活,因此会造成一些混乱。