Client Only Server that doesn't rely on Nodes on intialisation?

classic Classic list List threaded Threaded
8 messages Options
Dabbo Dabbo
Reply | Threaded
Open this post in threaded view
|

Client Only Server that doesn't rely on Nodes on intialisation?

Hi,

When using Apache ignite version 1.0.3, I was able to set the tomcat server to run as CLIENT_ONLY and would start up OK, with some of our own code to wait for worker nodes to attach to the cluster and then start pushing out jobs.

I've just updated to 1.3.2 and now tomcat7/Spring will not initialise until at least one worker node has connected to the client only server.  This is a problem for me due to the way the application is designed.  

The worker nodes uses a server URL to pull the Ignite configuration down - without the server starting up, the worker node hangs waiting for a valid HTTP response and the server hangs because it doesn't have a worker node attached.

Is there a way to configure the server to ignore the state of the cluster (DiscoverySpi?)and allow tomcat7/Spring to initialise? It would be ideal if I can postpone the discoverSPi from polling after tomcat7/Spring has initialised?
Dabbo Dabbo
Reply | Threaded
Open this post in threaded view
|

Re: Client Only Server that doesn't rely on Nodes on intialisation?

I've tried turning off client only mode, which allows things to move forward.  However, I only want jobs to run on the cluster group (ie. ROLE=WORKER). (https://apacheignite.readme.io/docs/cluster-groups : Cluster Groups with Nodes Attributes)

However, the server acquires the cache "ASSET" now and when I do the affinity call on the cluster group based on the attribute "ROLE", it picks the server (due to the server holding the data on it's ASSET cache).

I cant find any documentation on how to distribute the ASSET cache only on a particular cluster group OR push the data on a particular cluster group before the affinity call so that it never picks the server to run on.

Any ideas?
Dabbo Dabbo
Reply | Threaded
Open this post in threaded view
|

Re: Client Only Server that doesn't rely on Nodes on intialisation?

Sorry, I missed some vital information.  Our worker nodes get their configuration from the server node - with some inherited xml config - I've just realised this and will look at splitting this up to separate the cache config for a worker and server node respectively.

Sorry, this might be a non-issue.
Dabbo Dabbo
Reply | Threaded
Open this post in threaded view
|

Re: Client Only Server that doesn't rely on Nodes on intialisation?

My alternative solution didn't work.

We need a solution where we can get the worker nodes to obtain configuration form the server node (client only) via URL.  This allows us to easily deploy worker nodes across the network with little copying/updating of the Ignite configuration.

Client Only mode waits for a non-client to connect to the cluster, this prevents out Spring configuration from completing whilst it polls making http requests time out.

My work-around for another issue is to deploy the Ignite configuration locally for each worker node.

Version 1.0.6 did not have this restriction in place.
yakov yakov
Reply | Threaded
Open this post in threaded view
|

Re: Client Only Server that doesn't rely on Nodes on intialisation?

Daddo,

Client node can finish start only if there are running servers in topology. Please see this for details - https://apacheignite.readme.io/docs/clients-vs-servers

From my standpoint you mess configuration and deployment of the application. Why don't you just put some simple http server apart of your tomcat cluster to serve ignite configurations?

If you want to go with your current solution you can force server mode discovery on your clients. See Forcing Server Mode On Client Nodes section on the page https://apacheignite.readme.io/docs/clients-vs-servers

Thanks!
dsetrakyan dsetrakyan
Reply | Threaded
Open this post in threaded view
|

Re: Client Only Server that doesn't rely on Nodes on intialisation?

In reply to this post by Dabbo


On Fri, Jul 31, 2015 at 7:02 AM, Dabbo <[hidden email]> wrote:
Version 1.0.6 did not have this restriction in place.

I believe version 1.0.6 didn't have the "client-mode" yet, only server mode. As Yakov suggested, you can force the server mode discovery from client nodes if you really need this behavior.
Dabbo Dabbo
Reply | Threaded
Open this post in threaded view
|

Re: Client Only Server that doesn't rely on Nodes on intialisation?

Ah, perfect - I must have missed that vital setting when reading that page before - my apologies! :S
Dabbo Dabbo
Reply | Threaded
Open this post in threaded view
|

Re: Client Only Server that doesn't rely on Nodes on intialisation?

To clarify the solution that worked for me;

Using XML based configuration, I added the property line...


<bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
    ...
    <property name="discoverySpi">
        <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">

            <property name="forceServerMode" value="true"/>
            ...