【问题标题】:Start ignite in persistent store mode and query using sqlline console以持久存储模式启动 ignite 并使用 sqlline 控制台进行查询
【发布时间】:2019-11-13 18:48:30
【问题描述】:

我正在使用以下配置以持久模式启动 ignite db -

<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:ignite:thin://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)?

注意:我在 ubuntu 18.0.4 中使用的是 Gridgrain ignite 社区版 8.7.5 版

【问题讨论】:

    标签: ignite persistent-storage sqlline


    【解决方案1】:

    最简单的方法是使用control.sh 脚本,您可以在 bin 目录中找到该脚本:

    control.sh --activate
    

    其他方式are documented

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-04
      • 2023-03-19
      • 2012-04-29
      • 2021-12-17
      • 2021-05-23
      • 1970-01-01
      • 2017-03-20
      • 2019-02-02
      相关资源
      最近更新 更多