centos 7 x64 装了 neo4j 想用其它机器访问,无奈一直被拒绝,后来发现是防火墙启用了。
systemctl status firewalld
可以查看防火墙状态。
现在为 neo4j 添加服务
拷贝一个配置文件作为 neo4j 的服务样例文件,然后进行修改。 如使用ssh.xml
cp /usr/lib/firewalld/services/ssh.xml /usr/lib/firewalld/services/neo4j.xml
然后修改 neo4j.xml
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>SSH</short>
<description>Secure Shell (SSH) is a protocol for logging into and executing commands on remote machines. It provides secure encrypted communications. If you plan on accessing your machine remotely via SSH over a firewalled interface, enable this option. You need the openssh-server package installed for this option to be useful.</description>
<port protocol="tcp" port="22"/>
</service>
改为:
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>neo4j-web</short>
<description>neo4j http https</description>
<port protocol="tcp" port="7474"/>
<port protocol="tcp" port="7473"/>
</service>
重新加载 firewall 服务配置
firewall-cmd --reload
然后添加服务
firewall-cmd --zone=public --add-service=neo4j
More detail see ref.