NO IMAGE
1:叢集規劃
nosql1    192.168.100.131
nosql2    192.168.100.132
nosql3    192.168.100.133

2:在ubutu客戶端下載解壓neo4j安裝包,並上傳到叢集伺服器
[email protected]:/app$ sudo tar zxf /home/mmicky/Soft/nosql/neo4j-enterprise-1.9.4-unix.tar.gz
[email protected]:/app$ sudo chown -R root:root neo4j-enterprise-1.9.4
[email protected]:/app$ sudo mv neo4j-enterprise-1.9.4 neo4j194
[email protected]:/app$ sudo scp -r neo4j194 [email protected]:/app/
[email protected]:/app$ sudo scp -r neo4j194 [email protected]:/app/
[email protected]:/app$ sudo scp -r neo4j194 [email protected]:/app/

3:開啟節點終端,編輯相關的配置檔案
注意:Neo4j對開啟檔案數至少是40000,所以要對系統引數進行設定,不然啟動的時候會出現如下的錯誤:

Neo4j叢集安裝 - mmicky - mmicky 的部落格

節點nosql1(192.168.100.131)
[[email protected] neo4j194]# vi /etc/security/limits.conf
root    soft    nofile  40000
root    hard    nofile  40000
[[email protected] neo4j194]# vi /etc/pam.d/login
session    required    pam_limits.so
[[email protected] neo4j194]# vi conf/neo4j-server.properties
org.neo4j.server.webserver.address=0.0.0.0
org.neo4j.server.database.mode=HA
[[email protected] 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)
[[email protected] neo4j194]# vi /etc/security/limits.conf
root    soft    nofile  40000
root    hard    nofile  40000
[[email protected] neo4j194]# vi /etc/pam.d/login
session    required    pam_limits.so
[[email protected] neo4j194]# vi conf/neo4j-server.properties
org.neo4j.server.webserver.address=0.0.0.0
org.neo4j.server.database.mode=HA
[[email protected] 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)
[[email protected] neo4j194]# vi /etc/security/limits.conf
root    soft    nofile  40000
root    hard    nofile  40000
[[email protected] neo4j194]# vi /etc/pam.d/login
session    required    pam_limits.so
[[email protected] neo4j194]# vi conf/neo4j-server.properties
org.neo4j.server.webserver.address=0.0.0.0
org.neo4j.server.database.mode=HA
[[email protected] 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:由於修改了系統配置檔案,重啟各節點後再啟動叢集
[[email protected] neo4j194]# bin/neo4j start
[[email protected] neo4j194]# bin/neo4j start
[[email protected] neo4j194]# bin/neo4j start

Neo4j叢集安裝 - mmicky - mmicky 的部落格

5:訪問叢集
在客戶機ubuntu上開啟瀏覽器,錄入下列幾個地址都可訪問:
http://192.168.100.131:7474/webadmin
http://192.168.100.132:7474/webadmin
http://192.168.100.133:7474/webadmin

Neo4j叢集安裝 - mmicky - mmicky 的部落格