Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Sqoop >> mail # user >> Connection refused while Job Submission - Sqoop Client API


Copy link to this message
-
Re: Connection refused while Job Submission - Sqoop Client API
Manish,

In a previous message, you had said that you had given the Sqoop 2 server
access to the database (remote access). It seems like you're going to have
to give remote access to the nodes hosting the TaskTrackers and JobTracker
for this to work. The error message you're seeing pops up during
initialization of the Sqoop job or execution of the MapReduce job.

Also, you might want to be sure that the Sqoop server can communicate with
your database. If I remember right, connections can be created regardless
of their ability to connect to the server. The difference is that the
status will return ACCEPTABLE versus FINE (If memory serves right).

-Abe
On Tue, Sep 24, 2013 at 12:12 AM, Manish Meshram
<[EMAIL PROTECTED]>wrote:

> Hi Abraham,
>
>    Can you tell me how to give mapreduce cluster access to database.
>    I guess I haven't given it.
>
> Thanks,
>    Manish
>
>
> On Tue, Sep 24, 2013 at 11:54 AM, Abraham Elmahrek <[EMAIL PROTECTED]>wrote:
>
>> Manish,
>>
>> Have you given your mapreduce cluster access to your database? it will be
>> using the credentials in the Connection you created to distribute the
>> process of importing into HDFS.
>>
>> -Abe
>>
>>
>> On Mon, Sep 23, 2013 at 10:52 PM, Manish Meshram <
>> [EMAIL PROTECTED]> wrote:
>>
>>> Hi Abraham,
>>>
>>> That is another problem,I cannot use the commands you said because when
>>> I start client on the same machine(centOS-remote for me) on which server is
>>> running, the server automatically stops.
>>> But when I started the server on centOS(which is remote for me and I am
>>> accessing it through putty)
>>> and I have a sqoop Client API java program in my system(windows 7).
>>> It does not stops the server and my connection established successfully.
>>> Also MySQL server is installed on my system(windows 7) and I have given
>>> remote access to ip address of CentOS system,
>>> that is why my connection get established in 1st step.
>>> I am attaching the source and the output I am getting, please have a
>>> look.
>>>
>>> *Program:*
>>> *
>>> *
>>> public class TestSqoopClient {
>>>  private static void printMessage(List<MForm> formList) {
>>>   for(MForm form : formList) {
>>>     List<MInput<?>> inputlist = form.getInputs();
>>>     if (form.getValidationMessage() != null) {
>>>       System.out.println("Form message: " +
>>> form.getValidationMessage());
>>>     }
>>>     for (MInput minput : inputlist) {
>>>       if (minput.getValidationStatus() == Status.ACCEPTABLE) {
>>>         System.out.println("Warning:" + minput.getValidationMessage());
>>>       } else if (minput.getValidationStatus() == Status.UNACCEPTABLE) {
>>>         System.out.println("Error:" + minput.getValidationMessage());
>>>       }
>>>     }
>>>   }
>>> }
>>>
>>> public static void main(String[] args) {
>>>  try
>>>  {
>>> String url = "http://192.168.3.156:12000/sqoop/";
>>>  SqoopClient client = new SqoopClient(url);
>>>   /*********Connection**********/
>>> //Dummy connection object
>>> MConnection newCon = client.newConnection(1);
>>>
>>> //Get connection and framework forms. Set name for connection
>>> MConnectionForms conForms = newCon.getConnectorPart();
>>>  MConnectionForms frameworkForms = newCon.getFrameworkPart();
>>> newCon.setName("MyConnection");
>>>   /*sample for below code
>>>  * MStringInput m >>> conForms.getStringInput("connection.connectionString");
>>>  m.setValue("");*/
>>>  //Set connection forms values
>>>
>>> conForms.getStringInput("connection.connectionString").setValue("jdbc:mysql://
>>> 10.10.10.103:3306/mydb");
>>>
>>> conForms.getStringInput("connection.jdbcDriver").setValue("com.mysql.jdbc.Driver");
>>> conForms.getStringInput("connection.username").setValue("********");
>>>  conForms.getStringInput("connection.password").setValue("********");
>>> //I masked it.
>>>
>>> frameworkForms.getIntegerInput("security.maxConnections").setValue(0);
>>>
>>> Status status  = client.createConnection(newCon);
>>> if(status.canProceed()) {
>>>  System.out.println("Created. New Connection ID : "