# CentOS7安装Neo4j

# 下载

wget https://neo4j.com/artifact.php?name=neo4j-community-3.5.13-unix.tar.gz

# 解压

mv artifact.php?name=neo4j-community-3.5.13-unix.tar.gz neo4j-community-3.5.13-unix.tar.gz
tar -zxvf neo4j-community-3.5.13-unix.tar.gz

# 更新配置

vim /root/neo4j-community-3.5.13/conf/neo4j.conf
#这一行的 前面的#号去掉
dbms.connectors.default_listen_address=0.0.0.0

# 移动路径

mv neo4j-community-3.5.13 /opt/software/

# 进入目录

cd /opt/software/neo4j-community-3.5.13

# 新建启动脚本

vim start.sh

#!/bin/bash
sh /opt/software/neo4j-community-3.5.13/bin/neo4j start

# 新建停止脚本

vim stop.sh

#!/bin/bash
sh /opt/software/neo4j-community-3.5.13/bin/neo4j stop

# 赋可执行权限

chmod +x start.sh stop.sh

# 新增开机启动脚本

vim /lib/systemd/system/neo4j.service

# 脚本内容

[Unit]
Description=neo4j
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
ExecStart=/opt/software/neo4j-community-3.5.13/start.sh
ExecStop=/opt/software/neo4j-community-3.5.13/stop.sh
PrivateTpm=true

[Install]
WantedBy=multi-user.target

# 启动

systemctl daemon-reload
systemctl status neo4j.service
systemctl start neo4j.service
systemctl stop neo4j.service
systemctl enable neo4j.service

# 访问url

http://software:7474/
Last Updated: 11/25/2022, 3:23:17 PM