TL;dr

a memory-centric distributed database, caching, and processing platform for transactional, analytical, and streaming workloads delivering in-memory speeds at petabyte scale

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
wget https://raw.githubusercontent.com/apache/ignite/master/examples/config/example-cache.xml


mkdir -p ignite/ig1
mkdir -p ignite/ig2
mkdir -p ignite/ig3

cd ignite

cat > example-cache.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd">
    
        <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="cacheConfiguration">
            <list>
                <bean class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="name" value="default"/>
                    <property name="atomicityMode" value="ATOMIC"/>
                    <property name="backups" value="1"/>
                </bean>
            </list>
        </property>


        <property name="dataStorageConfiguration">
            <bean class="org.apache.ignite.configuration.DataStorageConfiguration">
                <property name="defaultDataRegionConfiguration">
                    <bean class="org.apache.ignite.configuration.DataRegionConfiguration">
                        <property name="persistenceEnabled" value="true"/>
                        <property name="name" value="vehicle_Region"/>
                        <property name="initialSize" value="#{1L * 1024 * 1024 * 1024}"/>
                        <property name="maxSize" value="#{2L * 1024 * 1024 * 1024}"/>
                    </bean>
                </property>
            </bean>
        </property>



        
        
    </bean>
</beans>
EOF



# -Xms3g -Xmx3g
# -XX:MaxDirectMemorySize=1g
docker run -it --name ignite-1 --rm \
-e "CONFIG_URI=/config/example-cache.xml"  \
-e "JVM_OPTS=-server -XX:+AggressiveOpts -XX:+AlwaysPreTouch -XX:+UseG1GC -XX:+ScavengeBeforeFullGC -XX:+DisableExplicitGC -Djava.net.preferIPv4Stack=true -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8" \
-e IGNITE_WORK_DIR=/persistence \
-v $(pwd)/ig1:/persistence \
-v $(pwd)/example-cache.xml:/config/example-cache.xml \
apacheignite/ignite:2.8.0




[13:50:40] Performance suggestions for grid  (fix if possible)
[13:50:40] To disable, set -DIGNITE_PERFORMANCE_SUGGESTIONS_DISABLED=true
[13:50:40]   ^-- Decrease number of backups (set 'backups' to 0)
[13:50:40]   ^-- Specify JVM heap max size (add '-Xmx<size>[g|G|m|M|k|K]' to JVM options)
[13:50:40]   ^-- Set max direct memory size if getting 'OOME: Direct buffer memory' (add '-XX:MaxDirectMemorySize=<size>[g|G|m|M|k|K]' to JVM options)


# OPTION_LIBS
# ignite-kubernetes,ignite-rest-http
# ports

        ports:
        - containerPort: 11211 # JDBC port number.
        - containerPort: 47100 # communication SPI port number.
        - containerPort: 47500 # discovery SPI port number.
        - containerPort: 49112 # JMX port number.
        - containerPort: 10800 # SQL port number.
        - containerPort: 8080 # REST port number.
        - containerPort: 10900 #Thin clients port number.


# 查看 optional 包
docker run -it --rm apacheignite/ignite:2.8.0 bash -c "ls apache-ignite/libs/optional/"
ignite-aop                      ignite-mqtt
ignite-aws                      ignite-opencensus
ignite-camel                    ignite-osgi
ignite-cassandra-serializers    ignite-osgi-karaf
ignite-cassandra-store          ignite-osgi-paxlogging
ignite-cloud                    ignite-rest-http
ignite-compress                 ignite-rocketmq
ignite-direct-io                ignite-scalar
ignite-flink                    ignite-scalar_2.10
ignite-flume                    ignite-slf4j
ignite-gce                      ignite-spark
ignite-jcl                      ignite-spark-2.4
ignite-jms11                    ignite-spring-data
ignite-jta                      ignite-spring-data_2.0
ignite-kafka                    ignite-spring-data_2.2
ignite-kubernetes               ignite-ssh
ignite-log4j                    ignite-storm
ignite-log4j2                   ignite-twitter
ignite-mesos                    ignite-urideploy
ignite-ml                       ignite-web
ignite-ml-h2o-model-parser      ignite-yarn
ignite-ml-spark-model-parser    ignite-zeromq
ignite-ml-xgboost-model-parser  ignite-zookeeper

spi

Multicast IP Finder

1
2
3
4
5
6
7
8
9
<property name="discoverySpi">
    <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
      <property name="ipFinder">
        <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
          <property name="multicastGroup" value="228.10.10.157"/>
        </bean>
      </property>
    </bean>
  </property>

Static IP Finder

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
  <property name="discoverySpi">
    <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
      <property name="ipFinder">
        <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
          <property name="addresses">
            <list>
              <!-- 
              Explicitly specifying address of a local node to let it start and
              operate normally even if there is no more nodes in the cluster. 
              You can also optionally specify an individual port or port range.
              -->
              <value>1.2.3.4</value>
              
              <!-- 
              IP Address and optional port range of a remote node.
              You can also optionally specify an individual port.
              -->
              <value>1.2.3.5:47500..47509</value>
            </list>
          </property>
        </bean>
      </property>

ZooKeeper IP Finder

1
2
3
4
5
6
7
8
9
    <property name="discoverySpi">
        <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
            <property name="ipFinder">
                <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.zk.TcpDiscoveryZookeeperIpFinder">
                    <property name="zkConnectionString" value="127.0.0.1:2181"/>
                </bean>
            </property>
        </bean>
    </property>

kubernetes IP Finder

1
# https://apacheignite.readme.io/docs/tcpip-discovery#section-kubernetes-ip-finder
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<property name="discoverySpi">
    <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
    <property name="ipFinder">
    <!--
    Enables Kubernetes IP finder and setting custom namespace and service names.
    -->
    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder">
        <property name="namespace" value="default"/>
        <property name="serviceName" value="demo-ignite"/>
    </bean>
    </property>
    </bean>
</property>

ref