OrientDB分布式安装文档

step 1:在虚拟机centos上新建用户jdorientdb,下载orientdb包解压到 /software/orientdb目录

step 2:设置ORIENTDB_HOME环境变量

1
2
3
4
5
vim ~/.bash_rc
export ORIENTDB_HOME="your soft directory"
source ~/.bash_rc

step 3:修改config/orientdb-server-config.xml,设置用户登录密码

1
2
3
<users>
<user resources="*" password="jdorientdb" name="jdorientdb"/>
</users>

step 4:修改bin/orientdb.sh

orientdb启动默认需要root权限,修改配置去除root权限限制

1
2
3
4
5
6
7
8
9
10
11
# You have to SET the OrientDB installation directory here
ORIENTDB_DIR="$ORIENTDB_HOME"
ORIENTDB_USER="jdorientdb"
start方法中注释root权限执行:
#su $ORIENTDB_USER -c "cd \"$ORIENTDB_DIR/bin\";
/usr/bin/nohup ./server.sh 1>$LOG_DIR/orientdb.log 2>$LOG_DIR/orientdb.err &
stop方法中注释root权限执行:
#su $ORIENTDB_USER -c "cd \"$ORIENTDB_DIR/bin\";
/usr/bin/nohup ./shutdown.sh 1>>$LOG_DIR/orientdb.log 2>>$LOG_DIR/orientdb.err &

step 5:配置集群中各节点发现服务,修改configh/azecast.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<group>
<name>jdorientdb</name>
<password>jdorientdb</password>
</group>
<network>
<port auto-increment="true">2434</port>
<join>
<multicast enabled="false">
<multicast-group>235.1.1.1</multicast-group>
<multicast-port>2434</multicast-port>
</multicast>
<tcp-ip enabled="true">#配置待优化
<member>jdorientdb1:2434</member>
<member>jdorientdb2:2434</member>
<member>jdorientdb3:2434</member>
<member>jdorientdb4:2434</member>
</tcp-ip>
</join>
</network>

step6:修改config/default-distributed-db-config.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"autoDeploy": true,
"readQuorum": 1,
"writeQuorum": "majority",
"executionMode": "asynchronous",
"readYourWrites": true,
"servers": {
"jdorientdb1": "master",
"jdorietndb2":"master",
"jdorientdb3":"master",
"jdorientdb4":"master"
},
"clusters": {
"internal": {
},
"*": {
"servers": ["jdorientdb1","jdorientdb2","jdorientdb3","jdorientdb4"]
}
}
}

step 7:每台虚拟机分别设置ip别名,修改/etc/hosts

1
2
3
4
10.14.133.18 jdorientdb2
10.14.133.13 jdorientdb1
10.14.133.25 jdorientdb3
10.14.133.75 jdorientdb4

step 8:将配置好的orientdb分别发送到其他虚拟机

1
scp -r /software/orientdb jdorientdb@jdorientdb2:/software/jdorientdb

step 9:分别启动每台虚拟机上的orientdb进程

1
2
3
nohup bin/dserver.sh > tmp.log &
首次启动需要设置nodeName,设置为与ip别名一致

Reference:

1.Distributed-Configuration
2.http://blog.topspeedsnail.com/archives/1884
3.Performance-Tuning