Linux安装Neo4j
环境:CentOS7
一、预备
1.JDK17安装
安装wget,下载jdk17安装包
sh
yum install wget
cd /opt
wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz
#或者浏览器打开https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz直接下载,然后上传到虚拟机/opt
2.解压
sh
mkdir /usr/local/java
tar -xzvf /opt/jdk-17_linux-x64_bin.tar.gz -C /usr/local/java
3.配置环境变量
sh
vi /etc/profile
#添加如下内容
export JAVA_HOME=/usr/local/java/jdk-17.0.7 #对应java版本
export CLASSPATH=.: J A V A H O M E / l i b / e x p o r t P A T H = . : JAVA_HOME/lib/ export PATH=.: JAVAHOME/lib/exportPATH=.:JAVA_HOME/bin:$PATH
sh
source /etc/profile
4.关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
二、安装Neo4j
1.下载
2.解压
sh
mkdir /usr/local/neo4j
tar -xf /opt/neo4j-chs-community-5.7.0-unix.tar.gz -C /usr/local/neo4j
3.修改配置
neo4j-chs-community-5.7.0-unix/conf/neo4j.conf
chmod 777 -R /usr/local/neo4j/
添加如下配置
server.default_listen_address=0.0.0.0
4.添加服务
sh
vi /usr/lib/systemd/system/neo4j.service
[Unit]
Description=neo4j Service
[Service]
User=root
ExecStart=/usr/local/neo4j/neo4j-chs-community-5.7.0-unix/bin/neo4j console
Environment="JAVA_HOME=/usr/local/java/jdk-17.0.7"
[Install]
WantedBy=multi-user.target
5.启动服务
sh
systemctl start neo4j
systemctl enable neo4j