Harman
Harman

Reputation: 727

error creating oozie database schema

I'm trying to setup oozie (cdh4) using RPM on RHEL5. When I run the command to setup schemas in mysql database using sudo -u oozie /usr/lib/oozie/bin/ooziedb.sh create -run it gives me an error stating "No such file or directory". You can view the logs for the same here.

While if I try to run the command to just create scripts using sudo -u oozie /usr/lib/oozie/bin/ooziedb.sh create -sqlfile oozie-create.sql it gives me an error stating " unable to connect to database". You can view the logs for the same here.

I am following cdh4 installation site for oozie.

Please help me figure out the possible errors. Thanks in advance.

Upvotes: 0

Views: 4325

Answers (2)

Wesam Nabki
Wesam Nabki

Reputation: 2614

In my case, my db oozie was emptly, so I drop the db, and create it again! $ mysql -u root -p Enter password: ******

mysql> create database oozie; Query OK, 1 row affected (0.03 sec)

mysql> grant all privileges on oozie.* to 'oozie'@'localhost' identified by 'oozie'; Query OK, 0 rows affected (0.03 sec)

mysql> grant all privileges on oozie.* to 'oozie'@'%' identified by 'oozie'; Query OK, 0 rows affected (0.03 sec)

mysql> exit Bye

then

Validate DB Connection DONE Check DB schema does not exist DONE Check OOZIE_SYS table does not exist DONE Create SQL schema DONE Create OOZIE_SYS table DONE Set MySQL MEDIUMTEXT flag DONE

Oozie DB has been created for Oozie version '3.3.2-cdh4.7.0'

Upvotes: 0

Chris White
Chris White

Reputation: 30089

Looks like you're having some sort of permissions issue when trying to create the init sql file. The code for oozie cdh4 where the error emanates from is this:

String sqlFile = (commandLine.hasOption(SQL_FILE_OPT))
      ? commandLine.getOptionValue(SQL_FILE_OPT)
      : File.createTempFile("ooziedb-", ".sql").getAbsolutePath();

So you could try and pass in the SQL_FILE_OPT and name a path that you know exists, and the user oozie can write too. You've already done in your second command line, but i would fully qualify the path to the sql file, and put it somewhere where you know the oozie you can write to (/tmp, which should in reality be where File.createTempFile(..) creates the file).

sudo -u oozie touch /tmp/oozie-create.sql
sudo -u oozie /usr/lib/oozie/bin/ooziedb.sh create \
    -sqlfile /tmp/oozie-create.sql

Upvotes: 1

Related Questions