Новичок: apache-ignite-2.8.1 default-config.xml изменение сбоя

#java #spring #ignite

#java #spring #ignite

Вопрос:

Я изменил default-config.xml и не смог перезапустить ignite.sh

 <?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<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">
    <!--
        Alter configuration below as needed.
    -->
    <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"/>


        <!-- Enabling Apache Ignite native persistence. -->
    <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"/>
            </bean>
        </property>
        </bean>
    </property>

</beans>
  

Сообщение об ошибке приведено ниже:

 Failed to start grid: Failed to instantiate Spring XML application context [springUrl=file:/home/masapon/bin/apache-ignite-2.8.1-bin/config/default-config.xml, err=Line 32 in XML document from URL [file:/home/masapon/bin/apache-ignite-2.8.1-bin/config/default-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 32; columnNumber: 47; cvc-complex-type.2.4.a: 要素'{"http://www.springframework.org/schema/beans":property}'で始まる無効なコンテンツが見つかりました。'{"http://www.springframework.org/schema/beans":import, "http://www.springframework.org/schema/beans":alias, "http://www.springframework.org/schema/beans":bean, WC[##other:"http://www.springframework.org/schema/beans"], "http://www.springframework.org/schema/beans":beans}'のいずれかが必要です。]

The word "無効なコンテンツ" means "Invalid contents".
  

Пожалуйста, покажите мне правильный конфигурационный файл.

Я изменил default-config.xml к приведенной ниже инструкции, следующей здесь, но не удалось запустить с другими сообщениями об ошибках.

 [19:22:53,965][SEVERE][main][IgniteKernal] Got exception while starting (will rollback startup routine).
class org.apache.ignite.IgniteCheckedException: Failed to start manager: GridManagerAdapter [enabled=true, name=org.apache.ignite.internal.managers.discovery.GridDiscoveryManager]
    at org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1965)
    at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:1276)
    at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:2045)
    at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1703)
    at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1117)
    at org.apache.ignite.internal.IgnitionEx.startConfigurations(IgnitionEx.java:1035)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:921)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:820)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:690)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:659)
    at org.apache.ignite.Ignition.start(Ignition.java:346)
    at org.apache.ignite.startup.cmdline.CommandLineStartup.main(CommandLineStartup.java:300)
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to start SPI: TcpDiscoverySpi [addrRslvr=null, sockTimeout=5000, ackTimeout=5000, marsh=JdkMarshaller [clsFilter=org.apache.ignite.marshaller.MarshallerUtils$1@3f362135], reconCnt=10, reconDelay=2000, maxAckTimeout=600000, soLinger=5, forceSrvMode=false, clientReconnectDisabled=false, internalLsnr=null, skipAddrsRandomization=false]
    at org.apache.ignite.internal.managers.GridManagerAdapter.startSpi(GridManagerAdapter.java:302)
    at org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.start(GridDiscoveryManager.java:943)
    at org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1960)
    ... 11 more
Caused by: class org.apache.ignite.spi.IgniteSpiException: Joining persistence node to in-memory cluster couldn't be allowed due to baseline auto-adjust is enabled and timeout equal to 0
    at org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.checkFailedError(TcpDiscoverySpi.java:1997)
    at org.apache.ignite.spi.discovery.tcp.ServerImpl.joinTopology(ServerImpl.java:1116)
    at org.apache.ignite.spi.discovery.tcp.ServerImpl.spiStart(ServerImpl.java:427)
    at org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.spiStart(TcpDiscoverySpi.java:2099)
    at org.apache.ignite.internal.managers.GridManagerAdapter.startSpi(GridManagerAdapter.java:299)
    ... 13 more
[19:22:58] Ignite node stopped OK [uptime=00:00:37.877]
class org.apache.ignite.IgniteException: Failed to start manager: GridManagerAdapter [enabled=true, name=org.apache.ignite.internal.managers.discovery.GridDiscoveryManager]
    at org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:1067)
    at org.apache.ignite.Ignition.start(Ignition.java:349)
    at org.apache.ignite.startup.cmdline.CommandLineStartup.main(CommandLineStartup.java:300)
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to start manager: GridManagerAdapter [enabled=true, name=org.apache.ignite.internal.managers.discovery.GridDiscoveryManager]
    at org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1965)
    at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:1276)
    at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:2045)
    at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1703)
    at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1117)
    at org.apache.ignite.internal.IgnitionEx.startConfigurations(IgnitionEx.java:1035)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:921)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:820)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:690)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:659)
    at org.apache.ignite.Ignition.start(Ignition.java:346)
    ... 1 more
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to start SPI: TcpDiscoverySpi [addrRslvr=null, sockTimeout=5000, ackTimeout=5000, marsh=JdkMarshaller [clsFilter=org.apache.ignite.marshaller.MarshallerUtils$1@3f362135], reconCnt=10, reconDelay=2000, maxAckTimeout=600000, soLinger=5, forceSrvMode=false, clientReconnectDisabled=false, internalLsnr=null, skipAddrsRandomization=false]
    at org.apache.ignite.internal.managers.GridManagerAdapter.startSpi(GridManagerAdapter.java:302)
    at org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.start(GridDiscoveryManager.java:943)
    at org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1960)
    ... 11 more
Caused by: class org.apache.ignite.spi.IgniteSpiException: Joining persistence node to in-memory cluster couldn't be allowed due to baseline auto-adjust is enabled and timeout equal to 0
    at org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.checkFailedError(TcpDiscoverySpi.java:1997)
    at org.apache.ignite.spi.discovery.tcp.ServerImpl.joinTopology(ServerImpl.java:1116)
    at org.apache.ignite.spi.discovery.tcp.ServerImpl.spiStart(ServerImpl.java:427)
    at org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.spiStart(TcpDiscoverySpi.java:2099)
    at org.apache.ignite.internal.managers.GridManagerAdapter.startSpi(GridManagerAdapter.java:299)
    ... 13 more
Failed to start grid: Failed to start manager: GridManagerAdapter [enabled=true, name=org.apache.ignite.internal.managers.discovery.GridDiscoveryManager]
  

(и гораздо больше сообщений об ошибках)

Комментарии:

1. Как это выглядело до того, как вы его изменили?

2. Наконец, я обнаружил, что все узлы должны быть закрыты, прежде чем какой-либо узел перейдет в режим сохранения. Огромное спасибо Владимиру!

Ответ №1:

Ваша xml конфигурация недопустима. Свойство dataStorageConfiguration должно находиться внутри IgniteConfiguration , потому что это поле соответствующего класса. Вы должны добавить закрывающий тег к ignite.cfg компоненту и удалить самозакрывающийся тег. Ваш 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"
       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">
        <!-- Enabling Apache Ignite native persistence. -->
        <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"/>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>
  

Комментарии:

1. Спасибо за ваш ответ. Но я не смог запустить из-за другой ошибки, как показано ниже.

2. У вас где-то в вашей сети запущен узел в памяти. Значимое сообщение об ошибке является Joining persistence node to in-memory cluster couldn't be allowed due to baseline auto-adjust is enabled and timeout equal to 0 . Не могли бы вы, пожалуйста, объяснить, чего вы пытаетесь достичь с конфигурацией кластера, имеющей постоянные и непостоянные узлы?