简体   繁体   English

ServiceUnavailable:WebSocket 连接失败后:服务器连接 neo4j

[英]ServiceUnavailable: WebSocket connection failure after :server connect for neo4j

I want to launch Neo4j on my machine with dokcer.我想用 dokcer 在我的机器上启动 Neo4j。 I downloaded it and did it:我下载并做到了:

docker run -p 7474:7474 neo4j

But on http://localhost:7474/browser/ I have:但是在 http://localhost:7474/browser/ 我有:

水图像介绍

ServiceUnavailable: WebSocket connection failure. ServiceUnavailable:WebSocket 连接失败。 Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver.由于您的 web 浏览器中的安全限制,此 Neo4j 驱动程序无法找到故障原因。 Please use your browsers development console to determine the root cause of the failure.请使用您的浏览器开发控制台来确定失败的根本原因。 Common reasons include the database being unavailable, using the wrong connection URL or temporary network problems.常见原因包括数据库不可用、使用错误的连接 URL 或临时网络问题。 If you have enabled encryption, ensure your browser is configured to trust the certificate Neo4j is configured to use.如果您启用了加密,请确保您的浏览器配置为信任 Neo4j 配置为使用的证书。 WebSocket readyState is: 3 readyState就绪状态为:3

I tried with neo4j/neo4j credentials and it gave me the same error.我尝试使用 neo4j/neo4j 凭据,它给了我同样的错误。

I thought to edit $NEO4J_HOME/conf/neo4j.conf and uncommenting:我想编辑$NEO4J_HOME/conf/neo4j.conf并取消注释:

# To have Bolt accept non-local connections, uncomment this line:
dbms.connector.bolt.address=0.0.0.0:7687

as they say in the following method but I was not able to find the file正如他们在以下方法中所说,但我无法找到该文件

bash-5.1$  cd /var/lib/
abrt/                  games/                 PackageKit/
AccountsService/       gdm/                   plymouth/
alsa/                  geoclue/               polkit-1/
alternatives/          gssproxy/              portables/
authselect/            hp/                    power-profiles-daemon/
bluetooth/             httpd/                 private/
chrony/                hyperv/                rpm/
cni/                   initramfs/             rpm-state/
color/                 iscsi/                 samba/
colord/                kdump/                 selinux/
containerd/            libvirt/               sss/
containers/            lockdown/              systemd/
dbus/                  logrotate/             texmf/
dhclient/              machines/              tpm/
dnf/                   misc/                  tpm2-tss/
dnsmasq/               mlocate/               udisks2/
docker/                net-snmp/              unbound/
fedora-third-party/    NetworkManager/        upower/
flatpak/               nfs/                   xkb/
fprint/                openvpn/               
fwupd/                 os-prober/  

You also need to expose the bolt port from the docker container.您还需要从 docker 容器中暴露螺栓端口。 The default bolt port is 7687.默认螺栓端口为 7687。

docker run -p 7474:7474 -p 7687:7687 neo4j

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

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