hugegraph Tool 用法
备份/加载数据
模式
hugegraph有以下几种模式:
- NONE
- RESTORING
- MERGING
- LOADING
其中:NONE
为普通模式,正常情况下应该处于该模式下。要导入数据时应该设置为RESTORING
,或MERGING
。
查看模式
# path/to/hugegraph-tools
bin/hugegraph --url http://ip:port graph-mode-get
删库
# path/to/hugegraph-tools
bin/hugegraph --url http://ip:port graph-clear -c "I'm sure to delete all data"
备份
备份可以在任意模式下执行
# path/to/hugegraph-tools
bin/hugegraph --url http://ip:port backup -t all -d path/to/save
恢复图数据
restore有两种模式:RESTORING
和MERGING
,与要恢复的目标数据库里面有没有数据有关。
# path/to/hugegraph-tools
# 设置成restore模式
bin/hugegraph --url http://ip:port graph-mode-set -m RESTORING
bin/hugegraph --url http://ip:port restore -t all -d path/to/save
# 恢复模式
bin/hugegraph --url http://ip:port graph-mode-set -m NONE