You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by PG User <pg...@gmail.com> on 2016/03/08 21:09:00 UTC

read-only mode for hive

Hi All,
I have one question about putting hive in read-only mode.

What are the ways of putting hive in read-only mode?
Can I take a lock at database level to serve purpose? What will happen to
existing transaction? My guess is it will not grant a lock until all
transactions are complete.

I read to change owner ship of /user/hive/warehouse/, but it is not full
proof solution.

Thank you.

- PG User

Re: read-only mode for hive

Posted by Sabarish Sasidharan <sa...@gmail.com>.
Does views solve your purpose?

Regards
Sab
On 09-Mar-2016 6:23 am, "PG User" <pg...@gmail.com> wrote:

> Yes, putting any database or any table to read-only mode will serve my
> purpose.
>
> On Tue, Mar 8, 2016 at 3:15 PM, Mich Talebzadeh <mich.talebzadeh@gmail.com
> > wrote:
>
>> Hive much like MSSQL or SAP ASE has multiple databases. Are you implying
>> to put one of these databases in READ ONLY mode?
>>
>> Dr Mich Talebzadeh
>>
>>
>>
>> LinkedIn * https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
>> <https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>*
>>
>>
>>
>> http://talebzadehmich.wordpress.com
>>
>>
>>
>> On 8 March 2016 at 20:09, PG User <pg...@gmail.com> wrote:
>>
>>> Hi All,
>>> I have one question about putting hive in read-only mode.
>>>
>>> What are the ways of putting hive in read-only mode?
>>> Can I take a lock at database level to serve purpose? What will happen
>>> to existing transaction? My guess is it will not grant a lock until all
>>> transactions are complete.
>>>
>>> I read to change owner ship of /user/hive/warehouse/, but it is not full
>>> proof solution.
>>>
>>> Thank you.
>>>
>>> - PG User
>>>
>>
>>
>

Re: read-only mode for hive

Posted by PG User <pg...@gmail.com>.
Yes, putting any database or any table to read-only mode will serve my
purpose.

On Tue, Mar 8, 2016 at 3:15 PM, Mich Talebzadeh <mi...@gmail.com>
wrote:

> Hive much like MSSQL or SAP ASE has multiple databases. Are you implying
> to put one of these databases in READ ONLY mode?
>
> Dr Mich Talebzadeh
>
>
>
> LinkedIn * https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
> <https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>*
>
>
>
> http://talebzadehmich.wordpress.com
>
>
>
> On 8 March 2016 at 20:09, PG User <pg...@gmail.com> wrote:
>
>> Hi All,
>> I have one question about putting hive in read-only mode.
>>
>> What are the ways of putting hive in read-only mode?
>> Can I take a lock at database level to serve purpose? What will happen to
>> existing transaction? My guess is it will not grant a lock until all
>> transactions are complete.
>>
>> I read to change owner ship of /user/hive/warehouse/, but it is not full
>> proof solution.
>>
>> Thank you.
>>
>> - PG User
>>
>
>

Re: read-only mode for hive

Posted by Mich Talebzadeh <mi...@gmail.com>.
Hive much like MSSQL or SAP ASE has multiple databases. Are you implying to
put one of these databases in READ ONLY mode?

Dr Mich Talebzadeh



LinkedIn * https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
<https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>*



http://talebzadehmich.wordpress.com



On 8 March 2016 at 20:09, PG User <pg...@gmail.com> wrote:

> Hi All,
> I have one question about putting hive in read-only mode.
>
> What are the ways of putting hive in read-only mode?
> Can I take a lock at database level to serve purpose? What will happen to
> existing transaction? My guess is it will not grant a lock until all
> transactions are complete.
>
> I read to change owner ship of /user/hive/warehouse/, but it is not full
> proof solution.
>
> Thank you.
>
> - PG User
>

Re: read-only mode for hive

Posted by Mich Talebzadeh <mi...@gmail.com>.
If this is all about a maintenance window, then why not shutdown Hive
server2 which stops client access including beeline and use Hive CLI to do
the maintenance work effectively in single user mode.  Snapshot is another
option.

HTH

Dr Mich Talebzadeh



LinkedIn * https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
<https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>*



http://talebzadehmich.wordpress.com



On 10 March 2016 at 00:16, Andrew Sears <an...@analyticsdream.com>
wrote:

