You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tajo.apache.org by "Parsian, Mahmoud" <mp...@illumina.com> on 2017/05/19 21:21:25 UTC

Tajo Integration with MySQL

I am trying to access MySQL database from Tajo (the latest version 0.11.3).

This is what I did:

  1.  Added storage-site.json to the …/conf/ directory
  2.  Added mysql-connector-java-5.1.42-bin.jar to …/extlib/

Here is my storage-site.json

{

  "spaces":

  {

      "jdbc_mysql":

      {

        "uri": "jdbc:mysql://MYSERVER:3306/MYDB",

        "configs": {

                     "mapped_database": "tajo_mydb",

                     "connection_properties": {

                                                "user":     “my_username",

                                                "password": “my_password"

                                              }

                   }

      }

  }

}


Please note that in my actual storage-site.json, all username/passwords, db name are VALID.


When I start the server, I get the following error:



2017-05-19 13:47:18,351 FATAL org.apache.tajo.master.TajoMaster: Error starting TajoMaster

java.lang.ExceptionInInitializerError

at org.apache.tajo.master.TajoMaster.serviceInit(TajoMaster.java:186)

at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)

at org.apache.tajo.master.TajoMaster.main(TajoMaster.java:603)

Caused by: org.apache.tajo.exception.TajoRuntimeException: org.apache.tajo.exception.UndefinedTablespaceHandlerException: No tablespace handler for URI scheme 'jdbc:mysql'

at org.apache.tajo.storage.TablespaceManager.initializeTableSpace(TablespaceManager.java:290)

at org.apache.tajo.storage.TablespaceManager.registerTableSpace(TablespaceManager.java:222)

at org.apache.tajo.storage.TablespaceManager.AddTableSpace(TablespaceManager.java:217)

at org.apache.tajo.storage.TablespaceManager.loadTableSpaces(TablespaceManager.java:201)

at org.apache.tajo.storage.TablespaceManager.applyConfig(TablespaceManager.java:162)

at org.apache.tajo.storage.TablespaceManager.initSiteConfig(TablespaceManager.java:135)

at org.apache.tajo.storage.TablespaceManager.<init>(TablespaceManager.java:101)

at org.apache.tajo.storage.TablespaceManager.<clinit>(TablespaceManager.java:91)

... 3 more

Caused by: org.apache.tajo.exception.UndefinedTablespaceHandlerException: No tablespace handler for URI scheme 'jdbc:mysql'

... 11 more

2017-05-19 13:47:18,354 INFO org.apache.tajo.master.TajoMaster: ============================================

2017-05-19 13:47:18,354 INFO org.apache.tajo.master.TajoMaster: TajoMaster received SIGINT Signal

2017-05-19 13:47:18,354 INFO org.apache.tajo.master.TajoMaster: ============================================

2017-05-19 13:47:18,354 INFO org.apache.tajo.master.TajoMaster: Tajo Master main thread exiting

2017-05-19 13:47:18,458 INFO org.apache.tajo.master.TajoMaster: SHUTDOWN_MSG:



Thank you!

Best regards,

Mahmoud



Re: Tajo Integration with MySQL

Posted by Jinho Kim <ji...@gmail.com>.
Great! Parsian, Mahmoud
I look forward to your PR.

Thanks

— Jinho
Best regards

2017-05-22 10:26 GMT+09:00 Parsian, Mahmoud <mp...@illumina.com>:

