2. Introduction and installation of graph database Neo4j

       Today, let's talk about the graph database-Neo4j. It is an open source graph database developed by Neo Technology. The company has been developing graph databases since 2000. At present, Neo4j has become a leading graph database product. Multinational companies such as Cisco, Hewlett-Packard, and Germany have become its customers. The articles of the Knowledge Graph series will be included in my personal column "Knowledge Graph Series" , welcome everyone to pay attention~


table of Contents

1. Introduction to Neo4j

1.1 Introduction

1.2 Graphical data structure

Two, Neo4j installation

2.1 Install Neo4j under Linux

2.1.1 Check jdk

2.1.2 Download Neo4j

2.1.3 Upload and unzip

2.1.4 Configure environment variables

2.1.5 Modify the configuration file

2.1.6 Test

2.2 Install Neo4j under Windows

Three, simple to use


 

1. Introduction to Neo4j

1.1 Introduction

       Neo4j is a high-performance, NOSQL graph database that stores structured data on the network instead of in tables. It is an embedded, disk-based Java persistence engine with full transaction characteristics, but it stores structured data on the network (called a graph from a mathematical perspective) instead of in a table. Neo4j can also be seen as a high-performance graph engine that has all the characteristics of a mature database. Programmers work in an object-oriented, flexible network structure instead of strict, static tables-but they can enjoy all the benefits of an enterprise-level database with full transaction characteristics. ——Excerpt from "Baidu Encyclopedia"

       Features of Neo4j: 1. Intuitive graph model storage. 2. Fully support ACID transactions. 3. Disk-based persistent storage. 4. Support massive data, such as billions of node/relationship/attribute level data. 5. Highly available distributed cluster. 6. Highly optimized and fast graph query (Cypher graph query language). 7. It can be embedded (just a few small jar files) and supports REST API.

1.2 Graphical data structure

       There are two basic data types in a graph: Nodes and Relationships. Nodes and Relationships contain attributes in the form of key/value. Nodes are connected through the relationship defined by Relationships to form a relational network structure.

Two, Neo4j installation

       The installation of Neo4j has some requirements for hardware and system. Regarding Memory, the minimum requirement is 2GB. Regarding the CPU, the minimum requirement is that Itel Core i3 recommends Intel Core i7 or IBM POWER 8 Memory. Java must install OpenJDK 8 or Oracle Java 8 Operation System.

2.1 Install Neo4j under Linux

2.1.1 Check jdk

       The jdk of the editor is 1.8. If the jdk has not been installed, you can install it yourself. This is relatively simple, so I won't say more here.

2.1.2 Download Neo4j

       Those who have not downloaded it, please click here to download, we just use the community version, the commercial version is a bit extravagant.

2.1.3 Upload and unzip

[root@cdh-master software]# tar -zxvf neo4j-community-4.1.3-unix.tar.gz -C ../modules/

       The name in the modules directory is too long, so change the name:

[root@cdh-master modules]# mv neo4j-community-4.1.3 neo4j

2.1.4 Configure environment variables

vim /etc/profile

       Add the following code at the end of the article: 

       After saving and exiting, execute:

source /etc/profile

2.1.5 Modify the configuration file

        Open the neo4j.conf file:

       Configure dbms.connectors.default_advertised_address as the ip address of the server:

2.1.6 Test

       Oh, it's over... I didn't expect that after so long a hard work, the version did not match, hey, let's try it again, so I downloaded the lower version again.

       Test again, this is all right, here you need to pay attention to: neo4j console runs in the control foreground and neo4j start runs as a background program.

       The initial user name and password are both neo4j, and you can modify them after logging in.

       Finally, put a picture of the official installation steps:

2.2 Install Neo4j under Windows

       Personally, I feel that the installation under Windows is similar to the installation under Linux. Suddenly I don't want to write, but also download, unzip, and configure environment variables. Here are the differences. Start normally through neo4j console under Windows , as shown in the figure below. Install the service through neo4j install-service and start the service through neo4j start .

Three, simple to use

       1. Create two nodes and two relationships

CREATE (n:Person { name: 'xzw', title: 'KG' }) return n;
CREATE (n:Person { name: 'Eric', title: 'KG' }) return n;
match(n:Person{name:"Eric"}),(m:Person{name:"xzw"}) create (n)-[r:Friend]->(m) return r;
match(n:Person{name:"Eric"}),(m:Person{name:"xzw"}) create (n)<-[r:Friend]-(m) return r;

       2. View database graphics

match(n) return n

 

       This article is close to the end. This article mainly talks about the installation of Neo4j. As for the operation part, let's save it later. I recommend a tutorial. If you are interested, you can take a look. Please click here . What problems did you encounter in the process, welcome to leave a message, let me see what problems you all encountered~

Guess you like

Origin blog.csdn.net/gdkyxy2013/article/details/109484366