2013-06-25 48 views
0

我有一台Windows 7 x64机器。我安装了非常顺利的neo4j。然后我设法安装了neo4django和neo4j-embedded,这也很好。移动目录后无法启动neo4j服务

但是我决定改变它所在的目录,所以我停止了PowerShell中的neo4j服务并将它移到了不同​​的地方。从那时起,我一直无法重新启动服务,但是如果我运行控制台,它会在java.exe窗口中启动neo4j(我认为),因此它可以工作(localhost:7474可访问,能够运行neo4j嵌入式示例脚本等),直到我关闭该java.exe窗口。

这是我在PowerShell中得到了输出:

PS G:\dev files\neo4j\bin> .\neo4j start 
[SC] StartService FAILED 1053: 

The service did not respond to the start or control request in a timely fashion. 

PS G:\dev files\neo4j\bin> .\neo4j console 
25/06/13 9:36:57 PM org.neo4j.server.AbstractNeoServer INFO: Setting startup timeout to: 120000ms based on -1 
Detected incorrectly shut down database, performing recovery.. 
25/06/13 9:36:59 PM org.neo4j.server.database.Database INFO: Loaded neo4j tuning properties from conf/neo4j.properties 
25/06/13 9:37:01 PM org.neo4j.server.database.Database INFO: Successfully started database 
25/06/13 9:37:02 PM org.neo4j.server.AbstractNeoServer INFO: Starting Neo Server on port [7474] with [80] threads available 
25/06/13 9:37:02 PM org.neo4j.server.AbstractNeoServer INFO: Enabling HTTPS on port [7473] 
25/06/13 9:37:03 PM org.neo4j.server.modules.DiscoveryModule INFO: Mounted discovery module at [/] 
25/06/13 9:37:03 PM org.neo4j.server.modules.RESTApiModule INFO: Mounted REST API at [/db/data/] 
25/06/13 9:37:03 PM org.neo4j.server.modules.ManagementApiModule INFO: Mounted management API at [/db/manage/] 
25/06/13 9:37:03 PM org.neo4j.server.modules.WebAdminModule INFO: Mounted webadmin at [/webadmin] 
21:37:03.260 [main] INFO org.mortbay.log - Logging to Logger[org.mortbay.log] via org.mortbay.log.Slf4jLog 
25/06/13 9:37:03 PM org.neo4j.server.web.Jetty6WebServer INFO: Mounting static content at [/webadmin] from [webadmin-html] 
21:37:03.366 [main] INFO org.mortbay.log - jetty-6.1.25 
21:37:03.548 [main] INFO org.mortbay.log - NO JSP Support for /webadmin, did not find org.apache.jasper.servlet.JspServlet 
21:37:06.088 [main] INFO org.mortbay.log - Started [email protected]:7474 

我最欣赏你的帮助。干杯。

回答

2

在Windows中创建服务时,通常会绑定操作系统可找到的可执行文件的位置。因为您移动了目录,您的Neo4J服务不再有效。您必须做的是删除旧服务,使用新目录重新创建服务,然后启动它。

代码来获取和使用PowerShell删除服务:

$service = Get-WmiObject -Class Win32_Service -Filter "Name='servicename'" 
$service.delete() 

here

+0

采取怎样删除旧的服务? – Tomcat

+0

@Snipergirl添加代码以获取服务并将其删除。 – Woot4Moo

+0

我的不好,设法弄清楚了!非常感谢,它现在固定:d – Tomcat