> Jinho, thank you for replying to my email.
>
> I have implemented  tajo-storage-mysql plugin and tested on
> tajo-0.11.3-src: it works well.
>
> These are the classes I added:
>
>    - public class MySQLJdbcScanner extends JdbcScanner
>    - public class MySQLMetadataProvider extends JdbcMetadataProviderBase
>    - public class MySQLTablespace extends JdbcTablespace
>
> I have tested very little, but would be glad to add them to the Tajo’s GIT.
>
> Best regards,
> Mahmoud Parsian
>
> From: Jinho Kim <ji...@gmail.com>
> Reply-To: "user@tajo.apache.org" <us...@tajo.apache.org>
> Date: Sunday, May 21, 2017 at 5:50 PM
> To: tajo-user <us...@tajo.apache.org>
> Subject: Re: Tajo Integration with MySQL
>
> Hi,
>
> Currently, tajo only support PostgreSQL
>
> Here is the plugins
> http://tajo.apache.org/docs/current/storage_plugins.html
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__tajo.apache.org_docs_current_storage-5Fplugins.html&d=DwMFaQ&c=-czJP1j3ADhzrHyCFvd7gA&r=AENxBNLvKRGkYyvM4QPBiR46t8TZD0yOm7viZRABdSI&m=oLus2ql3tI_Vi4elMRYdcc6vSuFYuctuYGVmK8HtPUs&s=e06fr6JDOBpTmHOfFaeDzbzgaV3Meqm-6idFqP78kgI&e=>
>
> — Jinho
> Best regards
>
> 2017-05-20 6:21 GMT+09:00 Parsian, Mahmoud <mp...@illumina.com>:
>
>> I am trying to access MySQL database from Tajo (the latest version
>> 0.11.3).
>>
>> This is what I did:
>>
>>    1. Added storage-site.json to the …/conf/ directory
>>    2. Added mysql-connector-java-5.1.42-bin.jar to …/extlib/
>>
>>
>> Here is my storage-site.json
>>
>> {
>>
>>   "spaces":
>>
>>   {
>>
>>       "jdbc_mysql":
>>
>>       {
>>
>>         "uri": "jdbc:mysql://MYSERVER:3306/MYDB",
>>
>>         "configs": {
>>
>>                      "mapped_database": "tajo_mydb",
>>
>>                      "connection_properties": {
>>
>>                                                 "user":     “my_username",
>>
>>                                                 "password": “my_password"
>>
>>                                               }
>>
>>                    }
>>
>>       }
>>
>>   }
>>
>> }
>>
>>
>> Please note that in my actual storage-site.json, all username/passwords,
>> db name are VALID.
>>
>>
>> When I start the server, I get the following error:
>>
>>
>>
>> 2017-05-19 13:47:18,351 FATAL org.apache.tajo.master.TajoMaster: Error
>> starting TajoMaster
>>
>> java.lang.ExceptionInInitializerError
>>
>> at org.apache.tajo.master.TajoMaster.serviceInit(TajoMaster.java:186)
>>
>> at org.apache.hadoop.service.AbstractService.init(AbstractServi
>> ce.java:163)
>>
>> at org.apache.tajo.master.TajoMaster.main(TajoMaster.java:603)
>>
>> Caused by: org.apache.tajo.exception.TajoRuntimeException:
>> org.apache.tajo.exception.UndefinedTablespaceHandlerException: No
>> tablespace handler for URI scheme 'jdbc:mysql'
>>
>> at org.apache.tajo.storage.TablespaceManager.initializeTableSpa
>> ce(TablespaceManager.java:290)
>>
>> at org.apache.tajo.storage.TablespaceManager.registerTableSpace
>> (TablespaceManager.java:222)
>>
>> at org.apache.tajo.storage.TablespaceManager.AddTableSpace(Tabl
>> espaceManager.java:217)
>>
>> at org.apache.tajo.storage.TablespaceManager.loadTableSpaces(Ta
>> blespaceManager.java:201)
>>
>> at org.apache.tajo.storage.TablespaceManager.applyConfig(Tables
>> paceManager.java:162)
>>
>> at org.apache.tajo.storage.TablespaceManager.initSiteConfig(Tab
>> lespaceManager.java:135)
>>
>> at org.apache.tajo.storage.TablespaceManager.<init>(TablespaceM
>> anager.java:101)
>>
>> at org.apache.tajo.storage.TablespaceManager.<clinit>(Tablespac
>> eManager.java:91)
>>
>> ... 3 more
>>
>> Caused by: org.apache.tajo.exception.UndefinedTablespaceHandlerException:
>> No tablespace handler for URI scheme 'jdbc:mysql'
>>
>> ... 11 more
>>
>> 2017-05-19 13:47:18,354 INFO org.apache.tajo.master.TajoMaster:
>> ============================================
>>
>> 2017-05-19 13:47:18,354 INFO org.apache.tajo.master.TajoMaster:
>> TajoMaster received SIGINT Signal
>>
>> 2017-05-19 13:47:18,354 INFO org.apache.tajo.master.TajoMaster:
>> ============================================
>>
>> 2017-05-19 13:47:18,354 INFO org.apache.tajo.master.TajoMaster: Tajo
>> Master main thread exiting
>>
>> 2017-05-19 13:47:18,458 INFO org.apache.tajo.master.TajoMaster:
>> SHUTDOWN_MSG:
>>
>>
>>
>> Thank you!
>>
>> Best regards,
>>
>> Mahmoud
>>
>>
>>
>>
>

Re: Tajo Integration with MySQL

