Neo4j集群安装 博客分类: neo4j
1:集群规划
nosql1 192.168.100.131
nosql2 192.168.100.132
nosql3 192.168.100.133
2:在ubutu客户端下载解压neo4j安装包,并上传到集群服务器
mmicky@wyy :/app$ sudo tar zxf /home/mmicky/Soft/nosql/neo4j-enterprise-1.9.4-unix.tar.gz
mmicky@wyy :/app$ sudo chown -R root:root neo4j-enterprise-1.9.4
mmicky@wyy :/app$ sudo mv neo4j-enterprise-1.9.4 neo4j194
mmicky@wyy :/app$ sudo scp -r neo4j194 root@192.168.100.131:/app/
mmicky@wyy:/app$ sudo scp -r neo4j194 root@192.168.100.132:/app/
mmicky@wyy:/app$ sudo scp -r neo4j194 root@192.168.100.133:/app/
3:打开节点终端,编辑相关的配置文件
注意:Neo4j对打开文件数至少是40000,所以要对系统参数进行设置,不然启动的时候会出现如下的错误:
节点nosql1(192.168.100.131)
[root@nosql1 neo4j194]# vi /etc/security/limits.conf
root soft nofile 40000
root hard nofile 40000
[root@nosql1 neo4j194]# vi /etc/pam.d/login
session required pam_limits.so
[root@nosql1 neo4j194]# vi conf/neo4j-server.properties
org.neo4j.server.webserver.address=0.0.0.0
org.neo4j.server.database.mode=HA
[root@nosql1 neo4j194]# vi conf/neo4j.properties
ha.server_id=1
ha.server=192.168.100.131:6001
ha.cluster_server=192.168.100.131:5001
ha.initial_hosts=192.168.100.131:5001,192.168.100.132:5001,192.168.100.133:5001
节点nosql2(192.168.100.132)
[root@nosql2 neo4j194]# vi /etc/security/limits.conf
root soft nofile 40000
root hard nofile 40000
[root@nosql2 neo4j194]# vi /etc/pam.d/login
session required pam_limits.so
[root@nosql2 neo4j194]# vi conf/neo4j-server.properties
org.neo4j.server.webserver.address=0.0.0.0
org.neo4j.server.database.mode=HA
[root@nosql2 neo4j194]# vi conf/neo4j.properties
ha.server_id=2
ha.server=192.168.100.132:6001
ha.cluster_server=192.168.100.132:5001
ha.initial_hosts=192.168.100.131:5001,192.168.100.132:5001,192.168.100.133:5001
节点nosql3(192.168.100.133)
[root@nosql3 neo4j194]# vi /etc/security/limits.conf
root soft nofile 40000
root hard nofile 40000
[root@nosql3 neo4j194]# vi /etc/pam.d/login
session required pam_limits.so
[root@nosql3 neo4j194]# vi conf/neo4j-server.properties
org.neo4j.server.webserver.address=0.0.0.0
org.neo4j.server.database.mode=HA
[root@nosql3 neo4j194]# vi conf/neo4j.properties
ha.server_id=3
ha.server=192.168.100.133:6001
ha.cluster_server=192.168.100.133:5001
ha.initial_hosts=192.168.100.131:5001,192.168.100.132:5001,192.168.100.133:5001
4:由于修改了系统配置文件,重启各节点后再启动集群
[root@nosql1 neo4j194]# bin/neo4j start
[root@nosql2 neo4j194]# bin/neo4j start
[root@nosql3 neo4j194]# bin/neo4j start
5:访问集群
在客户机ubuntu上打开浏览器,录入下列几个地址都可访问:
http://192.168.100.131:7474/webadmin
http://192.168.100.132:7474/webadmin
http://192.168.100.133:7474/webadmin