Linux上部署neo4j

1. 安装Java 1.8

2. 下载neo4j

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

3. 解压

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

4.修改目录

mv neo4j-community-3.2.0 neo4j

5.配置环境变量

vi /etc/profile

添加:

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

使之生效

source /etc/profile

6.

vi /etc/security/limits.conf

neo4j soft nofile 40000
neo4j hard nofile 40000

7.启动服务

neo4j start

查看状态

neo4j status

停止服务

neo4j stop

8.修改配置文件,允许远程访问web

cd /opt/neo4j/conf/

vi 

dbms.connectors.default_listen_address=0.0.0.0(即将# 删除)

之后重启服务,在本地访问

http://10.10.0.156:7474/

以neo4j/neo4j登录成功后,修改密码:123456

9.测试

cd /opt/neo4j/bin

./cypher-shell

此时,根据提示输入用户名neo4j,密码123456,登录到操作命令行下,创建简单的父子关系图

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); 

执行如下查询:

neo4j> match (n) return n;

返回所有节点和关联

+------------------------+
| n                      |
+------------------------+
| ({name: "张飞", id: 1})  |
| ({name: "张小二", id: 2}) |
| ({name: "张三", id: 3})  |
| ({name: "张凯", id: 4})  |
| ({name: "张雨", id: 5})  |
+------------------------+


来自:

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

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

你可能感兴趣的:(Linux上部署neo4j)