You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ambari.apache.org by hd...@uni.de on 2016/02/15 15:26:44 UTC

Questions about Ranger installation with pre-setup Oracle DB

Hi,

we ran into some trouble trying to install Ranger using Ambari (2.1.0)
with a pre-setup Oracle database (we used the SQL files from
https://github.com/apache/incubator-ranger/tree/ranger-0.5/security-admin/db/oracle
for manual setup).
By enterprise policy, we are unable to let the Ambari-setup do the
table/user creation stuff.

When starting the installation process, we cleared the "Setup DB and
DB user" check box under “Advanced ranger-env”.

First problem:
In the setup procedure, Ambari runs some function called
"verify_tablespace" (dba_script.py) where it checks whether the User
tablespace equals the entered database name.

Question: Why is this match necessary? After talking to our db-admins
I was assured it is not uncommon that these two might differ - as it
is in our case -> so the installation fails.
We had to refactor the code to always return true (and so "skip" the
validation) to proceed with the setup.

Second problem:
After successfully working around the verify_tablespace problem, we
ran into another problem: it looks like Ambari tries to run some
database-patches, even though we cleared the "Setup DB and User" check
box! Of course, the patching fails (and so the installation fails),
because the ranger db-user has no privileges to run ALTER TABLE etc.!

Question: Why does Ambari run db patches, even with unchecked "Setup
db/user" properties?

Any help/hints appreciated.

-Sebastian

Re: Questions about Ranger installation with pre-setup Oracle DB

Posted by Gautam Borad <gb...@gmail.com>.
Hi Sebastian,
    Thanks for the log. Analyzing the logs following are the points:

   - "Separate DBA property not set."
   - This log proves that we are actually using separate DBA mode. So this
      is good.


   - su: warning: cannot change directory to /home/ranger: No such file or
   directory
      - We should debug this further. On the ranger host, please check if
      /home/ranger directory is present or not and that it has appropriate
      permissions. Eg:
      - root@myHost:~# ls -l /home/
      drwxr-xr-x 2 ranger    hadoop 4096  Feb 23  09:59 ranger


   - Make sure you have given the right DB name and DB User name in Ambari
   UI. Something similar to this:
      - *For Ranger Admin*: GRANT CREATE SESSION,CREATE PROCEDURE,CREATE
      TABLE,CREATE VIEW,CREATE SEQUENCE,CREATE PUBLIC SYNONYM,CREATE
      TRIGGER,UNLIMITED Tablespace TO *rangeradmin* WITH ADMIN OPTION;
      - *For Ranger Audit*: GRANT CREATE SESSION TO rangerlogger;


Please try the above and let me know. Thanks.



On Wed, Feb 24, 2016 at 1:15 PM, <hd...@uni.de> wrote:

