ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrey Gura <ag...@gridgain.com>
Subject Re: How to start and use ignite in Tomcat
Date Thu, 05 May 2016 14:24:22 GMT

In order to start clint node you should just execute code like this:


In this case client node with default configuration will be started. Of
course you can provide own IgniteConfiguration programatically:

IgniteConfiguration cfg = new IgniteConfiguration();
// ... other settings

or using Spring configuration files:

<beans xmlns="http://www.springframework.org/schema/beans"


    <bean id="ignite.cfg"

        <property name="clientMode" value="true"/>

        <!-- Explicitly configure TCP discovery SPI to provide list of
initial nodes. -->
        <property name="discoverySpi">
                <property name="ipFinder">
                        Ignite provides several options for automatic
discovery that can be used
                        instead os static IP based discovery. For
information on all options refer
                        to our documentation:
                    <!-- Uncomment static IP finder to enable static-based
discovery of initial nodes. -->
                        <property name="addresses">
                                <!-- In distributed environment, replace
with actual host IP address. -->


If you want use JDBC drievr for connection to Ignite cluster there is no
need to create any client nodes.

On Thu, May 5, 2016 at 5:33 AM, minisoft_rm <minisoft_rm@hotmail.com> wrote:

> Dear all,
>  i searched a number of topics here. but still don't know how to start and
> use ignite (in client mode) from Tomcat.... you know, I launched the
> standalone ignite as server node.
> my code in tomcat web app like this:"
> this.ignite =
> Ignition.start(ClientConfigurationFactory.createConfiguration());
> Class.forName("org.apache.ignite.IgniteJdbcDriver");
>                         this.conn = DriverManager
> .getConnection("jdbc:ignite:cfg://cache=b2c_accCache
> @file:///Users/i306576/Documents/ignite/apache-ignite-fabric-1.5.0.final-bin/examples/config/ignite-jdbc.xml");
>                         this.cartCacher = new CartCacher();
>                         this.ic = ignite.cache("b2c_accCache");
> "
> the console log show some error mes I don't understand..."
> Caused by: class org.apache.ignite.IgniteCheckedException: Ignite instance
> with this name has already been started: b2c_acc
> "
> :-(  the thing is.... this kind of client mode is ok without Tomcat...
> please help~~
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/How-to-start-and-use-ignite-in-Tomcat-tp4776.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Andrey Gura
GridGain Systems, Inc.

View raw message