简体   繁体   English

Neo4j 远程访问问题

[英]Neo4j Remote Access Issues

I'm encountering issues regarding a new installation of Neo4j on Ubuntu 12.04;我在 Ubuntu 12.04 上新安装 Neo4j 时遇到问题; the server starts fine, without any major errors listed (start-up text posted below), but I cannot access the webadmin remotely, even with the line "org.neo4j.server.webserver.address=0.0.0.0" uncommented.服务器启动正常,没有列出任何重大错误(下面发布的启动文本),但我无法远程访问 webadmin,即使“org.neo4j.server.webserver.address=0.0.0.0”行未注释。 Chrome simply times out (error message "Oops! Google Chrome could not connect to twofish.cs.unc.edu:7474") when I attempt to connect.当我尝试连接时,Chrome 只是超时(错误消息“糟糕!Google Chrome 无法连接到 twofish.cs.unc.edu:7474”)。 There have been a couple other questions on SO that listed similar issues, but the solutions have just been "it fixed itself at some point."在 SO 上还有一些其他问题列出了类似的问题,但解决方案只是“它在某个时候自行修复”。

So far, I've tried:到目前为止,我已经尝试过:

- uncommenting and recommenting that line in the server config file, with stopping and starting the server in between each change.
- restarting the entire Ubuntu server.

The start-up message for Neo4j is as follows: Neo4j的启动信息如下:

twofish(66)% sudo service neo4j-service start twofish(66)% sudo service neo4j-service start

WARNING: Max 1024 open files allowed, minimum of 40 000 recommended.警告:最多允许打开 1024 个文件,建议最少 40 000 个。 See the Neo4j manual.请参阅 Neo4j 手册。 Using additional JVM arguments: -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties ->Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC ->XX:+CMSClassUnloadingEnabled使用额外的 JVM 参数:-server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties ->Dlog4j.configuration=文件:conf/log4j.properties -XX:+UseConcMarkSweepGC ->XX:+CMSClassUnloadingEnabled

Starting Neo4j Server...WARNING: not changing user process [3505]... waiting for server to be ready.... OK.启动 Neo4j 服务器...警告:未更改用户进程 [3505]...等待服务器准备就绪....好的。

http://localhost:7474/ is ready.

I've also put the entire config folder up in a folder on drive: https://drive.google.com/folderview?id=0Bx98DkxmHnEtLXloTDJwSUdyLTg&usp=sharing我还将整个配置文件夹放在驱动器上的文件夹中: https : //drive.google.com/folderview?id=0Bx98DkxmHnEtLXloTDJwSUdyLTg&usp=sharing

Any suggestions on what may be causing the issue?关于可能导致问题的任何建议?

Update: Regarding firewall settings, I can't provide too much information because I'm not in charge of security for it.更新:关于防火墙设置,我不能提供太多信息,因为我不负责它的安全。 The machine is part of a university's CS department network and I'm fairly sure firewall settings are managed at the network level, by someone above my pay grade.这台机器是大学计算机科学系网络的一部分,我很确定防火墙设置是在网络级别由高于我的工资等级的人管理的。 We do we have an instance of Neo4j running (and accessible remotely) on another server within the department;我们有一个 Neo4j 实例在部门内的另一台服务器上运行(并可远程访问); however, I don't know whether its firewall configurations (or what firewall software the department is even using) is the same as the server I'm having issues with.但是,我不知道它的防火墙配置(或者该部门甚至使用的防火墙软件)是否与我遇到问题的服务器相同。

Regarding connecting through localhost: I'm able to access the database with the neo4j-shell and running "curl http://localhost:7474" returns关于通过 localhost 连接:我可以使用 neo4j-shell 访问数据库并运行"curl http://localhost:7474"返回

{
  "management" : "http://localhost:7474/db/manage/",
  "data" : "http://localhost:7474/db/data/"
}t

I don't know if that means its accessible on the local machine or not though;我不知道这是否意味着它可以在本地机器上访问; I assume if curl isn't throwing an error, it is accessible from localhost...我假设如果 curl 没有抛出错误,则可以从本地主机访问它...

Update: curl http://twofish.cs.unc.edu:7474 from a remote host returns curl: (7) couldn't connect to host , so apparently I can access through localhost, but not through a remote host.更新:来自远程主机的curl http://twofish.cs.unc.edu:7474返回curl: (7) couldn't connect to host ,所以显然我可以通过 localhost 访问,但不能通过远程主机访问。

Change the 7474 port in the Neo4j server configuration to port 80. Your university firewall most likely has blocked anything that is not on a pre-approved list of ports.将 Neo4j 服务器配置中的 7474 端口更改为端口 80。您的大学防火墙很可能阻止了任何不在预先批准的端口列表中的内容。

According to your curl request, the Neo4j server is running and available.根据您的 curl 请求,Neo4j 服务器正在运行且可用。 The problem is in the network configuration.问题出在网络配置上。

Same issue here with neo4j 2.1.7. neo4j 2.1.7 也有同样的问题。 I followed these installation steps .我遵循了这些安装步骤 In my case there are no firewall rules, also changed org.neo4j.server.webserver.address to 0.0.0.0 but still no luck, can connect from localhost but not from remote.在我的情况下,没有防火墙规则,也将org.neo4j.server.webserver.address更改为0.0.0.0但仍然没有运气,可以从本地主机连接但不能从远程连接。

I found that the issue only verifies starting neo with:我发现该问题仅验证以以下方式启动 neo:

service neo4j-service start

Instead everything is OK with this:相反,一切都很好:

cd $NEO4J_HOME && ./neo4j start

I guess it's a bug in service scripts.我想这是服务脚本中的错误。 Btw, the docs also states that顺便说一句,文档还指出

This approach to running Neo4j as a server is deprecated.这种将 Neo4j 作为服务器运行的方法已被弃用。 We strongly advise you to run Neo4j from a package where feasible.我们强烈建议您在可行的情况下从包中运行 Neo4j。

To make the story short, considered that in my case is not convenient to use packages, I've been able to solve the issue with:简而言之,考虑到在我的情况下使用包不方便,我已经能够解决这个问题:

  1. ./bin/neo4j-installer install ./bin/neo4j-installer 安装
  2. update-rc.d -f neo4j-service remove update-rc.d -f neo4j-service 删除
  3. install and configure supervisord to manage neo service in place of System V startup links安装和配置supervisord来管理 Neo 服务,而不是 System V 启动链接

If possible, installing neo4j using os package is preferred.如果可能,首选使用 os 包安装 neo4j。

I know it's late but I'm just posting it if someone encounters this in the future.我知道已经晚了,但如果将来有人遇到这种情况,我只会发布它。 The problem comes from iptables usually, just disable it completely or (better) add the appropriate rule (before deny all) and that's it :)问题通常来自 iptables,只需完全禁用它或(更好)添加适当的规则(在拒绝所有之前),就是这样:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM