【必赢365net手机版】Linux下图形数据库Neo4j单机安装,linux系统下安装neo4j的教程

必赢365net手机版 7

Neo4j数据库简单介绍

linux系统下安装neo4j的课程,linuxneo4j

Neo4j分社区版(Community Edition)和商场版(Enterprise
艾德ition),社区版本为无偿版本。

 

系统须求(System requirements)

Neo4j的安装对硬件、系统等有后生可畏对渴求,举个例子CPU、Memory、Disk、Filesystem、Software等、

CPU

有关CPU,最低要求是Itel Core i3 推荐应用AMD Core i7 或 IBM POWECR-V 8
Memory

关于Memory,最低要求是2GB, 推荐是16-32GB 或更多。
越大的内存允许管理越大的图,但必须准确配置,防止破垃圾搜聚坏性操作。
Disk

除此而外Disk的体积,Disk的习性对Neoj4的影响非常大,Neo4j的做事负荷趋势于自由读。接受平均寻址时间低的积攒,比方SSD,最低需求10GB SATA,推荐配置 SSD w/SATA FileSystem

低于必要 ext4(或周围的)

推荐配置 ext4、ZFS Software

Java

非得设置OpenJDK 8 或 Oracle Java 8 Operation Sytem

Linux(Ubuntu, Debian) ,不过自个儿的测验遭受为Red Hat Enterprise Linux
Server release 6.6,一时还尚无发掘什么难题。 Architectures

X86 或 OpenPower(POWER8)

Neo4j 是三个NoSQL的图样数据库(Graph
Database)。Neo4j使用图(graph)相关的定义来说述数据模型,把多县令存为图中的节点以致节点之间的涉及。非常多运用中数量里面包车型地铁关联,能够很直白地利用图中节点和事关的定义来建立模型。对于如此的选取,使用
Neo4j
来积攒数据会非常的当然,要减价使用关周详据库。官方文书档案对Neo4j的牵线如下所示:

安装

1.jdk

[[email protected] software]# java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
You have new mail in /var/spool/mail/root
[[email protected] software]# 

3:成立三个客户neo4j,用来管理Neo4j
。当然那不是必得的。也足以是任何账号或root账号。

[[email protected] neo4j-community-3.2.10]# groupadd nosql 
[[email protected] neo4j-community-3.2.10]# useradd -G nosql neo4j

解压

[[email protected] ~]$ tar -zxvf /opt/software/neo4j-community-3.2.10-unix.tar.gz  -C /opt/moudles/neo4j/
[[email protected] neo4j-community-3.2.10]# chown neo4j:nosql -R  /opt/moudles/neo4j/
[[email protected] neo4j-community-3.2.10]# su - neo4j   

修正景况变量

[[email protected] neo4j-community-3.2.10]# vim /etc/profile
export NEO4J_HOME=/opt/moudles/neo4j/neo4j-community-3.2.10                                                      
export PATH=$PATH:$NEO4J_HOME/bin

改正配置文件/etc/security/limits.conf

neo4j  soft   nofile  40000
neo4j  hard   nofile  40000

编辑/etc/pam.d/su 在配置文件之中扩充选项。

session optional pam_xauth.so

验证

[[email protected] neo4j-community-3.2.10]# su neo4j
[[email protected] ~]$ neo4j version 
neo4j 3.2.10
[[email protected] ~]$ neo4j
Usage: neo4j { console | start | stop | restart | status | version }

配置

创建数据库目录
[[email protected] neo4j]$ mkdir /opt/moudles/neo4j/data 
[[email protected] neo4j]$ vim neo4j-community-3.2.10/conf/neo4j.conf 
指定数据库目录位置
dbms.active_database=/opt/moudles/neo4j/data/graph.db
dbms.directories.import=import

dbms.memory.heap.initial_size=512m
dbms.memory.heap.max_size=512m

指定运行的主机
dbms.connectors.default_listen_address=192.168.10.174 
dbms.connectors.default_advertised_address=192.168.10.174 

dbms.connector.bolt.enabled=true                                                                                 
dbms.connector.bolt.tls_level=OPTIONAL                                                                           
dbms.connector.bolt.listen_address=:7687 


dbms.connector.http.enabled=true                                                                                 
dbms.connector.http.listen_address=:7474                                                                         


dbms.connector.https.enabled=true                                                                                
dbms.connector.https.listen_address=:7473   

dbms.tx_log.rotation.retention_policy=1 days  

dbms.jvm.additional=-XX:+UseG1GC      

dbms.jvm.additional=-XX:-OmitStackTraceInFastThrow  
dbms.jvm.additional=-XX:+AlwaysPreTouch    
dbms.jvm.additional=-XX:+UnlockExperimentalVMOptions                                                             
dbms.jvm.additional=-XX:+TrustFinalNonStaticFields  
dbms.jvm.additional=-XX:+DisableExplicitGC    

dbms.jvm.additional=-Djdk.tls.ephemeralDHKeySize=2048  
dbms.jvm.additional=-Djdk.tls.rejectClientInitiatedRenegotiation=true   

dbms.windows_service_name=neo4j    

dbms.jvm.additional=-Dunsupported.dbms.udc.source=tarball 

启动

[[email protected] neo4j]$ neo4j start
Active database: /opt/moudles/neo4j/data/graph.db
Directories in use:
  home:         /opt/moudles/neo4j/neo4j-community-3.2.10
  config:       /opt/moudles/neo4j/neo4j-community-3.2.10/conf
  logs:         /opt/moudles/neo4j/neo4j-community-3.2.10/logs
  plugins:      /opt/moudles/neo4j/neo4j-community-3.2.10/plugins
  import:       /opt/moudles/neo4j/neo4j-community-3.2.10/import
  data:         /opt/moudles/neo4j/neo4j-community-3.2.10/data
  certificates: /opt/moudles/neo4j/neo4j-community-3.2.10/certificates
  run:          /opt/moudles/neo4j/neo4j-community-3.2.10/run
Starting Neo4j.
Started neo4j (pid 6793). It is available at https://192.168.10.174:7474/
There may be a short delay until the server is ready.
See /opt/moudles/neo4j/neo4j-community-3.2.10/logs/neo4j.log for current status.

访问:

必赢365net手机版 1

私下认可密码:neo4j

先是次登入须求改革密码

