CDH 之 Sentry 添加或启动错误:Could not create org.apache.sentry.provider.db.service.persistent.SentryStore

一、添加 Sentry 时错误

WARNING: log4j.properties is not found. HADOOP_CONF_DIR may be incomplete.
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hive/beeline/BeeLine
	at org.apache.sentry.cli.tools.SentrySchemaTool.runBeeLine(SentrySchemaTool.java:446)
	at org.apache.sentry.cli.tools.SentrySchemaTool.runBeeLine(SentrySchemaTool.java:428)
	at org.apache.sentry.cli.tools.SentrySchemaTool.doInit(SentrySchemaTool.java:349)
	at org.apache.sentry.cli.tools.SentrySchemaTool.doInit(SentrySchemaTool.java:326)
	at org.apache.sentry.cli.tools.SentrySchemaTool$CommandImpl.run(SentrySchemaTool.java:601)
	at org.apache.sentry.SentryMain.main(SentryMain.java:120)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.hadoop.util.RunJar.run(RunJar.java:313)
	at org.apache.hadoop.util.RunJar.main(RunJar.java:227)
Caused by: java.lang.ClassNotFoundException: org.apache.hive.beeline.BeeLine
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 12 more

二、回到主页启动 Sentry 报错

Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
Exception in thread "main" java.lang.IllegalStateException: Could not create org.apache.sentry.provider.db.service.persistent.SentryStore
	at org.apache.sentry.provider.db.service.persistent.SentryStoreFactory.create(SentryStoreFactory.java:61)
	at org.apache.sentry.service.thrift.SentryService.<init>(SentryService.java:163)
	at org.apache.sentry.service.thrift.SentryService$CommandImpl.run(SentryService.java:563)
	at org.apache.sentry.SentryMain.main(SentryMain.java:120)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.hadoop.util.RunJar.run(RunJar.java:313)
	at org.apache.hadoop.util.RunJar.main(RunJar.java:227)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.apache.sentry.provider.db.service.persistent.SentryStoreFactory.create(SentryStoreFactory.java:45)
	... 9 more
Caused by: org.apache.sentry.core.common.exception.SentryNoSuchObjectException: Matching Version doesn't exist
	at org.apache.sentry.provider.db.service.persistent.SentryStore.lambda$getMSentryVersion$43(SentryStore.java:2712)
	at org.apache.sentry.provider.db.service.persistent.TransactionManager.executeTransaction(TransactionManager.java:123)
	at org.apache.sentry.provider.db.service.persistent.SentryStore.getMSentryVersion(SentryStore.java:2703)
	at org.apache.sentry.provider.db.service.persistent.SentryStore.getSentryVersion(SentryStore.java:2676)
	at org.apache.sentry.provider.db.service.persistent.SentryStore.verifySentryStoreSchema(SentryStore.java:310)
	at org.apache.sentry.provider.db.service.persistent.SentryStore.<init>(SentryStore.java:283)
	... 14 more

以上的错误看似 mysql 的 jar 包有问题,但这里并不是,因为 CDH 其他服务也会依赖这个 mysql-connector-java.jar ,所以不会是它的问题

三、修改 sentry-site.xml

3.1 加入配置

<property>
    <name>sentry.verify.schema.version</name>
    <value>false</value>
</property>

3.2 回到主页重新启动 sentry 即可启动

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

啊 这

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值