> Another option might be to lock using a zookeeper script.
>
> Andrew
>
>
> Sent using CloudMagic Email
> <https://cloudmagic.com/k/d/mailapp?ct=pa&cv=7.4.10&pv=5.1.1&source=email_footer_2>
> On Wed, Mar 09, 2016 at 7:05 PM, Andrew Sears <
> andrew.sears@analyticsdream.com> wrote:
>
> What about renaming the table? To another schema with limited rights? Not
> sure why just flipping access grant to select only wouldn't also work,
> provided auth is enabled and not external.
>
> An hdfs snapshot could also give you point -in-time copy.  Set acls to
> restrict access if enabled.
>
> Cheers,
> Andrew
>
> On Wed, Mar 09, 2016 at 1:15 PM, PG User <pg...@gmail.com> wrote:
>
> Thank you all for replies.
>
> My usecase is as follows:
> I want to put a table (or database) in read-only mode. Then do some
> operations such as taking table definition and hdfs snapshot. I want to put
> table in read only mode to maintain consistency. After all my operations
> are done, I will again put hive to read-write mode.
>
> Sentry may not be solution as it will not handle existing transactions.
> creating view will not solve the purpose either if inserts are going on.
>
> - Nachiket
>
>
>
> On Wed, Mar 9, 2016 at 7:20 AM, David Capwell <dc...@gmail.com> wrote:
>
>> Could always set the tables output format to be the null output format
>> On Mar 8, 2016 11:01 PM, "Jörn Franke" <jo...@gmail.com> wrote:
>>
>>> What is the use case? You can try security solutions such as Ranger or
>>> Sentry.
>>>
>>> As already mentioned another alternative could be a view.
>>>
>>> > On 08 Mar 2016, at 21:09, PG User <pg...@gmail.com> wrote:
>>> >
>>> > Hi All,
>>> > I have one question about putting hive in read-only mode.
>>> >
>>> > What are the ways of putting hive in read-only mode?
>>> > Can I take a lock at database level to serve purpose? What will happen
>>> to existing transaction? My guess is it will not grant a lock until all
>>> transactions are complete.
>>> >
>>> > I read to change owner ship of /user/hive/warehouse/, but it is not
>>> full proof solution.
>>> >
>>> > Thank you.
>>> >
>>> > - PG User
>>>
>>
>

Re: read-only mode for hive

Posted by Andrew Sears <an...@analyticsdream.com>.
Another option might be to lock using a zookeeper script.

Andrew



