You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Denis Mekhanikov <dm...@gmail.com> on 2018/03/01 09:19:50 UTC

Re: How to configure a cluster as a persistent, replicated SQL database

Jose,

Currently you have to specify a cache name in the connection URL, that will
be used to run SQL queries on.
I'm not sure where it's a bug or a feature, but here is the ticket for
fixing this: https://issues.apache.org/jira/browse/IGNITE-6481
For now you have to specify a cache name, that you want to run your queries
on. Like this:
*jdbc:ignite:cfg://cache=<cache_name>@<config_url>*

It can be any cache, started in advance. You can put configuration of this
cache to your XML configuration and use its name in the connection string.

Denis

ср, 28 февр. 2018 г. в 20:26, joseheitor <jo...@heitorprojects.com>:

> Hey Denis,
>
> I think that we are making progress...
>
> I am now connecting to the database successfully, but when I submit a
> query,
> I get the following error:
>
> <
> http://apache-ignite-users.70518.x6.nabble.com/file/t1652/Screenshot_20180228_190729.png
> >
>
> My config contains the following:
>
> /...
>     <bean class="org.apache.ignite.configuration.IgniteConfiguration">
>
>
>     <property name="clientMode" value="true"/>
>
>     <property name="discoverySpi">
>         <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
>         <property name="ipFinder">
>             <bean
>
> class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
>             <property name="addresses">
>                 <list>
>                 <value>192.168.1.220:47500..47600</value>
>                 <value>192.168.1.230:47500..47600</value>
>                 <value>192.168.1.221:47500..47600</value>
>                 <value>192.168.1.231:47500..47600</value>
>                 </list>
>             </property>
>             </bean>
>         </property>
>         </bean>
>     </property>
>     </bean>
> ...
> /
> What am I doing wrong...?
>
> Jose
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

RE: How to configure a cluster as a persistent, replicated SQLdatabase

Posted by "ilya.kasnacheev" <il...@gmail.com>.
Hello  Naveen!

I guess you have to use CREATE TABLE for caches to be in PUBLIC schema. I'm
afraid it doesn't work that way for if they're created using Ignite API.

Regards,



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

RE: How to configure a cluster as a persistent, replicated SQLdatabase

Posted by Naveen <na...@gmail.com>.
Hi Stan

I was able to setup ignite with Oracle as persistent layer. 
However I still have one concern, the existing Oracle DMLs are not working
with ignite

For e.g

In Oracle below is the insert statement I use

    insert into map_dummy (ENTITY_ID, MAPPING_ID_LIST, RELATIONSHIP,
UPDATEDDATETIME, UPDATEDBY, SEQUENCE_NO, TUPLE_COUNT) values
    ('8','maplist8','rel2',sysdate,'upd2','2','2')

In ignite, I had to prefix with schema

INSERT INTO *"MapDummyCache".*MAP_DUMMY (ENTITY_ID, MAPPING_ID_LIST,
RELATIONSHIP, UPDATEDDATETIME, UPDATEDBY, SEQUENCE_NO, TUPLE_COUNT) values
    ('6','maplist6','rel5',sysdate,'upd5','5','5');

Because of this, I had to change my existing Oracle DMLs to make it work
with Ignite. 
I believe I tried to change the schema to PUBLIC by explicitly setting the
schema while creating the cache, but still no luck,

Any suggestions for this,

Thanks
Naveen



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

RE: How to configure a cluster as a persistent, replicated SQLdatabase

Posted by Stanislav Lukyanov <st...@gmail.com>.
Hi Naveen,

Please refer to this page https://apacheignite.readme.io/docs/3rd-party-store.
In short, you need to implement a CacheStore or use one of the standard implementations (CacheJdbcBlobStore, CacheJdbcPojoStore)
and add it to your cache configuration.
Also, you can set DataRegionConfiguration.persistenceEnabled=false to disable native persistence.

Thanks,
Stan

From: Naveen
Sent: 9 марта 2018 г. 17:09
To: user@ignite.apache.org
Subject: Re: How to configure a cluster as a persistent, replicated SQLdatabase

Hi Jose

I was asking how can I configure Oracle DB as persistent layer.
At the moment I am using the Ignite native persistence as persistent layer,
but I would like to use Oracle DB as persistent layer. 
How can I do this, what changes I should do to the config file.
My config file looks like this for native ignite persistence, what do I need
to add for using Oracle as persistent layer

	  <property name="dataStorageConfiguration">
	    <bean class="org.apache.ignite.configuration.DataStorageConfiguration">
	      <property name="defaultDataRegionConfiguration">
	        <bean
class="org.apache.ignite.configuration.DataRegionConfiguration">
	          <property name="persistenceEnabled" value="true"/>
	        </bean>
	      </property>
	    </bean>
	  </property>

Thanks
Naveen



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: How to configure a cluster as a persistent, replicated SQL database

Posted by Naveen <na...@gmail.com>.
Hi Jose

I was asking how can I configure Oracle DB as persistent layer.
At the moment I am using the Ignite native persistence as persistent layer,
but I would like to use Oracle DB as persistent layer. 
How can I do this, what changes I should do to the config file.
My config file looks like this for native ignite persistence, what do I need
to add for using Oracle as persistent layer

	  <property name="dataStorageConfiguration">
	    <bean class="org.apache.ignite.configuration.DataStorageConfiguration">
	      <property name="defaultDataRegionConfiguration">
	        <bean
class="org.apache.ignite.configuration.DataRegionConfiguration">
	          <property name="persistenceEnabled" value="true"/>
	        </bean>
	      </property>
	    </bean>
	  </property>

Thanks
Naveen



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: How to configure a cluster as a persistent, replicated SQL database

Posted by joseheitor <jo...@heitorprojects.com>.
Hi Naveen,

I managed to get everything up a and running...but for my testing, I have
not been connecting from code.

I have been using DBeaver to connect using SQL via the JDBC driver(s).

Jose



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: How to configure a cluster as a persistent, replicated SQL database

Posted by Naveen <na...@gmail.com>.
Hi Jose

Did it work for you ?
I had the same question.
I wanted to use JDBC client driver to connect to Ignite cluster. 
I am trying to use Java
Would you be able ot share the code snippet if you are using java to connect
to the ignite cluster thru JDBC client driver

Thanks
Naveen



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: How to configure a cluster as a persistent, replicated SQL database

Posted by joseheitor <jo...@heitorprojects.com>.
Okay - figured it out...

Had to prefix the 'PUBLIC' schema to the table name during the CREATE TABLE
query:

CREATE TABLE PUBLIC.City(...



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: How to configure a cluster as a persistent, replicated SQL database

Posted by joseheitor <jo...@heitorprojects.com>.
Hi Denis,

I inserted a cache definition in the config of all the nodes, as
recommended. Then activated the cluster and connected using the client JDBC
driver, specifying the cache name in the connection string... it connected
successfully.

But when I submit a CREATE TABLE query, I receive the error: [1][50000]
"CREATE TABLE can only be executed on PUBLIC schema" (see below).

Must I also specify the schema name in the JDBC driver's connection string?
...or in the XML configs?

<http://apache-ignite-users.70518.x6.nabble.com/file/t1652/Screenshot_20180305_084754.png> 



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/