Deploy neo4j on Linux

1. Install Java 1.8

2. Download neo4j

wget http://we-yun.com/download/Neo4j-Releases/3.2.0/neo4j-communitygz

3. Unzip

tar zxvf neo4j-community-3.2.0-unix.tar.gz

4. Modify directory

mv neo4j-community-3.2.0 neo4j

5. Configure environment variables

vi /etc/profile

Add to:

export NEO4J_HOME=/opt/neo4j
export PATH=$PATH:$NEO4J_HOME/bin

make it effective

source /etc/profile

6.

vi /etc/security/limits.conf

neo4j soft nofile 40000
neo4j hard nofile 40000

7. Start the service

neo4j start

View status

neo4j status

Out of service

neo4j stop

8. Modify the configuration file to allow remote access to the web

cd /opt/neo4j/conf/

vi 

dbms.connectors.default_listen_address=0.0.0.0 (will be # deleted soon)

Then restart the service and access it locally

http://10.10.0.156:7474/

After successfully logging in with neo4j/neo4j, change the password: 123456

9.Testing

cd /opt/neo4j/bin

./cypher-shell

At this time, enter the user name neo4j and password 123456 according to the prompts, log in to the operation command line, and create a simple parent-child relationship diagram

neo4j> CREATE (A {id:1,name:'Zhang Fei'}), (B {id:2,name:'Zhang Xiaoer'}), (C {id:3,name:'Zhang San'} ), (D {id:4,name:'Zhang Kai'}),(E {id:5,name:'Zhang Yu'}),(A)-[:Son]->(B),(A )-[:Son]->(C),(B)-[:Son]->(D),(C)-[:Son]->(E); 

Execute the following query:

neo4j> match (n) return n;

Return all nodes and associations

+------------------------+
| n |
+------------------------ ----+
| ({name: "Zhang Fei", id: 1}) | |
({name: "Zhang Xiaoer", id: 2}) | | (
{name: "Zhang San", id: 3}) |
| ({name: "Zhang Kai", id: 4}) | |
({name: "Zhang Yu", id: 5}) |
+------------- ----------+


from:

http://www.cnblogs.com/hwaggLee/p/5959716.html

http://www.cnblogs.com/kerrycode/p/6526484.html

Guess you like

Origin blog.csdn.net/victory0508/article/details/78432462