Ignite系列之2-xml如何配置代码部署

xml如何配置代码部署

<!-- 类加载,对应缓存中key-value类,本地路径和扫描频率-->
        <property name="deploymentSpi">
            <bean class="org.apache.ignite.spi.deployment.uri.UriDeploymentSpi">
                <property name="temporaryDirectoryPath" value="${workspace}/bigdata-ignite/tmp/temp_ignite_libs"/>
                <property name="uriList">
                    <list>
                        <value>file://freq=3000@localhost${workspace}/bigdata-ignite/user_libs</value>
                        <!--
                        <value>file://freq=${cache_classLoader_scan_freq}@localhost${workspace}/bigdata-ignite${cache_classLoad_scan_path}</value>
                        -->
                    </list>
                </property>
            </bean>
        </property>

完成配置xml

<?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>

 

posted @ 2023-02-15 13:55  life_start  阅读(111)  评论(0编辑  收藏  举报