Posted by "Parsian, Mahmoud" <mp...@illumina.com>.
Jinho, thank you for replying to my email.

I have implemented  tajo-storage-mysql plugin and tested on tajo-0.11.3-src: it works well.

These are the classes I added:

  *   public class MySQLJdbcScanner extends JdbcScanner
  *
public class MySQLMetadataProvider extends JdbcMetadataProviderBase
  *
public class MySQLTablespace extends JdbcTablespace

I have tested very little, but would be glad to add them to the Tajo’s GIT.

Best regards,
Mahmoud Parsian

From: Jinho Kim <ji...@gmail.com>>
Reply-To: "user@tajo.apache.org<ma...@tajo.apache.org>" <us...@tajo.apache.org>>
Date: Sunday, May 21, 2017 at 5:50 PM
To: tajo-user <us...@tajo.apache.org>>
Subject: Re: Tajo Integration with MySQL

Hi,

Currently, tajo only support PostgreSQL

Here is the plugins
https://urldefense.proofpoint.com/v2/url?u=http-3A__tajo.apache.org_docs_current_storage-5Fplugins.html&d=DwIF-g&c=-czJP1j3ADhzrHyCFvd7gA&r=KAD2xa-I5-9D3L1olHkjyK-wKVxGZp2nMzf1MkQ73Vk&m=yfgq1rOF1th1mjHJki3fnpMZc0XH1hMjkAEl7GpQp6k&s=QYRld2iuu6vNdVdwsb2uXqKWeio_6wU0zRfoPq9Y83Q&e= <https://urldefense.proofpoint.com/v2/url?u=http-3A__tajo.apache.org_docs_current_storage-5Fplugins.html&d=DwMFaQ&c=-czJP1j3ADhzrHyCFvd7gA&r=AENxBNLvKRGkYyvM4QPBiR46t8TZD0yOm7viZRABdSI&m=oLus2ql3tI_Vi4elMRYdcc6vSuFYuctuYGVmK8HtPUs&s=e06fr6JDOBpTmHOfFaeDzbzgaV3Meqm-6idFqP78kgI&e=>

— Jinho
Best regards

2017-05-20 6:21 GMT+09:00 Parsian, Mahmoud <mp...@illumina.com>>:
I am trying to access MySQL database from Tajo (the latest version 0.11.3).

This is what I did:

  1.  Added storage-site.json to the …/conf/ directory
  2.  Added mysql-connector-java-5.1.42-bin.jar to …/extlib/

Here is my storage-site.json

{

  "spaces":

  {

      "jdbc_mysql":

      {

        "uri": "jdbc:mysql://MYSERVER:3306/MYDB",

        "configs": {

                     "mapped_database": "tajo_mydb",

                     "connection_properties": {

                                                "user":     “my_username",

                                                "password": “my_password"

                                              }

                   }

      }

  }

}


Please note that in my actual storage-site.json, all username/passwords, db name are VALID.


When I start the server, I get the following error:



2017-05-19 13:47:18,351 FATAL org.apache.tajo.master.TajoMaster: Error starting TajoMaster

java.lang.ExceptionInInitializerError

at org.apache.tajo.master.TajoMaster.serviceInit(TajoMaster.java:186)

at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)

at org.apache.tajo.master.TajoMaster.main(TajoMaster.java:603)

Caused by: org.apache.tajo.exception.TajoRuntimeException: org.apache.tajo.exception.UndefinedTablespaceHandlerException: No tablespace handler for URI scheme 'jdbc:mysql'

at org.apache.tajo.storage.TablespaceManager.initializeTableSpace(TablespaceManager.java:290)

at org.apache.tajo.storage.TablespaceManager.registerTableSpace(TablespaceManager.java:222)

at org.apache.tajo.storage.TablespaceManager.AddTableSpace(TablespaceManager.java:217)

at org.apache.tajo.storage.TablespaceManager.loadTableSpaces(TablespaceManager.java:201)

at org.apache.tajo.storage.TablespaceManager.applyConfig(TablespaceManager.java:162)

at org.apache.tajo.storage.TablespaceManager.initSiteConfig(TablespaceManager.java:135)

at org.apache.tajo.storage.TablespaceManager.<init>(TablespaceManager.java:101)

at org.apache.tajo.storage.TablespaceManager.<clinit>(TablespaceManager.java:91)

... 3 more

Caused by: org.apache.tajo.exception.UndefinedTablespaceHandlerException: No tablespace handler for URI scheme 'jdbc:mysql'

... 11 more

