您好! 请问我想用ignite做缓存, 如何与Spring集成?

yuanjiangzhen 发布于 2016/05/27 13:23
阅读 2K+
收藏 0

@李玉珏 你好,想跟你请教个问题:请问我想用ignite做缓存, 如何与Spring集成?

加载中
0
李玉珏
李玉珏

https://www.zybuluo.com/liyuj/note/261704

你可以看看这里面的内容,有好多这方面配置的例子。

至于Ignite的启动,可以配置成如下的样子:

<bean id="ignite" class="org.apache.ignite.Ignition" factory-method="start">
        <constructor-arg>
            <value>applicationContext-ignite.xml</value>
        </constructor-arg>
    </bean>

0
yuanjiangzhen
yuanjiangzhen

引用来自“李玉珏”的评论

https://www.zybuluo.com/liyuj/note/261704

你可以看看这里面的内容,有好多这方面配置的例子。

至于Ignite的启动,可以配置成如下的样子:

<bean id="ignite" class="org.apache.ignite.Ignition" factory-method="start">
        <constructor-arg>
            <value>applicationContext-ignite.xml</value>
        </constructor-arg>
    </bean>

您好!

1,能建个Q群方便初学者交流吗?

2,我的ignite服务自动停止了。。。。

[15:32:23,587][SEVERE][tcp-disco-msg-worker-#2%null%][TcpDiscoverySpi] TcpDiscoverSpi's message worker thread failed abnormally. Stopping the node in order to prevent cluster wide instability.
java.lang.InterruptedException
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2017)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2095)
        at java.util.concurrent.LinkedBlockingDeque.pollFirst(LinkedBlockingDeque.java:519)
        at java.util.concurrent.LinkedBlockingDeque.poll(LinkedBlockingDeque.java:682)
        at org.apache.ignite.spi.discovery.tcp.ServerImpl$MessageWorkerAdapter.body(ServerImpl.java:5779)
        at org.apache.ignite.spi.discovery.tcp.ServerImpl$RingMessageWorker.body(ServerImpl.java:2161)
        at org.apache.ignite.spi.IgniteSpiThread.run(IgniteSpiThread.java:62)
[15:32:23] Topology snapshot [ver=695, servers=1, clients=0, CPUs=4, heap=1.0GB]
[15:32:29] Ignite node stopped OK [uptime=00:35:07:211]

0
李玉珏
李玉珏

引用来自“李玉珏”的评论

https://www.zybuluo.com/liyuj/note/261704

你可以看看这里面的内容,有好多这方面配置的例子。

至于Ignite的启动,可以配置成如下的样子:

<bean id="ignite" class="org.apache.ignite.Ignition" factory-method="start">
        <constructor-arg>
            <value>applicationContext-ignite.xml</value>
        </constructor-arg>
    </bean>

引用来自“yuanjiangzhen”的评论

您好!

1,能建个Q群方便初学者交流吗?

2,我的ignite服务自动停止了。。。。

[15:32:23,587][SEVERE][tcp-disco-msg-worker-#2%null%][TcpDiscoverySpi] TcpDiscoverSpi's message worker thread failed abnormally. Stopping the node in order to prevent cluster wide instability.
java.lang.InterruptedException
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2017)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2095)
        at java.util.concurrent.LinkedBlockingDeque.pollFirst(LinkedBlockingDeque.java:519)
        at java.util.concurrent.LinkedBlockingDeque.poll(LinkedBlockingDeque.java:682)
        at org.apache.ignite.spi.discovery.tcp.ServerImpl$MessageWorkerAdapter.body(ServerImpl.java:5779)
        at org.apache.ignite.spi.discovery.tcp.ServerImpl$RingMessageWorker.body(ServerImpl.java:2161)
        at org.apache.ignite.spi.IgniteSpiThread.run(IgniteSpiThread.java:62)
[15:32:23] Topology snapshot [ver=695, servers=1, clients=0, CPUs=4, heap=1.0GB]
[15:32:29] Ignite node stopped OK [uptime=00:35:07:211]

你检查一下网络稳不稳定,或者防火墙设置之类的,看样子不像是程序的问题。
0
yuanjiangzhen
yuanjiangzhen

