Hadoop Sqoop How to change sqoop metastore

0 votes

I am trying to change the sqoop metastore from default hsqldb to mysql.

sqoop-site.xml:

    <property>
    <name>sqoop.metastore.client.enable.autoconnect</name>
    <value>false</value>
    <description>If true, Sqoop will connect to a local metastore
      for job management when no other metastore arguments are
      provided.
    </description>
  </property>
  <property>
    <name>sqoop.metastore.client.autoconnect.url</name>
    <value>jdbc:mysql://ip:3206/sqoop?createDatabaseIfNotExist=true</value>
  </property>
  <property>
    <name>sqoop.metastore.client.autoconnect.username</name>
    <value>userName</value>
  </property>
  <property>
    <name>sqoop.metastore.client.autoconnect.password</name>
    <value>password</value>
  </property>
</configuration>

When I try to create a sqoop jobs with meta-connect url it fails to connect to configured mysql db.

sqoop job --create --meta-connect {mysql_jdbc_url} sqoop job defination

it is throwing following exception.

    14/06/06 15:04:54 INFO sqoop.Sqoop: Running Sqoop version: 1.4.4.2.0.6.1-101
14/06/06 15:04:55 WARN hsqldb.HsqldbJobStorage: Could not interpret as a number: null
14/06/06 15:04:55 ERROR hsqldb.HsqldbJobStorage: Can not interpret metadata schema
14/06/06 15:04:55 ERROR hsqldb.HsqldbJobStorage: The metadata schema version is null
14/06/06 15:04:55 ERROR hsqldb.HsqldbJobStorage: The highest version supported is 0
14/06/06 15:04:55 ERROR hsqldb.HsqldbJobStorage: To use this version of Sqoop, you must downgrade your metadata schema.
14/06/06 15:04:55 ERROR tool.JobTool: I/O error performing job operation: java.io.IOException: Invalid metadata version.
        at org.apache.sqoop.metastore.hsqldb.HsqldbJobStorage.init(HsqldbJobStorage.java:202)
        at org.apache.sqoop.metastore.hsqldb.HsqldbJobStorage.open(HsqldbJobStorage.java:161)
        at org.apache.sqoop.tool.JobTool.run(JobTool.java:274)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:222)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:231)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:240)

How to solve this?

Nov 13, 2018 in Big Data Hadoop by slayer
• 29,370 points
1,757 views

1 answer to this question.

0 votes
  1. In sqoop-site.xml I configured it with, the connect string to my database, username and password.

  2. Created the following object in the database, as Sqoop was failing at it.

    CREATE TABLE SQOOP_ROOT ( version INT, propname VARCHAR(128) NOT NULL, propval VARCHAR(256), CONSTRAINT SQOOP_ROOT_unq UNIQUE (version, propname) );

  3. Inserted the following row (This seems to be the reason your script is failing)

    INSERT INTO SQOOP_ROOT VALUES( NULL, 'sqoop.hsqldb.job.storage.version', '0' );

answered Nov 13, 2018 by Omkar
• 69,220 points

Related Questions In Big Data Hadoop

0 votes
1 answer

How to migrate/ change Hadoop 1.x maven project to Hadoop 2.x?

In Hadoop 2.2. most of the dependencies ...READ MORE

answered Apr 15, 2018 in Big Data Hadoop by kurt_cobain
• 9,350 points
1,051 views
0 votes
1 answer

How to change the replication factor of specific directory in Hadoop?

Yes, you can change the replication factor ...READ MORE

answered May 11, 2018 in Big Data Hadoop by Shubham
• 13,490 points
3,671 views
0 votes
1 answer

How to change the checkpointing duration in Hadoop

Answer: The default duration of checkpointing is 3600 ...READ MORE

answered May 11, 2018 in Big Data Hadoop by Shubham
• 13,490 points
1,507 views
0 votes
1 answer

How to install Sqoop with Hadoop 2.2.0?

You can refer the below link to ...READ MORE

answered Sep 18, 2018 in Big Data Hadoop by Frankie
• 9,830 points
1,042 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
11,029 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
2,537 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,836 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,350 points
4,612 views
0 votes
3 answers

How to change the delimiter in Sqoop?

--fields-terminated-by <char> READ MORE

answered Jun 25, 2019 in Big Data Hadoop by anonymous
10,584 views
0 votes
1 answer

How to change file format using Sqoop?

For change in the file format, you ...READ MORE

answered Dec 18, 2018 in Big Data Hadoop by Omkar
• 69,220 points
2,060 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP