Centos7在线安装neo4j-5.6.0
安装前准备
1、按照官网的要求,neo4j需要jdk的版本>=17,这里有需要注意的地方,在下面的安装说明中会提到;
2、neo4j-5.6.0也需要cypher-shell,是通过cypher对图数据库进行增删改查操作;
开始安装
配置repo文件
rpm --import https://debian.neo4j.com/neotechnology.gpg.key
vi /etc/yum.repos.d/neo4j.repo
[neo4j]
name=Neo4j RPM Repository
baseurl=https://yum.neo4j.com/stable/5
enabled=1
gpgcheck=1
这样在目录/etc/yum.repos.d/下会有neo4j.repo文件,便于后面的yum安装neo4j。
安装jdk
我们需要安装版本>=17的jdk,之前安装jdk-17.0.7,安装后安装neo4j会报
error: Failed dependencies:
jre-17 >= 17 is needed by cypher-shell-5.6.0-1.noarch
等一些提示jdk不符合要求的错误信息,后面通过google发现17的版本问题导致的,安装jdk-17.0.1就没有对应的问题,等提示jdk不符合要求的错误信息,后面通过google发现17的版本问题导致的,安装jdk-17.0.1就没有对应的问题,下载对应的版本
wget https://download.oracle.com/java/17/archive/jdk-17.0.1_linux-x64_bin.rpm
接着就是安装jdk
rpm -ivh jdk-17.0.1_linux-x64_bin.rpm
这样jdk安装完成了。
安装neo4j
首先先下载适配器,方便后面整体安装neo4j,也会统一一起安装依赖
# yum install https://dist.neo4j.org/neo4j-java17-adapter.noarch.rpm
Loaded plugins: fastestmirror
neo4j-java17-adapter.noarch.rpm | 6.3 kB 00:00:00
Examining /var/tmp/yum-root-x8GP3V/neo4j-java17-adapter.noarch.rpm: neo4j-java17-adapter-1-1.noarch
Marking /var/tmp/yum-root-x8GP3V/neo4j-java17-adapter.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package neo4j-java17-adapter.noarch 0:1-1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================================================================ Package Arch Version Repository Size
============================================================================================================================================================================Installing:
neo4j-java17-adapter noarch 1-1 /neo4j-java17-adapter.noarch 0.0
Transaction Summary
============================================================================================================================================================================Install 1 Package
Installed size: 0
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : neo4j-java17-adapter-1-1.noarch 1/1
Verifying : neo4j-java17-adapter-1-1.noarch 1/1
Installed:
neo4j-java17-adapter.noarch 0:1-1
Complete!
适配器安装成功,下面就可以安装neo4j了
# yum install neo4j-5.6.0
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package neo4j.noarch 0:5.6.0-1 will be installed
--> Processing Dependency: cypher-shell < 6.0 for package: neo4j-5.6.0-1.noarch
--> Processing Dependency: cypher-shell >= 5.0 for package: neo4j-5.6.0-1.noarch
--> Running transaction check
---> Package cypher-shell.noarch 0:5.6.0-1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================================================================ Package Arch Version Repository Size
============================================================================================================================================================================Installing:
neo4j noarch 5.6.0-1 neo4j 107 M
Installing for dependencies:
cypher-shell noarch 5.6.0-1 neo4j 21 M
Transaction Summary
============================================================================================================================================================================Install 1 Package (+1 Dependent package)
Total download size: 128 M
Installed size: 139 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): cypher-shell-5.6.0-1.noarch.rpm | 21 MB 00:00:04
(2/2): neo4j-5.6.0-1.noarch.rpm | 107 MB 00:00:14
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------Total 8.9 MB/s | 128 MB 00:00:14
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : cypher-shell-5.6.0-1.noarch 1/2
Installing : neo4j-5.6.0-1.noarch 2/2
Verifying : neo4j-5.6.0-1.noarch 1/2
Verifying : cypher-shell-5.6.0-1.noarch 2/2
Installed:
neo4j.noarch 0:5.6.0-1
Dependency Installed:
cypher-shell.noarch 0:5.6.0-1
Complete!
到这里,neo4j-5.6.0就安装成功了
配置和启动neo4j
因为需要配置为可以远程访问,需要对neo4j.conf文件进行配置
# vi /etc/neo4j/neo4j.conf
#放开注释
server.default_listen_address=0.0.0.0
启动neo4j
# systemctl enable neo4j
# systemctl restart neo4j
# systemctl status neo4j
● neo4j.service - Neo4j Graph Database
Loaded: loaded (/usr/lib/systemd/system/neo4j.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2023-04-20 15:29:55 CST; 5s ago
Main PID: 9185 (java)
CGroup: /system.slice/neo4j.service
├─9185 /usr/bin/java -Xmx128m -classpath /usr/share/neo4j/lib/*:/usr/share/neo4j/etc:/usr/share/neo4j/repo/* -Dapp.name=neo4j -Dapp.pid=9185 -Dapp.repo=/usr/s... └─9207 /usr/java/jdk-17.0.1/bin/java -cp /var/lib/neo4j/plugins/*:/etc/neo4j/*:/usr/share/neo4j/lib/* -XX:+UseG1GC -XX:-OmitStackTraceInFastThrow -XX:+AlwaysP...
Apr 20 15:29:57 supermap neo4j[9185]: plugins: /var/lib/neo4j/plugins
Apr 20 15:29:57 supermap neo4j[9185]: import: /var/lib/neo4j/import
Apr 20 15:29:57 supermap neo4j[9185]: data: /var/lib/neo4j/data
Apr 20 15:29:57 supermap neo4j[9185]: certificates: /var/lib/neo4j/certificates
Apr 20 15:29:57 supermap neo4j[9185]: licenses: /var/lib/neo4j/licenses
Apr 20 15:29:57 supermap neo4j[9185]: run: /var/lib/neo4j/run
Apr 20 15:29:57 supermap neo4j[9185]: Starting Neo4j.
Apr 20 15:29:58 supermap neo4j[9185]: 2023-04-20 07:29:58.961+0000 INFO Starting...
Apr 20 15:29:59 supermap neo4j[9185]: 2023-04-20 07:29:59.597+0000 INFO This instance is ServerId{6cfe28f9} (6cfe28f9-476f-498a-83c4-b620ce0d6d89)
Apr 20 15:30:00 supermap neo4j[9185]: 2023-04-20 07:30:00.752+0000 INFO ======== Neo4j 5.6.0 ========
这样neo4j就安装成功了,主要用的两个端口是7474,7687,打开web查看一下:
当然我是通过本地的Neo4j Dasktop访问的
当让我是通过本地的Neo4j Dasktop访问的
至此整个安装就结束了,希望大家后面多多交流!