> Hi Gautam,
>
> any recommendation on how to proceed here?
>
> -Sebastian
>
> 2016-02-16 9:01 GMT+01:00  <hd...@uni.de>:
> > Hi Gautam,
> >
> > we're seeing the following log output:
> >
> > 2016-02-12 14:46:57,327 - Writing
> > File['/usr/hdp/current/ranger-admin/install.properties'] because
> > contents don't match
> > 2016-02-12 14:46:57,328 - Separate DBA property not set. Assuming
> > Ranger DB and DB User exists!
> > 2016-02-12 14:46:57,329 - Execute['python
> > /usr/hdp/current/ranger-admin/db_setup.py'] {'logoutput': True,
> > 'environment': {'RANGER_ADMIN_HOME': '/usr/hdp/current/ranger-admin',
> > 'JAVA_HOME': '/usr/jdk64/jdk1.7.0_67/'}, 'user': 'ranger'}
> > su: warning: cannot change directory to /home/ranger: No such file or
> directory
> > 2016-02-12 14:46:57,463  [I] DB FLAVOR :ORACLE
> > 2016-02-12 14:46:57,463  [I] --------- Verifying Ranger DB connection
> ---------
> > 2016-02-12 14:46:57,463  [I] Checking connection
> > 2016-02-12 14:46:58,240  [I] Connection success
> > 2016-02-12 14:46:58,240  [I] --------- Verifying Ranger DB tables
> ---------
> > 2016-02-12 14:46:58,240  [I] --------- bin NICHT auf ambari ---------
> > 2016-02-12 14:46:58,241  [I] --------- Verifying upgrade history table
> ---------
> > 2016-02-12 14:46:58,241  [I] --------- bin NICHT auf ambari ---------
> > 2016-02-12 14:46:58,241  [I] --------- Applying Ranger DB patches
> ---------
> > 2016-02-12 14:46:58,241  [I] Executing patch on s100on1t from file:
> > 001-groupsource.sql
> > SQLException : SQL state: 42000 java.sql.SQLSyntaxErrorException:
> > ORA-00942: table or view does not exist
> >  ErrorCode: 942
> >
> > (Please don't mind the "bin NICHT auf ambari" output - we changed some
> > log-info to find out which script gets executed where).
> >
> > As you can see, line 2 states "Assuming Ranger DB and DB User exists!"
> > -> So why is Ranger trying to apply patches afterwards? As far as I
> > can see, the loglines originate from db_setup.py and not from
> > dba_script.py.
> >
> > - Sebastian
> >
> > 2016-02-16 4:57 GMT+01:00 Gautam Borad <gb...@gmail.com>:
> >> Hi Sebastian
> >>      As per the 2.1 codebase the dba_script.py script should not be
> called
> >> if "Setup DB and DB user" is unchecked. Can you verify if the changes
> were
> >> saved before calling the setup.
> >>
> >> You can also look for the INFO message  Setting up Ranger DB and DB
> User" in
> >> the logs. This log should ideally be not called, since you had set the
> flag
> >> to OFF. Thanks.
> >>
> >> On Mon, Feb 15, 2016 at 7:56 PM, <hd...@uni.de> wrote:
> >>>
> >>> Hi,
> >>>
> >>> we ran into some trouble trying to install Ranger using Ambari (2.1.0)
> >>> with a pre-setup Oracle database (we used the SQL files from
> >>>
> >>>
> https://github.com/apache/incubator-ranger/tree/ranger-0.5/security-admin/db/oracle
> >>> for manual setup).
> >>> By enterprise policy, we are unable to let the Ambari-setup do the
> >>> table/user creation stuff.
> >>>
> >>> When starting the installation process, we cleared the "Setup DB and
> >>> DB user" check box under “Advanced ranger-env”.
> >>>
> >>> First problem:
> >>> In the setup procedure, Ambari runs some function called
> >>> "verify_tablespace" (dba_script.py) where it checks whether the User
> >>> tablespace equals the entered database name.
> >>>
> >>> Question: Why is this match necessary? After talking to our db-admins
> >>> I was assured it is not uncommon that these two might differ - as it
> >>> is in our case -> so the installation fails.
> >>> We had to refactor the code to always return true (and so "skip" the
> >>> validation) to proceed with the setup.
> >>>
> >>> Second problem:
> >>> After successfully working around the verify_tablespace problem, we
> >>> ran into another problem: it looks like Ambari tries to run some
> >>> database-patches, even though we cleared the "Setup DB and User" check
> >>> box! Of course, the patching fails (and so the installation fails),
> >>> because the ranger db-user has no privileges to run ALTER TABLE etc.!
> >>>
> >>> Question: Why does Ambari run db patches, even with unchecked "Setup
> >>> db/user" properties?
> >>>
> >>> Any help/hints appreciated.
> >>>
> >>> -Sebastian
> >>
> >>
> >>
> >>
> >> --
> >> Regards,
> >> Gautam.
>



-- 
Regards,
Gautam.

Re: Questions about Ranger installation with pre-setup Oracle DB

Posted by hd...@uni.de.
Hi Gautam,

any recommendation on how to proceed here?

-Sebastian