引用来自“李玉珏”的评论

https://www.zybuluo.com/liyuj/note/261704

你可以看看这里面的内容,有好多这方面配置的例子。

至于Ignite的启动,可以配置成如下的样子:

<bean id="ignite" class="org.apache.ignite.Ignition" factory-method="start">
        <constructor-arg>
            <value>applicationContext-ignite.xml</value>
        </constructor-arg>
    </bean>

引用来自“yuanjiangzhen”的评论

您好!

1,能建个Q群方便初学者交流吗?

2,我的ignite服务自动停止了。。。。

[15:32:23,587][SEVERE][tcp-disco-msg-worker-#2%null%][TcpDiscoverySpi] TcpDiscoverSpi's message worker thread failed abnormally. Stopping the node in order to prevent cluster wide instability.
java.lang.InterruptedException
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2017)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2095)
        at java.util.concurrent.LinkedBlockingDeque.pollFirst(LinkedBlockingDeque.java:519)
        at java.util.concurrent.LinkedBlockingDeque.poll(LinkedBlockingDeque.java:682)
        at org.apache.ignite.spi.discovery.tcp.ServerImpl$MessageWorkerAdapter.body(ServerImpl.java:5779)
        at org.apache.ignite.spi.discovery.tcp.ServerImpl$RingMessageWorker.body(ServerImpl.java:2161)
        at org.apache.ignite.spi.IgniteSpiThread.run(IgniteSpiThread.java:62)
[15:32:23] Topology snapshot [ver=695, servers=1, clients=0, CPUs=4, heap=1.0GB]
[15:32:29] Ignite node stopped OK [uptime=00:35:07:211]

引用来自“李玉珏”的评论

你检查一下网络稳不稳定,或者防火墙设置之类的,看样子不像是程序的问题。
都没通过程序去访问远程端的ignite, 只是在Linux上安装 启动了ignite服务
李玉珏
李玉珏
它通过发现机制建立集群,是需要网络的,如果网络有问题,他是无法正常工作的,和你访不访问没关系。
0
yuanjiangzhen
yuanjiangzhen

 

我用eclipse写了一段代码,连172.21.38.70远程机器上的ignite服务端, 报错:

Ignite ignite = Ignition.start("config/example-ignite.xml");
  IgniteCache<String, String> cache = ignite.getOrCreateCache("IgniteTest");
  
  cache.put("key1", "val1");
  cache.put("key2", "val2");

<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
                        <property name="addresses">
                            <list>
                                <!-- In distributed environment, replace with actual host IP address. -->
                                <!-- <value>127.0.0.1:47500..47509</value> -->
                                <value>172.21.38.70:47500..47509</value>
                            </list>
                        </property>
                    </bean>

 

五月 30, 2016 4:31:13 下午 org.apache.ignite.logger.java.JavaLogger error
严重: Failed to start manager: GridManagerAdapter [enabled=true, name=o.a.i.i.managers.discovery.GridDiscoveryManager]
class org.apache.ignite.IgniteCheckedException: Remote node has peer class loading enabled flag different from local [locId8=0d634e1b, locPeerClassLoading=true, rmtId8=b835e64a, rmtPeerClassLoading=false, rmtAddrs=[172.21.38.71/0:0:0:0:0:0:0:1%1, /127.0.0.1, /172.21.38.71]]
 at org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.checkAttributes(GridDiscoveryManager.java:1027)
 at org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.start(GridDiscoveryManager.java:680)
 at org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1505)
 at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:917)
 at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1688)
 at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1547)
 at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1003)
 at org.apache.ignite.internal.IgnitionEx.startConfigurations(IgnitionEx.java:929)
 at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:815)
 at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:714)
 at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:584)
 at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:554)
 at org.apache.ignite.Ignition.start(Ignition.java:347)
 at ignite.test.IgniteTest.main(IgniteTest.java:10)

 

0
理想主义和宅
理想主义和宅

你好,这是写的一篇总结,可以参考一下~

http://tianchenxh.me/2018/01/15/ignite%E5%AE%89%E8%A3%85%E5%92%8CSpringData%E9%9B%86%E6%88%90/

返回顶部
顶部