apache-ignite
1<?xml version="1.0" encoding="UTF-8"?>
2
3<!--
4Licensed to the Apache Software Foundation (ASF) under one or more
5contributor license agreements. See the NOTICE file distributed with
6this work for additional information regarding copyright ownership.
7The ASF licenses this file to You under the Apache License, Version 2.0
8(the "License"); you may not use this file except in compliance with
9the License. You may obtain a copy of the License at
10
11http://www.apache.org/licenses/LICENSE-2.0
12
13Unless required by applicable law or agreed to in writing, software
14distributed under the License is distributed on an "AS IS" BASIS,
15WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16See the License for the specific language governing permissions and
17limitations under the License.
18-->
19
20<!--
21Ignite Spring configuration file to startup grid cache.
22
23When starting a standalone Ignite node, you need to execute the following command:
24{IGNITE_HOME}/bin/ignite.{bat|sh} examples/config/spring-cache.xml
25
26When starting Ignite from Java IDE, pass path to this file into Ignition:
27Ignition.start("examples/config/spring-cache.xml");
28-->
29<beans xmlns="http://www.springframework.org/schema/beans"30xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"31xmlns:util="http://www.springframework.org/schema/util"32xsi:schemaLocation="33http://www.springframework.org/schema/beans
34http://www.springframework.org/schema/beans/spring-beans.xsd
35http://www.springframework.org/schema/util
36http://www.springframework.org/schema/util/spring-util.xsd">37<!--38Configuration below demonstrates how to setup caches within grid nodes.
39-->
40<bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">41<property name="deploymentMode" value="SHARED"/>42
43<!--44For better performance set this property to false in case
45peer deployment is not used.
46Default value is false.
47-->
48<property name="peerClassLoadingEnabled" value="true"/>49
50<!--51Configure binary marshaller.
52-->
53<property name="marshaller">54<bean class="org.apache.ignite.internal.binary.BinaryMarshaller" />55</property>56
57<!-- Set to local host address just for examples. -->58<property name="localHost" value="127.0.0.1"/>59
60<!-- Configure REST TCP server address. -->61<property name="connectorConfiguration">62<bean class="org.apache.ignite.configuration.ConnectorConfiguration">63<property name="host" value="127.0.0.1"/>64</bean>65</property>66
67<!--68Enable cache events.
69-->
70<property name="includeEventTypes">71<util:constant static-field="org.apache.ignite.events.EventType.EVTS_CACHE"/>72</property>73
74<property name="cacheConfiguration">75<!--76Specify list of cache configurations here. Any property from
77CacheConfiguration interface can be configured here.
78Note that absolutely all configuration properties are optional.
79-->
80<list>81<!--82Partitioned cache example configuration (Atomic mode).
83-->
84<bean class="org.apache.ignite.configuration.CacheConfiguration">85<property name="name" value="partitioned"/>86
87<property name="cacheMode" value="PARTITIONED"/>88
89<!-- Only atomic updates will be supported. -->90<property name="atomicityMode" value="ATOMIC"/>91
92<!-- Enable primary sync write mode. -->93<property name="writeSynchronizationMode" value="PRIMARY_SYNC"/>94
95<!--96This shows how to configure number of backups. The below configuration
97sets the number of backups to 1 (which is default).
98-->
99<property name="backups" value="1"/>100
101<!-- Set synchronous rebalancing (default is asynchronous). -->102<property name="rebalanceMode" value="SYNC"/>103</bean>104
105<!--106Partitioned cache example configuration (Transactional mode).
107-->
108<bean class="org.apache.ignite.configuration.CacheConfiguration">109<property name="name" value="partitioned_tx"/>110
111<property name="cacheMode" value="PARTITIONED"/>112
113<!-- Transactional updates supported. -->114<property name="atomicityMode" value="TRANSACTIONAL"/>115
116<!-- Enable near cache to cache recently accessed data. -->117<property name="nearConfiguration">118<bean class="org.apache.ignite.configuration.NearCacheConfiguration"/>119</property>120
121<!--122Setting this value will cause local node to wait for remote commits.
123However, it's important to set it this way in the examples as we assert on
124conditions that usually assume full completion of transactions on all nodes.
125-->
126<property name="writeSynchronizationMode" value="FULL_SYNC"/>127
128<!--129This shows how to configure number of backups. The below configuration
130sets the number of backups to 1 (which is default).
131-->
132<property name="backups" value="1"/>133
134<!-- Set synchronous rebalancing (default is asynchronous). -->135<property name="rebalanceMode" value="SYNC"/>136</bean>137
138<!--139Replicated cache example configuration.
140-->
141<bean class="org.apache.ignite.configuration.CacheConfiguration">142<property name="name" value="replicated"/>143
144<!--145Setting this value will cause local node to wait for remote commits.
146However, it's important to set it this way in the examples as we assert on
147conditions that usually assume full completion of transactions on all nodes.
148-->
149<property name="writeSynchronizationMode" value="FULL_SYNC"/>150
151<!-- REPLICATED cache mode. -->152<property name="cacheMode" value="REPLICATED"/>153
154<!-- Set synchronous rebalancing (default is asynchronous). -->155<property name="rebalanceMode" value="SYNC"/>156</bean>157</list>158</property>159
160<!--161Uncomment this to provide TCP discovery SPI (Amazon EC2).
162-->
163<!--164<property name="discoverySpi">
165<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
166<property name="ipFinder">
167<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder">
168<property name="awsCredentials">
169<bean class="com.amazonaws.auth.BasicAWSCredentials">
170<constructor-arg value="YOUR_ACCESS_KEY_ID" />
171<constructor-arg value="YOUR_SECRET_ACCESS_KEY" />
172</bean>
173</property>
174<property name="bucketName" value="YOUR_BUCKET_NAME_IP_FINDER"/>
175</bean>
176</property>
177</bean>
178</property>
179-->
180
181<!--182Uncomment this to provide TCP discovery SPI (Local network).
183
184If path to shared file system is not explicitly provided,
185then only local nodes will be able to discover each other.
186-->
187<!--188<property name="discoverySpi">
189<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
190<property name="ipFinder">
191<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.sharedfs.TcpDiscoverySharedFsIpFinder">
192<property name="path" value="work/disco/tcp"/>
193</bean>
194</property>
195</bean>
196</property>
197-->
198
199<!--200TCP discovery SPI configuration with predefined addresses.
201Use the addresses list to provide IP addresses of initial nodes in the grid
202(at least one address must be provided).
203
204Note:
205=====
206If running in distributed environment, you should change IP addresses to the actual IP addresses
207of the servers on your network. Not all addresses need to be specified, only the addresses
208of one or more servers which will always be started first.
209-->
210<property name="discoverySpi">211<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">212<property name="ipFinder">213<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">214<property name="addresses">215<list>216<!--217List all IP/port configurations that potentially
218can be started first in examples. We are assuming
219grid of size 10 or less.
220-->
221<value>127.0.0.1:47500</value>222<value>127.0.0.1:47501</value>223<value>127.0.0.1:47502</value>224<value>127.0.0.1:47503</value>225<value>127.0.0.1:47504</value>226<value>127.0.0.1:47505</value>227<value>127.0.0.1:47506</value>228<value>127.0.0.1:47507</value>229<value>127.0.0.1:47508</value>230<value>127.0.0.1:47509</value>231</list>232</property>233</bean>234<!--235Uncomment this to provide IP finder using multicast for nodes discovery.
236In addition to addresses received via multicast this finder can work with pre-configured
237list of addresses.
238-->
239<!--240<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
241<property name="addresses">
242<list>
243<value>host1:port1</value>
244<value>host2:port2</value>
245</list>
246</property>
247</bean>
248-->
249</property>250</bean>251</property>252</bean>253</beans>254