neo4j 在linux 服务的部署和安装
- 2024-10-27 14:29:00
- pjd
- 原创 66
1. **添加Neo4j的Yum仓库**:
- 首先,需要导入Neo4j的签名密钥:
```bash
rpm --import https://debian.neo4j.com/neotechnology.gpg.key
```
- 接着,将Neo4j的yum仓库添加到`/etc/yum.repos.d/neo4j.repo`文件中。根据你想要安装的Neo4j版本,内容会有所不同。以下是一些示例:
- **Neo4j 5**:
```bash
[neo4j]
name=Neo4j Yum Repo
baseurl=https://yum.neo4j.com/stable/5
enabled=1
gpgcheck=1
```
- **Neo4j 4.4**:
```bash
[neo4j]
name=Neo4j Yum Repo
baseurl=https://yum.neo4j.com/stable/4.4
enabled=1
gpgcheck=1
```
- **Neo4j 3.5**:
```bash
[neo4j]
name=Neo4j Yum Repo
baseurl=https://yum.neo4j.com/stable/3.5
enabled=1
gpgcheck=1
```
2. **安装Neo4j**:
- 安装Neo4j社区版:
```bash
sudo yum install neo4j
```
- 安装Neo4j企业版:
```bash
sudo yum install neo4j-enterprise
```
以上步骤适用于Neo4j 3.0及以上版本。
请注意,在执行这些步骤之前,确保你的系统已经配置了Java环境,因为Neo4j是基于Java的图形数据库。如果遇到任何问题,建议查看Neo4j的官方文档或联系技术支持。
安装记录:
(base) [~]# sudo yum install neo4j
Neo4j Yum Repo 52 kB/s | 64 kB 00:01
Last metadata expiration check: 0:00:01 ago on Sun 27 Oct 2024 02:27:31 PM CST.
Dependencies resolved.
===============================================================================================================================
Package Architecture Version Repository Size
===============================================================================================================================
Installing:
neo4j noarch 5.24.2-1 neo4j 122 M
Installing dependencies:
adwaita-cursor-theme noarch 3.28.0-2.el8 AppStream 647 k
adwaita-icon-theme noarch 3.28.0-2.el8 AppStream 11 M
alsa-lib x86_64 1.2.5-4.el8 AppStream 489 k
at-spi2-atk x86_64 2.26.2-1.el8 AppStream 89 k
at-spi2-core x86_64 2.28.0-1.el8 AppStream 169 k
colord-libs x86_64 1.4.2-1.el8 AppStream 236 k
copy-jdk-configs noarch 4.0-2.el8 AppStream 31 k
cypher-shell noarch 5.24.2-1 neo4j 24 M
giflib x86_64 5.1.4-3.el8 AppStream 51 k
java-17-openjdk x86_64 1:17.0.1.0.12-2.el8_5 AppStream 244 k
java-17-openjdk-headless x86_64 1:17.0.1.0.12-2.el8_5 AppStream 41 M
javapackages-filesystem noarch 5.3.0-1.module_el8.0.0+11+5b8c10bd AppStream 30 k
libXtst x86_64 1.2.3-7.el8 AppStream 22 k
libepoxy x86_64 1.5.8-1.el8 AppStream 225 k
libwayland-client x86_64 1.19.0-1.el8 AppStream 39 k
libwayland-cursor x86_64 1.19.0-1.el8 AppStream 26 k
libwayland-egl x86_64 1.19.0-1.el8 AppStream 19 k
lksctp-tools x86_64 1.0.18-3.el8 base 100 k
lua x86_64 5.3.4-12.el8 AppStream 192 k
rest x86_64 0.8.1-2.el8 AppStream 70 k
ttmkfdir x86_64 3.0.9-54.el8 AppStream 62 k
tzdata-java noarch 2021e-1.el8 AppStream 191 k
xorg-x11-fonts-Type1 noarch 7.5-19.el8 AppStream 522 k
Installing weak dependencies:
dconf x86_64 0.28.0-4.el8 AppStream 108 k
gtk3 x86_64 3.22.30-8.el8 AppStream 4.5 M
Enabling module streams:
javapackages-runtime 201801
Transaction Summary
===============================================================================================================================
Install 26 Packages
Total download size: 206 M
Installed size: 398 M
Is this ok [y/N]: y
Downloading Packages:
(1/26): lksctp-tools-1.0.18-3.el8.x86_64.rpm 2.0 MB/s | 100 kB 00:00
(2/26): adwaita-cursor-theme-3.28.0-2.el8.noarch.rpm 4.2 MB/s | 647 kB 00:00
(3/26): alsa-lib-1.2.5-4.el8.x86_64.rpm 4.5 MB/s | 489 kB 00:00
(4/26): at-spi2-atk-2.26.2-1.el8.x86_64.rpm 1.0 MB/s | 89 kB 00:00
(5/26): at-spi2-core-2.28.0-1.el8.x86_64.rpm 1.6 MB/s | 169 kB 00:00
(6/26): copy-jdk-configs-4.0-2.el8.noarch.rpm 984 kB/s | 31 kB 00:00
(7/26): adwaita-icon-theme-3.28.0-2.el8.noarch.rpm 25 MB/s | 11 MB 00:00
(8/26): dconf-0.28.0-4.el8.x86_64.rpm 618 kB/s | 108 kB 00:00
(9/26): colord-libs-1.4.2-1.el8.x86_64.rpm 899 kB/s | 236 kB 00:00
(10/26): giflib-5.1.4-3.el8.x86_64.rpm 571 kB/s | 51 kB 00:00
(11/26): gtk3-3.22.30-8.el8.x86_64.rpm 26 MB/s | 4.5 MB 00:00
(12/26): javapackages-filesystem-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch.rpm 410 kB/s | 30 kB 00:00
(13/26): java-17-openjdk-17.0.1.0.12-2.el8_5.x86_64.rpm 1.1 MB/s | 244 kB 00:00
(14/26): libXtst-1.2.3-7.el8.x86_64.rpm 300 kB/s | 22 kB 00:00
(15/26): libepoxy-1.5.8-1.el8.x86_64.rpm 2.9 MB/s | 225 kB 00:00
(16/26): libwayland-client-1.19.0-1.el8.x86_64.rpm 1.5 MB/s | 39 kB 00:00
(17/26): libwayland-egl-1.19.0-1.el8.x86_64.rpm 256 kB/s | 19 kB 00:00
(18/26): libwayland-cursor-1.19.0-1.el8.x86_64.rpm 229 kB/s | 26 kB 00:00
(19/26): lua-5.3.4-12.el8.x86_64.rpm 5.3 MB/s | 192 kB 00:00
(20/26): ttmkfdir-3.0.9-54.el8.x86_64.rpm 852 kB/s | 62 kB 00:00
(21/26): tzdata-java-2021e-1.el8.noarch.rpm 6.2 MB/s | 191 kB 00:00
(22/26): rest-0.8.1-2.el8.x86_64.rpm 446 kB/s | 70 kB 00:00
(23/26): xorg-x11-fonts-Type1-7.5-19.el8.noarch.rpm 3.0 MB/s | 522 kB 00:00
(24/26): java-17-openjdk-headless-17.0.1.0.12-2.el8_5.x86_64.rpm 6.2 MB/s | 41 MB 00:06
(25/26): cypher-shell-5.24.2-1.noarch.rpm 3.2 MB/s | 24 MB 00:07
(26/26): neo4j-5.24.2-1.noarch.rpm 6.1 MB/s | 122 MB 00:20
-------------------------------------------------------------------------------------------------------------------------------
Total 9.7 MB/s | 206 MB 00:21
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Running scriptlet: copy-jdk-configs-4.0-2.el8.noarch 1/1
Running scriptlet: java-17-openjdk-headless-1:17.0.1.0.12-2.el8_5.x86_64 1/1
Running scriptlet: neo4j-5.24.2-1.noarch 1/1
Preparing : 1/1
Installing : libwayland-client-1.19.0-1.el8.x86_64 1/26
Installing : libXtst-1.2.3-7.el8.x86_64 2/26
Installing : at-spi2-core-2.28.0-1.el8.x86_64 3/26
Running scriptlet: at-spi2-core-2.28.0-1.el8.x86_64 3/26
Installing : at-spi2-atk-2.26.2-1.el8.x86_64 4/26
Running scriptlet: at-spi2-atk-2.26.2-1.el8.x86_64 4/26
Installing : libwayland-cursor-1.19.0-1.el8.x86_64 5/26
Installing : tzdata-java-2021e-1.el8.noarch 6/26
Installing : ttmkfdir-3.0.9-54.el8.x86_64 7/26
Installing : xorg-x11-fonts-Type1-7.5-19.el8.noarch 8/26
Running scriptlet: xorg-x11-fonts-Type1-7.5-19.el8.noarch 8/26
Installing : rest-0.8.1-2.el8.x86_64 9/26
Running scriptlet: rest-0.8.1-2.el8.x86_64 9/26
Installing : lua-5.3.4-12.el8.x86_64 10/26
Installing : copy-jdk-configs-4.0-2.el8.noarch 11/26
Installing : libwayland-egl-1.19.0-1.el8.x86_64 12/26
Installing : libepoxy-1.5.8-1.el8.x86_64 13/26
Installing : javapackages-filesystem-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch 14/26
Installing : giflib-5.1.4-3.el8.x86_64 15/26
Installing : dconf-0.28.0-4.el8.x86_64 16/26
Installing : colord-libs-1.4.2-1.el8.x86_64 17/26
Installing : alsa-lib-1.2.5-4.el8.x86_64 18/26
Running scriptlet: alsa-lib-1.2.5-4.el8.x86_64 18/26
Installing : adwaita-cursor-theme-3.28.0-2.el8.noarch 19/26
Installing : adwaita-icon-theme-3.28.0-2.el8.noarch 20/26
Installing : gtk3-3.22.30-8.el8.x86_64 21/26
Installing : lksctp-tools-1.0.18-3.el8.x86_64 22/26
Running scriptlet: lksctp-tools-1.0.18-3.el8.x86_64 22/26
Installing : java-17-openjdk-headless-1:17.0.1.0.12-2.el8_5.x86_64 23/26
Running scriptlet: java-17-openjdk-headless-1:17.0.1.0.12-2.el8_5.x86_64 23/26
Installing : java-17-openjdk-1:17.0.1.0.12-2.el8_5.x86_64 24/26
Running scriptlet: java-17-openjdk-1:17.0.1.0.12-2.el8_5.x86_64 24/26
Installing : cypher-shell-5.24.2-1.noarch 25/26
Running scriptlet: neo4j-5.24.2-1.noarch 26/26
Installing : neo4j-5.24.2-1.noarch 26/26
Running scriptlet: neo4j-5.24.2-1.noarch 26/26
Running scriptlet: copy-jdk-configs-4.0-2.el8.noarch 26/26
Running scriptlet: dconf-0.28.0-4.el8.x86_64 26/26
Running scriptlet: java-17-openjdk-1:17.0.1.0.12-2.el8_5.x86_64 26/26
Running scriptlet: neo4j-5.24.2-1.noarch 26/26
Running scriptlet: adwaita-icon-theme-3.28.0-2.el8.noarch 26/26
Verifying : lksctp-tools-1.0.18-3.el8.x86_64 1/26
Verifying : adwaita-cursor-theme-3.28.0-2.el8.noarch 2/26
Verifying : adwaita-icon-theme-3.28.0-2.el8.noarch 3/26
Verifying : alsa-lib-1.2.5-4.el8.x86_64 4/26
Verifying : at-spi2-atk-2.26.2-1.el8.x86_64 5/26
Verifying : at-spi2-core-2.28.0-1.el8.x86_64 6/26
Verifying : colord-libs-1.4.2-1.el8.x86_64 7/26
Verifying : copy-jdk-configs-4.0-2.el8.noarch 8/26
Verifying : dconf-0.28.0-4.el8.x86_64 9/26
Verifying : giflib-5.1.4-3.el8.x86_64 10/26
Verifying : gtk3-3.22.30-8.el8.x86_64 11/26
Verifying : java-17-openjdk-1:17.0.1.0.12-2.el8_5.x86_64 12/26
Verifying : java-17-openjdk-headless-1:17.0.1.0.12-2.el8_5.x86_64 13/26
Verifying : javapackages-filesystem-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch 14/26
Verifying : libXtst-1.2.3-7.el8.x86_64 15/26
Verifying : libepoxy-1.5.8-1.el8.x86_64 16/26
Verifying : libwayland-client-1.19.0-1.el8.x86_64 17/26
Verifying : libwayland-cursor-1.19.0-1.el8.x86_64 18/26
Verifying : libwayland-egl-1.19.0-1.el8.x86_64 19/26
Verifying : lua-5.3.4-12.el8.x86_64 20/26
Verifying : rest-0.8.1-2.el8.x86_64 21/26
Verifying : ttmkfdir-3.0.9-54.el8.x86_64 22/26
Verifying : tzdata-java-2021e-1.el8.noarch 23/26
Verifying : xorg-x11-fonts-Type1-7.5-19.el8.noarch 24/26
Verifying : cypher-shell-5.24.2-1.noarch 25/26
Verifying : neo4j-5.24.2-1.noarch 26/26
Installed:
adwaita-cursor-theme-3.28.0-2.el8.noarch adwaita-icon-theme-3.28.0-2.el8.noarch
alsa-lib-1.2.5-4.el8.x86_64 at-spi2-atk-2.26.2-1.el8.x86_64
at-spi2-core-2.28.0-1.el8.x86_64 colord-libs-1.4.2-1.el8.x86_64
copy-jdk-configs-4.0-2.el8.noarch cypher-shell-5.24.2-1.noarch
dconf-0.28.0-4.el8.x86_64 giflib-5.1.4-3.el8.x86_64
gtk3-3.22.30-8.el8.x86_64 java-17-openjdk-1:17.0.1.0.12-2.el8_5.x86_64
java-17-openjdk-headless-1:17.0.1.0.12-2.el8_5.x86_64 javapackages-filesystem-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch
libXtst-1.2.3-7.el8.x86_64 libepoxy-1.5.8-1.el8.x86_64
libwayland-client-1.19.0-1.el8.x86_64 libwayland-cursor-1.19.0-1.el8.x86_64
libwayland-egl-1.19.0-1.el8.x86_64 lksctp-tools-1.0.18-3.el8.x86_64
lua-5.3.4-12.el8.x86_64 neo4j-5.24.2-1.noarch
rest-0.8.1-2.el8.x86_64 ttmkfdir-3.0.9-54.el8.x86_64
tzdata-java-2021e-1.el8.noarch xorg-x11-fonts-Type1-7.5-19.el8.noarch
Complete!
3、Unsupported Java 1.8.0_121 detected. Please use Java(TM) 17 or Java(TM) 21 to run Neo4j Server.
java -version
sudo yum install java-17-openjdk
sudo alternatives --config java
sudo systemctl restart neo4j
4、启动服务和查看状态
# 启动Neo4j服务
sudo systemctl start neo4j
# 查看Neo4j服务的状态
sudo systemctl status neo4j
#如果Neo4j服务没有设置为随系统启动,你可以通过以下命令设置它为开机自启:
sudo systemctl enable neo4j
# 修改配置
/etc/neo4j neo4j.conf