首页 > 其他分享 >ignite系列之3--如何单机或者多机部署多集群

ignite系列之3--如何单机或者多机部署多集群

时间:2023-02-15 14:14:22浏览次数:38  
标签:ignite 49520 .. -- 49500 集群 多机

如何单机或者多机部署多集群

discovery port为集群发现端口

comminication port为 集群节点间通信端口,不同集群间配置不同端口,则组成不同集群

配置示例:

<property name="discoverySpi">
            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <!-- Initial local port to listen to. -->
                <property name="localPort" value="49500"/>

                <!-- Changing local port range. This is an optional action. -->
                <property name="localPortRange" value="1"/>

                <!-- Setting up IP finder for this cluster -->
                <property name="ipFinder">
                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                        <property name="addresses">
                            <list>
                                <!--
                                Addresses and port range of the nodes from the second cluster.
                                127.0.0.1 can be replaced with actual IP addresses or host names. Port range is optional.
                                -->
                                                                <value>10.20.145.91:49500</value>
                                                                <!--Replace the above with the following-->
                                <!--
                                <value>${ip1}:49500..49520</value>
                                <value>${ip2}:49500..49520</value>
                                <value>${ip3}:49500..49520</value>
                                -->
                            </list>
                        </property>
                    </bean>
                </property>
                <!--单位 毫秒 ms-->
                <property name="statisticsPrintFrequency" value="30000"/>
                <property name="reconnectCount" value="10"/>
                <property name="networkTimeout" value="5000"/>
                <property name="socketTimeout" value="5000"/>
                <property name="ackTimeout" value="5000"/>
                <property name="joinTimeout" value="0"/>
            </bean>
        </property> 
<!--
        Explicitly configure TCP communication SPI changing local port number
        for the nodes from the second cluster.
        -->
        <property name="communicationSpi">
            <bean class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">
                <property name="localPort" value="49100"/>
                <property name="localPortRange" value="1"/>
            </bean>
        </property>

完整配置参考:

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/util
        http://www.springframework.org/schema/util/spring-util.xsd">
    <bean abstract="true" id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
        <!-- Set to true to enable distributed class loading for examples, default is false. -->
        <property name="peerClassLoadingEnabled" value="true"/>

        <property name="igniteInstanceName" value="igniteIgniteInstance"/>

        <property name="workDirectory" value="/opt/ignite/app/bigdata-ignite/work"/>
        <!--
        <property name="workDirectory" value="/opt/ignite/app/bigdata-ignite${workDirectory}"/>
        -->

        <property name="discoverySpi">
            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <!-- Initial local port to listen to. -->
                <property name="localPort" value="49500"/>

                <!-- Changing local port range. This is an optional action. -->
                <property name="localPortRange" value="1"/>

                <!-- Setting up IP finder for this cluster -->
                <property name="ipFinder">
                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                        <property name="addresses">
                            <list>
                                <!--
                                Addresses and port range of the nodes from the second cluster.
                                127.0.0.1 can be replaced with actual IP addresses or host names. Port range is optional.
                                -->
                                                                <value>10.20.145.91:49500</value>
                                                                <!--Replace the above with the following-->
                                <!--
                                <value>${ip1}:49500..49520</value>
                                <value>${ip2}:49500..49520</value>
                                <value>${ip3}:49500..49520</value>
                                -->
                            </list>
                        </property>
                    </bean>
                </property>
                <!--单位 毫秒 ms-->
                <property name="statisticsPrintFrequency" value="30000"/>
                <property name="reconnectCount" value="10"/>
                <property name="networkTimeout" value="5000"/>
                <property name="socketTimeout" value="5000"/>
                <property name="ackTimeout" value="5000"/>
                <property name="joinTimeout" value="0"/>
            </bean>
        </property>

        <!--
        Explicitly configure TCP communication SPI changing local port number
        for the nodes from the second cluster.
        -->
        <property name="communicationSpi">
            <bean class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">
                <property name="localPort" value="49100"/>
                <property name="localPortRange" value="1"/>
            </bean>
        </property>

        <!--默认数据区配置,用于堆外存储数据-->
        <property name="dataStorageConfiguration">
            <bean class="org.apache.ignite.configuration.DataStorageConfiguration">
                <!--
                Default memory region that grows endlessly. Any cache will be bound to this memory region
                unless another region is set in the cache's configuration.
                -->
                <property name="defaultDataRegionConfiguration">
                    <bean class="org.apache.ignite.configuration.DataRegionConfiguration">
                        <property name="name" value="Default_Region"/>
                        <!-- 100 MB memory region with disabled eviction. -->
                        <property name="initialSize" value="#{1L * 1024 * 1024 * 1024}"/>
                        <property name="maxSize" value="#{1L * 1024 * 1024 * 1024}"/>
                    </bean>
                </property>
            </bean>
        </property>
        <!--jdbc端口范围配置-->
        <property name="clientConnectorConfiguration">
            <bean class="org.apache.ignite.configuration.ClientConnectorConfiguration" >
                <property name="port" value="10800"/>
                <property name="portRange" value="1"/>
            </bean>
        </property>
        <!-- Configure internal thread pool. -->
        <property name="publicThreadPoolSize" value="64"/>
        <!-- Configure system thread pool. -->
        <property name="systemThreadPoolSize" value="32"/>
        <!-- 类加载,对应缓存中key-value类,本地路径和扫描频率-->
        <property name="deploymentSpi">
            <bean class="org.apache.ignite.spi.deployment.uri.UriDeploymentSpi">
                <property name="temporaryDirectoryPath" value="/opt/ignite/app/bigdata-ignite/tmp/temp_ignite_libs"/>
                <property name="uriList">
                    <list>
                        <value>file://freq=3000@localhost/opt/ignite/app/bigdata-ignite/user_libs</value>
                        <!--
                        <value>file://freq=${cache_classLoader_scan_freq}@localhost/opt/ignite/app/bigdata-ignite${cache_classLoad_scan_path}</value>
                        -->
                    </list>
                </property>
            </bean>
        </property>
    </bean>
    <bean parent="ignite.cfg"/>
