我在远程Linux服务器上以嵌入模式运行Neo4j ......除了能够连接到Web界面/主机之外,一切运行良好:7474 / webadmin /
使用Neo4j 1.8.2主要稳定版
相关的POM工件:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>2.2.0.RELEASE</version>
<exclusions>
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
<version>1.8.2</version>
<exclusions>
<exclusion>
<artifactId>logback-classic</artifactId>
<groupId>ch.qos.logback</groupId>
</exclusion>
<exclusion>
<artifactId>servlet-api</artifactId>
<groupId>org.mortbay.jetty</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
<version>1.8.2</version>
<exclusions>
<exclusion>
<artifactId>logback-classic</artifactId>
<groupId>ch.qos.logback</groupId>
</exclusion>
</exclusions>
<classifier>static-web</classifier>
</dependency>
Neo4j配置XML文件:
<context:annotation-config />
<context:spring-configured />
<bean id="graphDatabaseService" class="org.neo4j.kernel.EmbeddedGraphDatabase">
<constructor-arg value="#{props['neo4j.location']}" />
<constructor-arg>
<map>
<entry key="enable_remote_shell" value="true" />
</map>
</constructor-arg>
</bean>
<neo4j:config graphDatabaseService="graphDatabaseService" />
<bean id="serverWrapper" class="org.neo4j.server.WrappingNeoServerBootstrapper"
init-method="start" destroy-method="stop">
<constructor-arg ref="graphDatabaseService" />
</bean>
<tx:annotation-driven mode="aspectj"
transaction-manager="transactionManager" />
<neo4j:repositories base-package="com.writelife.server.graph.repository"
repository-impl-postfix="CustomImpl" />
neo4j-server.properties文件:
# location of the database directory
org.neo4j.server.database.location=data/graph.db
org.neo4j.server.webserver.address=0.0.0.0
org.neo4j.server.webserver.port=7474
# Turn https-support on/off
org.neo4j.server.webserver.https.enabled=true
# https port (for all data, administrative, and UI access)
org.neo4j.server.webserver.https.port=7473
# Certificate location (auto generated if the file does not exist)
org.neo4j.server.webserver.https.cert.location=conf/ssl/snakeoil.cert
# Private key location (auto generated if the file does not exist)
org.neo4j.server.webserver.https.key.location=conf/ssl/snakeoil.key
org.neo4j.server.webserver.https.keystore.location=data/keystore
org.neo4j.server.webadmin.rrdb.location=data/rrd
org.neo4j.server.webadmin.data.uri=/db/data/
# REST endpoint of the administration API (used by Webadmin)
org.neo4j.server.webadmin.management.uri=/db/manage/
# Low-level graph engine tuning file
org.neo4j.server.db.tuning.properties=conf/neo4j.properties
org.neo4j.server.http.log.enabled=false
org.neo4j.server.http.log.config=conf/neo4j-http-logging.xml
文件系统上的DB位置:
/opt/neo4j-community-1.8.2/data/graph.db
有人可以解释一下我做错了什么吗?如何在该咨询中监控Web界面?
由于
答案 0 :(得分:2)
您是否按照此处的说明进行操作?
http://docs.neo4j.org/chunked/stable/server-embedded.html
我认为不使用neo4j-server.properties。传递给图形数据库的属性仅用于数据库,而不用于web-ui / http-server。
我认为你可以将它们传递给WrappingNeoServerBootstrapper
似乎正在使用Server-Configurator。还有一个基于属性文件的服务器配置器PropertyFileConfigurator
,它在neo4j-server.properties
文件的构造函数中作为File
对象传递。
我认为你的maven配置也错过了静态资源。
<dependencies>
<dependency>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
<version>1.8.1</version>
</dependency>
<dependency>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
<classifier>static-web</classifier>
<version>1.8.1</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>neo4j-snapshot-repository</id>
<name>Neo4j Maven 2 snapshot repository</name>
<url>http://m2.neo4j.org/content/repositories/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>