Reply
Jy
Explorer
Posts: 21
Registered: ‎09-30-2014

upgrading sentry database schema

Hi,

 

I have upgraded from CDH 5.1 to CDH 5.2 and need to upgrade the sentry database schema. This option however, is displaying in the cloudera manager. I looked at how to run this command via the command line with: bin/sentry --command schema-tool --conffile <sentry-site.xml> --dbType <db-type> --upgradeSchema

 

What is the difference between the sentry-site.xml and sentry-store-site.xml? I ran the schematool to use the sentry-store-site.xml since I am unable to find the sentry-site.xml file. When I ran the tool I received the following error org.apache.sentry.SentryUserException: Failed to get schema version.

 

When I try to start sentry service I receive the following error: 

 

2015-01-19 10:47:52,790 INFO org.apache.sentry.service.thrift.SentryService: Waiting on future.get()
2015-01-19 10:47:53,207 INFO DataNucleus.Persistence: Property datanucleus.cache.level2 unknown - will be ignored
2015-01-19 10:47:53,537 WARN com.jolbox.bonecp.BoneCPConfig: Max Connections < 1. Setting to 20
2015-01-19 10:47:54,639 WARN com.jolbox.bonecp.BoneCPConfig: Max Connections < 1. Setting to 20
2015-01-19 10:47:54,767 ERROR org.apache.sentry.service.thrift.SentryService: Error starting server
java.lang.IllegalStateException: Could not create org.apache.sentry.provider.db.service.thrift.SentryPolicyStoreProcessorFactory
	at org.apache.sentry.service.thrift.SentryService.runServer(SentryService.java:189)
	at org.apache.sentry.service.thrift.SentryService.call(SentryService.java:155)
	at org.apache.sentry.service.thrift.SentryService.call(SentryService.java:67)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.sentry.provider.db.SentryAccessDeniedException: The Sentry store schema version 1.4.0 is different from distribution version 1.4.0-cdh5
	at org.apache.sentry.provider.db.service.persistent.SentryStore.verifySentryStoreSchema(SentryStore.java:150)
	at org.apache.sentry.provider.db.service.persistent.SentryStore.<init>(SentryStore.java:137)
	at org.apache.sentry.provider.db.service.thrift.SentryPolicyStoreProcessor.<init>(SentryPolicyStoreProcessor.java:77)
	at org.apache.sentry.provider.db.service.thrift.SentryPolicyStoreProcessorFactory.register(SentryPolicyStoreProcessorFactory.java:31)
	at org.apache.sentry.service.thrift.SentryService.runServer(SentryService.java:187)
	... 6 more
2015-01-19 10:47:54,774 INFO org.apache.sentry.service.thrift.SentryService: ShutdownHook shutting down server
JLo
New Contributor
Posts: 5
Registered: ‎01-31-2018

Re: upgrading sentry database schema

Did you ever get a responsee, or find a fix for this issue?

I seem to have the same issue, when moving from CDH5.11 -> 5.13

 

Caused by: org.apache.sentry.provider.db.SentryAccessDeniedException: The Sentry store schema version 1.5.0-cdh5 is different from distribution version 1.5.0

 

JLo
New Contributor
Posts: 5
Registered: ‎01-31-2018

Re: upgrading sentry database schema

Quick workaround found.
We found the field in the database that was causing the error, and updated it from '1.5.0-cdh' to '1.5.0' and sentry started without issue.
Whether this is a good idea will only be found after more testing.
Highlighted
New Contributor
Posts: 1
Registered: ‎08-28-2018

Re: upgrading sentry database schema

Faced same issue while upgrading CDH 5.11 to 5.15. 

solution -

1. goto Sentry -> Actions -> Upgrade Sentry Database Tables 

2. goto sentry -> Actions -> Deploy Client Configuration.

3. Start Sentry