</beans>

 

标签:ignite,49520,..,--,49500,集群,多机
From: https://www.cnblogs.com/yangh2016/p/17122577.html

相关文章

  • 装备制造业数字化转型CRM系统解决方案(信息图)
    一、制造企业面临的机遇与挑战2021年12月28日,工业和信息化部等八部门联合对外发布《“十四五”智能制造发展规划》,明确提到“推进智能制造,要立足制造本质,紧扣智能特征,以工......
  • 将博客搬至CSDN
    尊敬的CSDN工作人员:您好!&nsbp;&nsbp;很开心看到CSDN可以搬家,我这边蠢蠢欲动地试试看吧,恭喜发财,谢谢谢谢!&nsbp;&nsbp;此致&nsbp;&nsbp;敬礼!......
  • ignite系列之4--jdbc端口xml配置
    jdbc端口xml配置<!--jdbc端口范围配置--><propertyname="clientConnectorConfiguration"><beanclass="org.apache.ignite.configuration.Clie......
  • openoffice 文件转化为pdf
    /**转换组件属性设置*/functionOpenOfficeMakePropertyValue($name,$value,$osm){$oStruct=$osm->Bridge_GetStruct("com.sun.star.beans.PropertyValu......
  • 数论笔记-同余
    目录同余带余数除法带余数除法的定义与基本性质模运算加速算法模运算封装龟速乘快速幂矩阵快速幂同余的定义与基本性质同余类与剩余系的定义与基本性质欧拉函数欧拉函数的......
  • 时隔多年,这次我终于把动态代理的源码翻了个地儿朝天
    本文内容整理自博学谷狂野架构师动态代理简介​ Proxy模式是常用的设计模式,其特征是代理类与委托类有同样的接口,代理类主要负责为委托类预处理消息、过滤消息、把消......
  • ignite系列之5--xml配置默认数据区大小(堆外内存,占用服务器内存)
    -xml配置默认数据区大小(堆外内存,占用服务器内存)<!--默认数据区配置,用于堆外存储数据--><propertyname="dataStorageConfiguration"><beanclass......
  • eclipse中robot项目界面配置
    1、调整为robot视图 2、运行时报编码错误,调整编码配置 3、查看打印结果,点击后添加输出栏 ......
  • maven基础
    1、maven创建的项目框架 2、maven项目构建环节  3、pom.xml​文件maven项目通过​pom.xml​文件来对项目进行依赖管理,在​pom.xml​中,依赖(也就是第三方jar包)......
  • 直播系统搭建,docker Elasticsearch 7.16.1 设置密码
    直播系统搭建,dockerElasticsearch7.16.1设置密码1、启动容器 dockerrun-d-p9200:9200-p9300:9300--hostnamees--networkseata_default-e"discovery.typ......