Запустите ignite в режиме постоянного хранилища и выполните запрос с помощью консоли sqlline. - PullRequest
0 голосов
/ 03 июля 2019

Я запускаю ИБП в постоянном режиме со следующей конфигурацией -

<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="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
     <!-- Enabling Apache Ignite Persistent Store. -->
        <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>

Эта конфигурация находится в config/default-config.xml файле

После этого я запускаю консоль sqlline, используя -

sqlline.sh --color = true --verbose = true -u JDBC: воспламенить: тонкий: //127.0.0.1/

В консоли при выполнении любого запроса DDL выдается следующая ошибка -

java.sql.SQLException: Can not perform the operation because the cluster is inactive. Note, that the cluster is considered inactive by default if Ignite Persistent Store is used to let all the nodes join the cluster. To activate the cluster call Ignite.active(true).
    at org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:749)
    at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:211)
    at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(JdbcThinStatement.java:474)
    at sqlline.Commands.execute(Commands.java:823)
    at sqlline.Commands.sql(Commands.java:733)
    at sqlline.SqlLine.dispatch(SqlLine.java:795)
    at sqlline.SqlLine.begin(SqlLine.java:668)
    at sqlline.SqlLine.start(SqlLine.java:373)
    at sqlline.SqlLine.main(SqlLine.java:265)

Как мне активировать кластер? где я могу вызвать Ignite.active (true)?

Примечание: я использую Gridgrain ignite Community Edition версии 8.7.5 в Ubuntu 18.0.4

1 Ответ

1 голос
/ 03 июля 2019

Самый простой способ - использовать скрипт control.sh, который вы найдете в каталоге bin:

control.sh --activate

Другие способы задокументированы .

...