2017-05-19 13:47:18,354 INFO org.apache.tajo.master.TajoMaster: ============================================

2017-05-19 13:47:18,354 INFO org.apache.tajo.master.TajoMaster: TajoMaster received SIGINT Signal

2017-05-19 13:47:18,354 INFO org.apache.tajo.master.TajoMaster: ============================================

2017-05-19 13:47:18,354 INFO org.apache.tajo.master.TajoMaster: Tajo Master main thread exiting

2017-05-19 13:47:18,458 INFO org.apache.tajo.master.TajoMaster: SHUTDOWN_MSG:



Thank you!

Best regards,

Mahmoud




Re: Tajo Integration with MySQL

Posted by Jinho Kim <ji...@gmail.com>.
Hi,

Currently, tajo only support PostgreSQL

Here is the plugins
http://tajo.apache.org/docs/current/storage_plugins.html

— Jinho
Best regards

2017-05-20 6:21 GMT+09:00 Parsian, Mahmoud <mp...@illumina.com>:

> I am trying to access MySQL database from Tajo (the latest version 0.11.3).
>
> This is what I did:
>
>    1. Added storage-site.json to the …/conf/ directory
>    2. Added mysql-connector-java-5.1.42-bin.jar to …/extlib/
>
>
> Here is my storage-site.json
>
> {
>
>   "spaces":
>
>   {
>
>       "jdbc_mysql":
>
>       {
>
>         "uri": "jdbc:mysql://MYSERVER:3306/MYDB",
>
>         "configs": {
>
>                      "mapped_database": "tajo_mydb",
>
>                      "connection_properties": {
>
>                                                 "user":     “my_username",
>
>                                                 "password": “my_password"
>
>                                               }
>
>                    }
>
>       }
>
>   }
>
> }
>
>
> Please note that in my actual storage-site.json, all username/passwords,
> db name are VALID.
>
>
> When I start the server, I get the following error:
>
>
>
> 2017-05-19 13:47:18,351 FATAL org.apache.tajo.master.TajoMaster: Error
> starting TajoMaster
>
> java.lang.ExceptionInInitializerError
>
> at org.apache.tajo.master.TajoMaster.serviceInit(TajoMaster.java:186)
>
> at org.apache.hadoop.service.AbstractService.init(
> AbstractService.java:163)
>
> at org.apache.tajo.master.TajoMaster.main(TajoMaster.java:603)
>
> Caused by: org.apache.tajo.exception.TajoRuntimeException:
> org.apache.tajo.exception.UndefinedTablespaceHandlerException: No
> tablespace handler for URI scheme 'jdbc:mysql'
>
> at org.apache.tajo.storage.TablespaceManager.initializeTableSpace(
> TablespaceManager.java:290)
>
> at org.apache.tajo.storage.TablespaceManager.registerTableSpace(
> TablespaceManager.java:222)
>
> at org.apache.tajo.storage.TablespaceManager.AddTableSpace(
> TablespaceManager.java:217)
>
> at org.apache.tajo.storage.TablespaceManager.loadTableSpaces(
> TablespaceManager.java:201)
>
> at org.apache.tajo.storage.TablespaceManager.applyConfig(
> TablespaceManager.java:162)
>
> at org.apache.tajo.storage.TablespaceManager.initSiteConfig(
> TablespaceManager.java:135)
>
> at org.apache.tajo.storage.TablespaceManager.<init>(
> TablespaceManager.java:101)
>
> at org.apache.tajo.storage.TablespaceManager.<clinit>(
> TablespaceManager.java:91)
>
> ... 3 more
>
> Caused by: org.apache.tajo.exception.UndefinedTablespaceHandlerException:
> No tablespace handler for URI scheme 'jdbc:mysql'
>
> ... 11 more
>
> 2017-05-19 13:47:18,354 INFO org.apache.tajo.master.TajoMaster:
> ============================================
>
> 2017-05-19 13:47:18,354 INFO org.apache.tajo.master.TajoMaster:
> TajoMaster received SIGINT Signal
>
> 2017-05-19 13:47:18,354 INFO org.apache.tajo.master.TajoMaster:
> ============================================
>
> 2017-05-19 13:47:18,354 INFO org.apache.tajo.master.TajoMaster: Tajo
> Master main thread exiting
>
> 2017-05-19 13:47:18,458 INFO org.apache.tajo.master.TajoMaster:
> SHUTDOWN_MSG:
>
>
>
> Thank you!
>
> Best regards,
>
> Mahmoud
>
>
>
>