Tomcat上的Neo4J HA

时间:2015-10-18 12:22:17

标签: java tomcat java-ee neo4j tomcat8

或任何Web应用程序服务器。

我在AWS的服务器上站了一台Neo4J主服务器。

我有一个使用Embedded Neo4J的Web应用程序,我希望它与Neo4J服务器集群。

我的设置代码结构如下:

static class ZeusHADatabaseFactory extends HighlyAvailableGraphDatabaseFactory {    

    public GraphDatabaseService newEmbeddedDatabase(String path) {

        System.out.println("New Highly Available Database! " + SystemGlobals.getProperties().getProperty("neo4j.ha.initial_hosts"));
//10.0.0.185:5001

        if(graphDB != null){
            return graphDB;
        }else{
            graphDB = super.newEmbeddedDatabaseBuilder(path)
                    .setConfig(GraphDatabaseSettings.keep_logical_logs, "false")
                    .setConfig(GraphDatabaseSettings.allow_store_upgrade, "true")
                    .setConfig("ha.server_id", "2")
                    .setConfig("ha.inital_hosts", (String)SystemGlobals.getProperties().getProperty("neo4j.ha.initial_hosts"))
                    .newGraphDatabase();   
            graphDB.index().getNodeAutoIndexer().setEnabled(true);
            graphDB.index().getRelationshipAutoIndexer().setEnabled(true);          

            registerShutdownHook(graphDB);


            return graphDB;
        }


    }       

}

但我得到这样的错误:

18-Oct-2015 12:01:40.280 SEVERE [localhost-startStop-1]    org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [org.neo4j.helpers.Format.ThreadLocalFormat] (value [org.neo4j.helpers.Format$ThreadLocalFormat@6d43962d]) and a value of type [java.text.SimpleDateFormat] (value [java.text.SimpleDateFormat@3dee4855]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

18-Oct-2015 12:01:40.286 SEVERE [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [org.neo4j.io.pagecache.impl.muninn.CursorPool.MuninnReadPageCursorThreadLocal] (value [org.neo4j.io.pagecache.impl.muninn.CursorPool$MuninnReadPageCursorThreadLocal@421bc39]) and a value of type [org.neo4j.io.pagecache.impl.muninn.MuninnReadPageCursor] (value [org.neo4j.io.pagecache.impl.muninn.MuninnReadPageCursor@75a2b06e]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

18-Oct-2015 12:01:40.287 SEVERE [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [org.neo4j.io.pagecache.impl.muninn.CursorPool.MuninnWritePageCursorThreadLocal] (value [org.neo4j.io.pagecache.impl.muninn.CursorPool$MuninnWritePageCursorThreadLocal@612ffdbc]) and a value of type [org.neo4j.io.pagecache.impl.muninn.MuninnWritePageCursor] (value [org.neo4j.io.pagecache.impl.muninn.MuninnWritePageCursor@57e92367]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

我的配置是否正确?

更新:我在我的本地机器上工作(使用Resin Java EE服务器)但是当我在AWS上部署到Tomcat时,我仍然收到相同的错误消息。

0 个答案:

没有答案