2016-02-16 9:01 GMT+01:00  <hd...@uni.de>:
> Hi Gautam,
>
> we're seeing the following log output:
>
> 2016-02-12 14:46:57,327 - Writing
> File['/usr/hdp/current/ranger-admin/install.properties'] because
> contents don't match
> 2016-02-12 14:46:57,328 - Separate DBA property not set. Assuming
> Ranger DB and DB User exists!
> 2016-02-12 14:46:57,329 - Execute['python
> /usr/hdp/current/ranger-admin/db_setup.py'] {'logoutput': True,
> 'environment': {'RANGER_ADMIN_HOME': '/usr/hdp/current/ranger-admin',
> 'JAVA_HOME': '/usr/jdk64/jdk1.7.0_67/'}, 'user': 'ranger'}
> su: warning: cannot change directory to /home/ranger: No such file or directory
> 2016-02-12 14:46:57,463  [I] DB FLAVOR :ORACLE
> 2016-02-12 14:46:57,463  [I] --------- Verifying Ranger DB connection ---------
> 2016-02-12 14:46:57,463  [I] Checking connection
> 2016-02-12 14:46:58,240  [I] Connection success
> 2016-02-12 14:46:58,240  [I] --------- Verifying Ranger DB tables ---------
> 2016-02-12 14:46:58,240  [I] --------- bin NICHT auf ambari ---------
> 2016-02-12 14:46:58,241  [I] --------- Verifying upgrade history table ---------
> 2016-02-12 14:46:58,241  [I] --------- bin NICHT auf ambari ---------
> 2016-02-12 14:46:58,241  [I] --------- Applying Ranger DB patches ---------
> 2016-02-12 14:46:58,241  [I] Executing patch on s100on1t from file:
> 001-groupsource.sql
> SQLException : SQL state: 42000 java.sql.SQLSyntaxErrorException:
> ORA-00942: table or view does not exist
>  ErrorCode: 942
>
> (Please don't mind the "bin NICHT auf ambari" output - we changed some
> log-info to find out which script gets executed where).
>
> As you can see, line 2 states "Assuming Ranger DB and DB User exists!"
> -> So why is Ranger trying to apply patches afterwards? As far as I
> can see, the loglines originate from db_setup.py and not from
> dba_script.py.
>
> - Sebastian
>
> 2016-02-16 4:57 GMT+01:00 Gautam Borad <gb...@gmail.com>:
>> Hi Sebastian
>>      As per the 2.1 codebase the dba_script.py script should not be called
>> if "Setup DB and DB user" is unchecked. Can you verify if the changes were
>> saved before calling the setup.
>>
>> You can also look for the INFO message  Setting up Ranger DB and DB User" in
>> the logs. This log should ideally be not called, since you had set the flag
>> to OFF. Thanks.
>>
>> On Mon, Feb 15, 2016 at 7:56 PM, <hd...@uni.de> wrote:
>>>
>>> Hi,
>>>
>>> we ran into some trouble trying to install Ranger using Ambari (2.1.0)
>>> with a pre-setup Oracle database (we used the SQL files from
>>>
>>> https://github.com/apache/incubator-ranger/tree/ranger-0.5/security-admin/db/oracle
>>> for manual setup).
>>> By enterprise policy, we are unable to let the Ambari-setup do the
>>> table/user creation stuff.
>>>
>>> When starting the installation process, we cleared the "Setup DB and
>>> DB user" check box under “Advanced ranger-env”.
>>>
>>> First problem:
>>> In the setup procedure, Ambari runs some function called
>>> "verify_tablespace" (dba_script.py) where it checks whether the User
>>> tablespace equals the entered database name.
>>>
>>> Question: Why is this match necessary? After talking to our db-admins
>>> I was assured it is not uncommon that these two might differ - as it
>>> is in our case -> so the installation fails.
>>> We had to refactor the code to always return true (and so "skip" the
>>> validation) to proceed with the setup.
>>>
>>> Second problem:
>>> After successfully working around the verify_tablespace problem, we
>>> ran into another problem: it looks like Ambari tries to run some
>>> database-patches, even though we cleared the "Setup DB and User" check
>>> box! Of course, the patching fails (and so the installation fails),
>>> because the ranger db-user has no privileges to run ALTER TABLE etc.!
>>>
>>> Question: Why does Ambari run db patches, even with unchecked "Setup
>>> db/user" properties?
>>>
>>> Any help/hints appreciated.
>>>
>>> -Sebastian
>>
>>
>>
>>
>> --
>> Regards,
>> Gautam.

Re: Questions about Ranger installation with pre-setup Oracle DB

Posted by hd...@uni.de.
Hi Gautam,

we're seeing the following log output:

2016-02-12 14:46:57,327 - Writing
File['/usr/hdp/current/ranger-admin/install.properties'] because
contents don't match
2016-02-12 14:46:57,328 - Separate DBA property not set. Assuming
Ranger DB and DB User exists!
2016-02-12 14:46:57,329 - Execute['python
/usr/hdp/current/ranger-admin/db_setup.py'] {'logoutput': True,
'environment': {'RANGER_ADMIN_HOME': '/usr/hdp/current/ranger-admin',
'JAVA_HOME': '/usr/jdk64/jdk1.7.0_67/'}, 'user': 'ranger'}
su: warning: cannot change directory to /home/ranger: No such file or directory
2016-02-12 14:46:57,463  [I] DB FLAVOR :ORACLE
2016-02-12 14:46:57,463  [I] --------- Verifying Ranger DB connection ---------
2016-02-12 14:46:57,463  [I] Checking connection
2016-02-12 14:46:58,240  [I] Connection success
2016-02-12 14:46:58,240  [I] --------- Verifying Ranger DB tables ---------
2016-02-12 14:46:58,240  [I] --------- bin NICHT auf ambari ---------
2016-02-12 14:46:58,241  [I] --------- Verifying upgrade history table ---------
2016-02-12 14:46:58,241  [I] --------- bin NICHT auf ambari ---------
2016-02-12 14:46:58,241  [I] --------- Applying Ranger DB patches ---------
2016-02-12 14:46:58,241  [I] Executing patch on s100on1t from file:
001-groupsource.sql
SQLException : SQL state: 42000 java.sql.SQLSyntaxErrorException:
ORA-00942: table or view does not exist
 ErrorCode: 942

