使用Jdbc连接Persistent:无法执行操作,因为群集处于非活动状态

时间:2017-08-14 07:22:48

标签: ignite

我从Ignite.sh开始点燃2.1,而Config是

        

    <property name="persistentStoreConfiguration">
        <bean class="org.apache.ignite.configuration.PersistentStoreConfiguration">
            <property name="persistentStorePath" value="/tools/ignite/ignite-save/presisent/"></property>
            <property name="walStorePath" value="/tools/ignite/ignite-save/wal/"/>
        </bean>
    </property>
</bean>

我使用jdbc连接它,有一个错误,activeOnStart没用,我怎么能激活节点?如果我使用主类开始点燃并设置点燃活动,没关系,我怎么能主动点燃节点由ignite.sh ??

   Exception in thread "main" java.sql.SQLException: Failed to query Ignite.
        at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:123)
        at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.executeUpdate(JdbcThinStatement.java:129)
        at org.apache.ignite.examples.datagrid.JdbcExample.main(JdbcExample.java:50)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
    Caused by: class org.apache.ignite.IgniteCheckedException: Error server response: [req=JdbcQueryExecuteRequest [schemaName=null, pageSize=1024, maxRows=0, sqlQry=CREATE TABLE city (id LONG PRIMARY KEY, name VARCHAR) WITH "template=replicated", args=null], resp=JdbcResponse [res=null, status=1, err=class org.apache.ignite.internal.processors.query.IgniteSQLException: Unexpected DLL operation failure: 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.activate(true).]]
        at org.apache.ignite.internal.jdbc.thin.JdbcThinTcpIo.sendRequest(JdbcThinTcpIo.java:253)
        at org.apache.ignite.internal.jdbc.thin.JdbcThinTcpIo.queryExecute(JdbcThinTcpIo.java:227)
        at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:109)
        ... 7 more

1 个答案:

答案 0 :(得分:1)

您可以使用$ IGNITE_HOME / bin / control.sh脚本来激活/停用群集。