Neo4j分社区版(Community Edition)和集团版(Enterprise
艾德ition),社区版本为免费版本。 系统要求(System…

 

Neo4j is the world’s leading graph database. It is built from the ground
up to be a graph database,

meaning that its architecture is designed for optimizing fast
management, storage, and traversal of

nodes and relationships. Therefore, relationships are said to be first
class citizens in Neo4j. An

operation known in the relational database world as a join exhibits
performance which degrades

exponentially with the number of relationships. The corresponding action
in Neo4j is performed as

navigation from one node to another; an operation whose performance is
linear.

 

Neo4j分社区版(Community Edition)和公司版(Enterprise
Edition),社区版本为免费版本。这段时间的流行版本为Neo4j
3.1。官方网址为 Neo4j的连锁文书档案U奥迪Q5L地址如下

 

System requirements

 

Neo4j的安装对硬件、系统等有意气风发对渴求,举个例子CPU、Memory、Disk、Filesystem、Software等

 

CPU

有关CPU,最低需要是Itel Core i3 推荐应用速龙 Core i7 或 IBM POWE本田CR-V 8

 

Memory

关于Memory,最低须求是2GB, 推荐是16-32GB 或越来越多。
越大的内部存款和储蓄器允许管理越大的图,但必得准确配置,防止破垃圾搜聚坏性操作。

 

Disk

除了那一个之外Disk的体积,Disk的性质对Neoj4的影响非常的大,Neo4j的做事负荷倾向于自由读。接纳平均寻址时间低的积存,举例SSD

低于供给 10GB SATA

推荐配置 SSD w/SATA

 

FileSystem

低于供给 ext4(或临近的)

推荐介绍配置 ext4、ZFS

 

Software

Java

总得设置OpenJDK 8 或 Oracle Java 8

 

Operation Sytem

Linux(Ubuntu, Debian) ,不过小编的测量试验处境为Red Hat Enterprise Linux
Server release 6.6,权且还从未察觉怎么难题。

Architectures

X86 或 OpenPower(POWER8)

 

Neo4j安装步骤:

 

上边简介Linux下Neo4j 3.1的安装步骤,安装测量检验意况为Red Hat Enterprise
Linux Server release 6.6, Debian下安装具体参谋文书档案,这里不做牵线。

1:下载Neo4j
3.1的安装包,去官方网址注册下载就可以。选取特定的本子。下载地址

2:检查上边System Requirement,安装JDK 8

[root@gettestlnx03 ~]# rpm -qa | grep gcj

libgcj-devel-4.4.7-11.el6.x86_64

libgcj-4.4.7-11.el6.x86_64

java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64

[root@gettestlnx03 ~]# rpm -ivh /tmp/jdk-8u121-linux-x64.rpm 

Preparing...                ########################################### [100%]

   1:jdk1.8.0_121           ########################################### [100%]

Unpacking JAR files...

        tools.jar...

        plugin.jar...

        javaws.jar...

        deploy.jar...

        rt.jar...

        jsse.jar...

        charsets.jar...

        localedata.jar...

 

[root@gettestlnx03 ~]# java -version

java version "1.8.0_121"

Java(TM) SE Runtime Environment (build 1.8.0_121-b13)

Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

[root@gettestlnx03 ~]# 

编辑/etc/profile文件,增多底下配置音讯,然后施行source
/etc/profile命令使之生效。

export JAVA_HOME=/usr/java/jdk1.8.0_121/

 

export CLASSPATH=/usr/java/jdk1.8.0_121/lib

 

export PATH=$AVA_HOME/bin:$PATH

 

3:创制三个顾客neo4j,用来治本Neo4j
。当然那不是必需的。也得以是其余账号或root账号。

[root@gettestlnx03 ~]# /usr/sbin/groupadd nosql

 

[root@gettestlnx03 ~]# /usr/sbin/useradd -G nosql neo4j

 

4:然后切换来neo4j账户下,解压neo4j-community-3.1.1-unix.tar.gz包

[root@gettestlnx03 ~]# su - neo4j

 

[neo4j@gettestlnx03 ~]$ tar -zxvf /tmp/neo4j-community-3.1.1-unix.tar.gz -C /home/neo4j/

 

配置.bash_profile文件,扩张下边朝气蓬勃行,并使之生效。

[root@gettestlnx03 neo4j]# su - neo4j

 

[neo4j@gettestlnx03 ~]$ vi .bash_profile 

 

export PATH=/home/neo4j/neo4j-community-3.1.1/bin:$PATH #新增一行

 

[neo4j@gettestlnx03 ~]$ source .bash_profile 

其余,改过配置文件/etc/security/limits.conf ,扩张上边配置。

 

neo4j  soft   nofile  40000

neo4j  hard   nofile  40000

The usual default of 1024 is often not enough. This is especially true
when many indexes are used or a

server installation sees too many connections. Network sockets count
against the limit as well. Users

are therefore encouraged to increase the limit to a healthy value of 40
000 or more, depending on

usage patterns. It is possible to set the limit with the ulimit command,
but only for the root user, and

it only affects the current session. To set the value system wide,
follow the instructions for your

platform.

编辑/etc/pam.d/su 在构造文件之中扩充选项。

session optional pam_xauth.so

 

Neo4j服务关闭运行

 

Neo4j服务的运维、关闭如下所示

[neo4j@gettestlnx03 ~]$ neo4j  start

Starting Neo4j.

Started neo4j (pid 2605). By default, it is available at http://localhost:7474/

There may be a short delay until the server is ready.

See /home/neo4j/neo4j-community-3.1.1/logs/neo4j.log for current status.

[neo4j@gettestlnx03 ~]$ neo4j  status

Neo4j is running at pid 2605

[neo4j@gettestlnx03 ~]$ neo4j  stop

Stopping Neo4j.. stopped

[neo4j@gettestlnx03 ~]$ 

必赢365net手机版 2

 

若果不设置Neo4j的配备文件,只可以从本机访问Neo4J的web调节台(
Neo4j的调节文件日常坐落于<neo4jhome>/conf/neo4j.conf,比如小编测量试验情形为/home/neo4j/neo4j-community-3.1.1/conf

Neo4j的布局文件将单身再做详细介绍。假如大家必要中远间距访谈Neo4j的Web调整台,大家必要改正neo4j.conf配置文件的参数,如下截图所示:

必赢365net手机版 3

本来,还亟需安插iptables,开放7474端口号,不然你要么不能够远程访谈Web调节台。

-A INPUT -p tcp -m state –state NEW -m tcp –dport 7474 -j ACCEPT

下一场您就足以从远程 访谈Neo4j的Web调节台了,
第一遍登录会提醒您输入早先化密码并提醒你改改密码。暗许的密码为neo4j.
假设同意远程访谈,切记改善初步化密码。安全超级重大。

必赢365net手机版 4

必赢365net手机版 5

 

差不离的测量试验案例

大家先创造多个精简的父亲和儿子关系图。用来简单演示一下图形数据库的行使。如下所示。

[neo4j@gettestlnx03 bin]$ ./cypher-shell 

username: neo4j

password: **********

Connected to Neo4j 3.1.1 at bolt://localhost:7687 as user neo4j.

Type :help for a list of available commands or :exit to exit the shell.

Note that Cypher queries must end with a semicolon.

neo4j> CREATE (A {id:1,name:'张飞'}), (B {id:2,name:'张小二'}), (C {id:3,name:'张三'}), (D {id:4,name:'张凯'}),(E {id:5,name:'张雨'}),(A)-[:Son]->(B),(A)-[:Son]->(C),(B)-[:Son]->(D),(C)-[:Son]->(E); 

Added 5 nodes, Created 4 relationships, Set 10 properties

neo4j> START n=node(*) RETURN n;

n

({name: "张飞", id: 1})

({name: "张小二", id: 2})

({name: "张三", id: 3})

({name: "张凯", id: 4})

({name: "张雨", id: 5})

neo4j> 

必赢365net手机版 6

 

即使您在Web调整台实践命令,就能够得到如下八个图纸关系。如下所示。

必赢365net手机版 7

 

 

参谋资料:

Leave a Comment.