(Please don't mind the "bin NICHT auf ambari" output - we changed some
log-info to find out which script gets executed where).

As you can see, line 2 states "Assuming Ranger DB and DB User exists!"
-> So why is Ranger trying to apply patches afterwards? As far as I
can see, the loglines originate from db_setup.py and not from
dba_script.py.

- Sebastian

2016-02-16 4:57 GMT+01:00 Gautam Borad <gb...@gmail.com>:
> Hi Sebastian
>      As per the 2.1 codebase the dba_script.py script should not be called
> if "Setup DB and DB user" is unchecked. Can you verify if the changes were
> saved before calling the setup.
>
> You can also look for the INFO message  Setting up Ranger DB and DB User" in
> the logs. This log should ideally be not called, since you had set the flag
> to OFF. Thanks.
>
> On Mon, Feb 15, 2016 at 7:56 PM, <hd...@uni.de> wrote:
>>
>> Hi,
>>
>> we ran into some trouble trying to install Ranger using Ambari (2.1.0)
>> with a pre-setup Oracle database (we used the SQL files from
>>
>> https://github.com/apache/incubator-ranger/tree/ranger-0.5/security-admin/db/oracle
>> for manual setup).
>> By enterprise policy, we are unable to let the Ambari-setup do the
>> table/user creation stuff.
>>
>> When starting the installation process, we cleared the "Setup DB and
>> DB user" check box under “Advanced ranger-env”.
>>
>> First problem:
>> In the setup procedure, Ambari runs some function called
>> "verify_tablespace" (dba_script.py) where it checks whether the User
>> tablespace equals the entered database name.
>>
>> Question: Why is this match necessary? After talking to our db-admins
>> I was assured it is not uncommon that these two might differ - as it
>> is in our case -> so the installation fails.
>> We had to refactor the code to always return true (and so "skip" the
>> validation) to proceed with the setup.
>>
>> Second problem:
>> After successfully working around the verify_tablespace problem, we
>> ran into another problem: it looks like Ambari tries to run some
>> database-patches, even though we cleared the "Setup DB and User" check
>> box! Of course, the patching fails (and so the installation fails),
>> because the ranger db-user has no privileges to run ALTER TABLE etc.!
>>
>> Question: Why does Ambari run db patches, even with unchecked "Setup
>> db/user" properties?
>>
>> Any help/hints appreciated.
>>
>> -Sebastian
>
>
>
>
> --
> Regards,
> Gautam.

Re: Questions about Ranger installation with pre-setup Oracle DB

Posted by Gautam Borad <gb...@gmail.com>.
Hi Sebastian
     As per the 2.1 codebase
<https://github.com/apache/ambari/blob/branch-2.1/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py#L194-L201>
the dba_script.py script should not be called if "Setup DB and DB user" is
unchecked. Can you verify if the changes were saved before calling the
setup.

You can also look for the INFO message  Setting up Ranger DB and DB User" in
the logs. This log should ideally be not called, since you had set the flag
to OFF. Thanks.

On Mon, Feb 15, 2016 at 7:56 PM, <hd...@uni.de> wrote:

> Hi,
>
> we ran into some trouble trying to install Ranger using Ambari (2.1.0)
> with a pre-setup Oracle database (we used the SQL files from
>
> https://github.com/apache/incubator-ranger/tree/ranger-0.5/security-admin/db/oracle
> for manual setup).
> By enterprise policy, we are unable to let the Ambari-setup do the
> table/user creation stuff.
>
> When starting the installation process, we cleared the "Setup DB and
> DB user" check box under “Advanced ranger-env”.
>
> First problem:
> In the setup procedure, Ambari runs some function called
> "verify_tablespace" (dba_script.py) where it checks whether the User
> tablespace equals the entered database name.
>
> Question: Why is this match necessary? After talking to our db-admins
> I was assured it is not uncommon that these two might differ - as it
> is in our case -> so the installation fails.
> We had to refactor the code to always return true (and so "skip" the
> validation) to proceed with the setup.
>
> Second problem:
> After successfully working around the verify_tablespace problem, we
> ran into another problem: it looks like Ambari tries to run some
> database-patches, even though we cleared the "Setup DB and User" check
> box! Of course, the patching fails (and so the installation fails),
> because the ranger db-user has no privileges to run ALTER TABLE etc.!
>
> Question: Why does Ambari run db patches, even with unchecked "Setup
> db/user" properties?
>
> Any help/hints appreciated.
>
> -Sebastian
>



-- 
Regards,
Gautam.