gridgain / gridgain-old

267 stars 85 forks source link

Embedded GridGain #29

Closed rgilles closed 10 years ago

rgilles commented 10 years ago

Hi GridGain, I'm trying to embedded GridGain DataGrid. I get this wraning at start up:

[17:48:36,039][WARN ][main][G] Failed to detect GridGain installation home. It was neither provided in GridConfiguration nor it could be detected from GRIDGAIN_HOME system property or environmental variable.
[17:48:36,148][INFO ][main][GridKernal] 

Is there a way to avoid to specify the GRIDGAIN_HOME ?

Thanks,

Romain.

rgilles commented 10 years ago

Just after this warning I get this exception:

Caused by: class org.gridgain.grid.spi.GridSpiException: Invalid Jetty configuration file: config/rest/rest-jetty.xml
For more information see:
    Troubleshooting:      http://bit.ly/GridGain-Troubleshooting
    Documentation Center: http://bit.ly/GridGain-Documentation

    at org.gridgain.grid.kernal.processors.rest.protocols.http.jetty.GridJettyRestProtocol.start(GridJettyRestProtocol.java:117)
    at org.gridgain.grid.kernal.processors.rest.GridRestProcessor.startProtocol(GridRestProcessor.java:389)
    at org.gridgain.grid.kernal.processors.rest.GridRestProcessor.start(GridRestProcessor.java:338)
    at org.gridgain.grid.kernal.GridKernal.startProcessor(GridKernal.java:1458)
    ... 34 more

How can I avoid the jetty server startup? If the jetty server is required how can I specify the jetty configuration in an other way?

Thanks,

Romain

agoncharuk commented 10 years ago

GRIDGAIN_HOME is not required for node startup.

If you do not need REST/client functionality, you can disable rest by setting restEnabled=false in GridGonfiguration.

Otherwise, you need to copy jetty server configuration (config/rest/rest-jetty.xml) to your application folder from GridGain distribution and specify path to this config in GridConfiguration via setRestJettyPath(...)

In both cases node starts fine for me in embedded mode without GRIDGAIN_HOME

rgilles commented 10 years ago

Hi, Thanks, It works perfectly now! I have now a small issue. How can change the work directory.

Thanks,

Romain

rgilles commented 10 years ago

Ok I found a workaround. I point the GRIDGAIN_HOME system property to my "work" (a.k.a. data) folder and run like a charm.

Romain

dsetrakyan commented 10 years ago

We have fixed it not to require jetty configuration file unless you need to change something in it. Expect it in the upcoming 6.0.3 release.

rgilles commented 10 years ago

It works now for me. Thanks,

Romain.