Hugegrap集群部署之Rocksdb存储 Hugegrap集群部署之Rocksdb存储 服务器信息
服务器ip
Role
配置信息
192.168.230.128
master
32c64G1000G
192.168.230.129
worker
32C64G1000G
192.168.230.130
worker
32C64G1000G
下载安装包 这里推荐使用1.5.0版本,途中踩了很多坑研究了很长时间,参考
1 https://gi thub.com/apache/i ncubator-hugegraph/issues/ 2787
1 2 https ://www.apache.org/dyn/closer.lua/incubator/hugegraph/1 .5 .0 /apache-hugegraph-incubating-1 .5 .0 .tar.gz?action=download
1 2 https ://www.apache.org/dyn/closer.lua/incubator/hugegraph/1 .5 .0 /apache-hugegraph-toolchain-incubating-1 .5 .0 .tar.gz?action=download
开始部署Hugegraph 1 2 tar xf apache-hugegraph-incubating-1 .5 .0 .tar.gz -C /home/hugegraphcd /home/hugegraph/apache-hugegraph-server-incubating-1 .5 .0 /conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 [root@localhost conf] restserver.url =http://0.0 .0.0 :8080 graphs =./conf/graphsbatch.max_write_ratio =80 batch.max_write_threads =0 arthas.telnet_port =8562 arthas.http_port =8561 arthas.ip =127.0 .0.1 arthas.disabled_commands =jadauth.authenticator =org.apache.hugegraph.auth.StandardAuthenticatorauth.graph_store =hugegraphrpc.server_host =192.168 .230.128 rpc.server_port =8091 rpc.server_timeout =30 rpc.remote_url =192.168 .230.128 :8091 ,192.168 .230.129 :8092 ,192.168 .230.130 :8093 server.id =server-1 server.role =masterlog.slow_query_threshold =1000 memory_monitor.threshold =0.85 memory_monitor.period =2000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [root@localhost conf] gremlin.graph =org.apache.hugegraph.HugeFactoryvertex.cache_type =l2edge.cache_type =l2backend =rocksdbserializer =binarystore =hugegraphtask.scheduler_type =localtask.schedule_period =10 task.retry =0 task.wait_timeout =10 search.text_analyzer =jiebasearch.text_analyzer_mode =INDEXrocksdb.data_path =./datarocksdb.wal_path =./walraft.mode =true raft.group_peers =192.168 .230.128 :8091 ,192.168 .230.129 :8092 ,192.168 .230.130 :8093 rocksdb.write_buffer_size =134217728 rocksdb.max_write_buffer_number =6 rocksdb.block_cache_size =8589934592
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 cd /home scp -r hugegraph/ root@192.168.230.129:/home rpc.server_host =192.168.230.129 rpc.server_port =8092 server.id =server-2 server.role =worker rpc.server_host =192.168.230.130 rpc.server_port =8093 server.id =server-3 server.role =worker
1 2 3 4 cd /home/hugegraph/apache-hugegraph-server-incubating-1.5.0/bin ./init-store.sh
1 2 3 4 5 6 7 8 # 三台都要操作,启动服务 [root@localhost bin]# ./start-hugegraph.sh Starting HugeGraphServer in daemon mode... Connecting to HugeGraphServer (http://0.0 .0 .0 :8080 /graphs)............... The operation timed out(30 s) when attempting to connect to http://0.0 .0 .0 :8080 /graphs See /home/apache-hugegraph-incubating-1.5 .0 /apache-hugegraph-server-incubating-1.5 .0 /logs/hugegraph-server.log for HugeGraphServer log output.# 可能会报错,稍等一会就好
验证集群状态 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [root@localhost conf] % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 84 100 84 0 0 8581 0 --:-- :-- --:-- :-- --:-- :-- 9333 { "hugegraph" : [ "192.168.230.128:8091" , "192.168.230.129:8092" , "192.168.230.130:8093" ] } [root@localhost conf] % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 36 100 36 0 0 3610 0 --:-- :-- --:-- :-- --:-- :-- 3600 { "hugegraph" : "192.168.230.128:8091" }
1 2 3 4 5 6 7 8 9 10 11 12 13 常用接口如下: 查询 Raft 集群所有节点(peers):GET http: //<host>:<port>/graphs/<graph>/raft/list_peers 查询当前 leader 节点:GET http: //<host>:<port>/graphs/<graph>/raft/get_leader 查询系统健康指标:GET http: //<host>:<port>/metrics/system 查询后端存储健康指标:GET http: //<host>:<port>/metrics/backend curl -X GET "http://192.168.230.128:8080/graphs/hugegraph/raft/list_peers" -u admin: 密码"
部署web可视化工具 1 2 3 4 tar xf apache-hugegraph-toolchain-incubating-1.5.0.tar.gz -C /homecd /home/apache-hugegraph-toolchain-incubating-1.5.0/apache-hugegraph-hubble-incubating-1.5.0/bin ./start-hubble.sh
访问web
创建图 创建顶点和边测试