Sent using CloudMagic Email
[https://cloudmagic.com/k/d/mailapp?ct=pa&cv=7.4.10&pv=5.1.1&source=email_footer_2] On Wed, Mar 09, 2016 at 7:05 PM, Andrew Sears < andrew.sears@analyticsdream.com [andrew.sears@analyticsdream.com] > wrote:
What about renaming the table? To another schema with limited rights? Not sure
why just flipping access grant to select only wouldn't also work, provided auth
is enabled and not external.

An hdfs snapshot could also give you point -in-time copy. Set acls to restrict
access if enabled.


Cheers,
Andrew


On Wed, Mar 09, 2016 at 1:15 PM, PG User < pguser1982@gmail.com [pguser1982@gmail.com] > wrote:
Thank you all for replies.
My usecase is as follows: I want to put a table (or database) in read-only mode. Then do some operations
such as taking table definition and hdfs snapshot. I want to put table in read
only mode to maintain consistency. After all my operations are done, I will
again put hive to read-write mode.
Sentry may not be solution as it will not handle existing transactions. creating view will not solve the purpose either if inserts are going on.
- Nachiket


On Wed, Mar 9, 2016 at 7:20 AM, David Capwell < dcapwell@gmail.com [dcapwell@gmail.com] > wrote:
Could always set the tables output format to be the null output format

On Mar 8, 2016 11:01 PM, "Jörn Franke" < jornfranke@gmail.com [jornfranke@gmail.com] > wrote:
What is the use case? You can try security solutions such as Ranger or Sentry.

As already mentioned another alternative could be a view.

> On 08 Mar 2016, at 21:09, PG User < pguser1982@gmail.com [pguser1982@gmail.com] > wrote:
>
> Hi All,
> I have one question about putting hive in read-only mode.
>
> What are the ways of putting hive in read-only mode?
> Can I take a lock at database level to serve purpose? What will happen to
existing transaction? My guess is it will not grant a lock until all
transactions are complete.
>
> I read to change owner ship of /user/hive/warehouse/, but it is not full proof
solution.
>
> Thank you.
>
> - PG User

Re: read-only mode for hive

Posted by Andrew Sears <an...@analyticsdream.com>.
What about renaming the table? To another schema with limited rights? Not sure
why just flipping access grant to select only wouldn't also work, provided auth
is enabled and not external.

An hdfs snapshot could also give you point -in-time copy. Set acls to restrict
access if enabled.


Cheers,
Andrew


On Wed, Mar 09, 2016 at 1:15 PM, PG User < pguser1982@gmail.com [pguser1982@gmail.com] > wrote:
Thank you all for replies.
My usecase is as follows: I want to put a table (or database) in read-only mode. Then do some operations
such as taking table definition and hdfs snapshot. I want to put table in read
only mode to maintain consistency. After all my operations are done, I will
again put hive to read-write mode.
Sentry may not be solution as it will not handle existing transactions. creating view will not solve the purpose either if inserts are going on.
- Nachiket


On Wed, Mar 9, 2016 at 7:20 AM, David Capwell < dcapwell@gmail.com [dcapwell@gmail.com] > wrote:
Could always set the tables output format to be the null output format

On Mar 8, 2016 11:01 PM, "Jörn Franke" < jornfranke@gmail.com [jornfranke@gmail.com] > wrote:
What is the use case? You can try security solutions such as Ranger or Sentry.

As already mentioned another alternative could be a view.

> On 08 Mar 2016, at 21:09, PG User < pguser1982@gmail.com [pguser1982@gmail.com] > wrote:
>
> Hi All,
> I have one question about putting hive in read-only mode.
>
> What are the ways of putting hive in read-only mode?
> Can I take a lock at database level to serve purpose? What will happen to
existing transaction? My guess is it will not grant a lock until all
transactions are complete.
>
> I read to change owner ship of /user/hive/warehouse/, but it is not full proof
solution.
>
> Thank you.
>
> - PG User

Re: read-only mode for hive

Posted by PG User <pg...@gmail.com>.
Thank you all for replies.

My usecase is as follows:
I want to put a table (or database) in read-only mode. Then do some
operations such as taking table definition and hdfs snapshot. I want to put
table in read only mode to maintain consistency. After all my operations
are done, I will again put hive to read-write mode.

Sentry may not be solution as it will not handle existing transactions.
creating view will not solve the purpose either if inserts are going on.

- Nachiket



On Wed, Mar 9, 2016 at 7:20 AM, David Capwell <dc...@gmail.com> wrote:

> Could always set the tables output format to be the null output format
> On Mar 8, 2016 11:01 PM, "Jörn Franke" <jo...@gmail.com> wrote:
>
>> What is the use case? You can try security solutions such as Ranger or
>> Sentry.
>>
>> As already mentioned another alternative could be a view.
>>
>> > On 08 Mar 2016, at 21:09, PG User <pg...@gmail.com> wrote:
>> >
>> > Hi All,
>> > I have one question about putting hive in read-only mode.
>> >
>> > What are the ways of putting hive in read-only mode?
>> > Can I take a lock at database level to serve purpose? What will happen
>> to existing transaction? My guess is it will not grant a lock until all
>> transactions are complete.
>> >
>> > I read to change owner ship of /user/hive/warehouse/, but it is not
>> full proof solution.
>> >
>> > Thank you.
>> >
>> > - PG User
>>
>

Re: read-only mode for hive

Posted by David Capwell <dc...@gmail.com>.
Could always set the tables output format to be the null output format
On Mar 8, 2016 11:01 PM, "Jörn Franke" <jo...@gmail.com> wrote:

> What is the use case? You can try security solutions such as Ranger or
> Sentry.
>
> As already mentioned another alternative could be a view.
>
> > On 08 Mar 2016, at 21:09, PG User <pg...@gmail.com> wrote:
> >
> > Hi All,
> > I have one question about putting hive in read-only mode.
> >
> > What are the ways of putting hive in read-only mode?
> > Can I take a lock at database level to serve purpose? What will happen
> to existing transaction? My guess is it will not grant a lock until all
> transactions are complete.
> >
> > I read to change owner ship of /user/hive/warehouse/, but it is not full
> proof solution.
> >
> > Thank you.
> >
> > - PG User
>

Re: read-only mode for hive

Posted by Jörn Franke <jo...@gmail.com>.
What is the use case? You can try security solutions such as Ranger or Sentry.

As already mentioned another alternative could be a view.

> On 08 Mar 2016, at 21:09, PG User <pg...@gmail.com> wrote:
> 
> Hi All,
> I have one question about putting hive in read-only mode.
> 
> What are the ways of putting hive in read-only mode?
> Can I take a lock at database level to serve purpose? What will happen to existing transaction? My guess is it will not grant a lock until all transactions are complete.
> 
> I read to change owner ship of /user/hive/warehouse/, but it is not full proof solution.
> 
> Thank you.
> 
> - PG User