diff --git a/content/en/docs/quickstart/hugegraph-tools.md b/content/en/docs/quickstart/hugegraph-tools.md index 5f860d319..3d86dfed8 100644 --- a/content/en/docs/quickstart/hugegraph-tools.md +++ b/content/en/docs/quickstart/hugegraph-tools.md @@ -4,76 +4,76 @@ linkTitle: "Manage with HugeGraph-Tools" weight: 3 --- -### 1 HugeGraph-Tools概述 +### 1 HugeGraph-Tools Overview -HugeGraph-Tools 是 HugeGraph 的自动化部署、管理和备份/还原组件。 +HugeGraph-Tools is an automated deployment, management and backup/restore component of HugeGraph. -### 2 获取 HugeGraph-Tools +### 2 Get HugeGraph-Tools -有两种方式可以获取 HugeGraph-Tools: +There are two ways to get HugeGraph-Tools: -- 下载二进制tar包 -- 下载源码编译安装 +- Download the compiled tarball +- Clone source code then compile and install -#### 2.1 下载二进制tar包 +#### 2.1 Download the compiled archive -下载最新版本的 HugeGraph-Tools 包: +Download the latest version of the HugeGraph-Tools package: ```bash wget https://github.com/hugegraph/hugegraph-tools/releases/download/v${version}/hugegraph-tools-${version}.tar.gz tar zxvf hugegraph-tools-${version}.tar.gz ``` -#### 2.2 下载源码编译安装 +#### 2.2 Clone source code to compile and install -下载最新版本的 HugeGraph-Tools 源码包: +Download the latest version of the HugeGraph-Tools source package: ```bash $ git clone https://github.com/hugegraph/hugegraph-tools.git ``` -编译生成 tar 包: +Compile and generate tar package: ```bash cd hugegraph-tools mvn package -DskipTests ``` -生成 tar 包 hugegraph-tools-${version}.tar.gz +Generate tar package hugegraph-tools-${version}.tar.gz -### 3 使用 +### 3 How to use -#### 3.1 功能概览 +#### 3.1 Function overview -解压后,进入 hugegraph-tools 目录,可以使用`bin/hugegraph`或者`bin/hugegraph help`来查看 usage 信息。主要分为: +After decompression, enter the hugegraph-tools directory, you can use `bin/hugegraph` or `bin/hugegraph help` to view the usage information. mainly divided: -- 图管理类,graph-mode-set、graph-mode-get、graph-list、graph-get 和 graph-clear -- 异步任务管理类,task-list、task-get、task-delete、task-cancel 和 task-clear -- Gremlin类,gremlin-execute 和 gremlin-schedule -- 备份/恢复类,backup、restore、migrate、schedule-backup 和 dump -- 安装部署类,deploy、clear、start-all 和 stop-all +- Graph management Type,graph-mode-set、graph-mode-get、graph-list、graph-get and graph-clear +- Asynchronous task management Type,task-list、task-get、task-delete、task-cancel and task-clear +- Gremlin Type,gremlin-execute and gremlin-schedule +- Backup/Restore Type,backup、restore、migrate、schedule-backup and dump +- Install the deployment Type,deploy、clear、start-all and stop-all ```bash Usage: hugegraph [options] [command] [command options] ``` -##### 3.2 [options]-全局变量 +##### 3.2 [options]-Global Variable -`options`是 HugeGraph-Tools 的全局变量,可以在 hugegraph-tools/bin/hugegraph 中配置,包括: +`options` is a global variable of HugeGraph-Tools, which can be configured in hugegraph-tools/bin/hugegraph, including: -- --graph,HugeGraph-Tools 操作的图的名字,默认值是 hugegraph -- --url,HugeGraph-Server 的服务地址,默认是 http://127.0.0.1:8080 -- --user,当 HugeGraph-Server 开启认证时,传递用户名 -- --password,当 HugeGraph-Server 开启认证时,传递用户的密码 -- --timeout,连接 HugeGraph-Server 时的超时时间,默认是 30s -- --trust-store-file,证书文件的路径,当 --url 使用 https 时,HugeGraph-Client 使用的 truststore 文件,默认为空,代表使用 hugegraph-tools 内置的 truststore 文件 conf/hugegraph.truststore -- --trust-store-password,证书文件的密码,当 --url 使用 https 时,HugeGraph-Client 使用的 truststore 的密码,默认为空,代表使用 hugegraph-tools 内置的 truststore 文件的密码 +- --graph,HugeGraph-Tools The name of the graph to operate on, the default value is hugegraph +- --url,The service address of HugeGraph-Server, the default is http://127.0.0.1:8080 +- --user,When HugeGraph-Server opens authentication, pass username +- --password,When HugeGraph-Server opens authentication, pass the user's password +- --timeout,Timeout when connecting to HugeGraph-Server, the default is 30s +- --trust-store-file,The path of the certificate file, when --url uses https, the truststore file used by HugeGraph-Client, the default is empty, which means using the built-in truststore file conf/hugegraph.truststore of hugegraph-tools +- --trust-store-password,The password of the certificate file, when --url uses https, the password of the truststore used by HugeGraph-Client, the default is empty, representing the password of the built-in truststore file of hugegraph-tools -上述全局变量,也可以通过环境变量来设置。一种方式是在命令行使用 export 设置临时环境变量,在该命令行关闭之前均有效 +The above global variables can also be set through environment variables. One way is to use export on the command line to set temporary environment variables, which are valid until the command line is closed -| 全局变量 | 环境变量 | 示例 | +| Global Variable | Environment Variable | Example | |------------------------|--------------------------------|----------------------------------------------------| | --url | HUGEGRAPH_URL | export HUGEGRAPH_URL=http://127.0.0.1:8080 | | --graph | HUGEGRAPH_GRAPH | export HUGEGRAPH_GRAPH=hugegraph | @@ -83,7 +83,7 @@ Usage: hugegraph [options] [command] [command options] | --trust-store-file | HUGEGRAPH_TRUST_STORE_FILE | export HUGEGRAPH_TRUST_STORE_FILE=/tmp/trust-store | | --trust-store-password | HUGEGRAPH_TRUST_STORE_PASSWORD | export HUGEGRAPH_TRUST_STORE_PASSWORD=xxxx | -另一种方式是在 bin/hugegraph 脚本中设置环境变量: +Another way is to set the environment variable in the bin/hugegraph script: ``` #!/bin/bash @@ -98,119 +98,119 @@ Usage: hugegraph [options] [command] [command options] #export HUGEGRAPH_TRUST_STORE_PASSWORD= ``` -##### 3.3 图管理类,graph-mode-set、graph-mode-get、graph-list、graph-get和graph-clear - -- graph-mode-set,设置图的 restore mode - - --graph-mode 或者 -m,必填项,指定将要设置的模式,合法值包括 [NONE, RESTORING, MERGING, LOADING] -- graph-mode-get,获取图的 restore mode -- graph-list,列出某个 HugeGraph-Server 中全部的图 -- graph-get,获取某个图及其存储后端类型 -- graph-clear,清除某个图的全部 schema 和 data - - --confirm-message 或者 -c,必填项,删除确认信息,需要手动输入,二次确认防止误删,"I'm sure to delete all data",包括双引号 - -> 当需要把备份的图原样恢复到一个新的图中的时候,需要先将图模式设置为 RESTORING 模式;当需要将备份的图合并到已存在的图中时,需要先将图模式设置为 MERGING 模式。 - -##### 3.4 异步任务管理类,task-list、task-get和task-delete - -- task-list,列出某个图中的异步任务,可以根据任务的状态过滤 - - --status,选填项,指定要查看的任务的状态,即按状态过滤任务 - - --limit,选填项,指定要获取的任务的数目,默认为 -1,意思为获取全部符合条件的任务 -- task-get,获取某个异步任务的详细信息 - - --task-id,必填项,指定异步任务的 ID -- task-delete,删除某个异步任务的信息 - - --task-id,必填项,指定异步任务的 ID -- task-cancel,取消某个异步任务的执行 - - --task-id,要取消的异步任务的 ID -- task-clear,清理完成的异步任务 - - --force,选填项,设置时,表示清理全部异步任务,未执行完成的先取消,然后清除所有异步任务。默认只清理已完成的异步任务 - -##### 3.5 Gremlin类,gremlin-execute和gremlin-schedule - -- gremlin-execute,发送 Gremlin 语句到 HugeGraph-Server 来执行查询或修改操作,同步执行,结束后返回结果 - - --file 或者 -f,指定要执行的脚本文件,UTF-8编码,与 --script 互斥 - - --script 或者 -s,指定要执行的脚本字符串,与 --file 互斥 - - --aliases 或者 -a,Gremlin 别名设置,格式为:key1=value1,key2=value2,... - - --bindings 或者 -b,Gremlin 绑定设置,格式为:key1=value1,key2=value2,... - - --language 或者 -l,Gremlin 脚本的语言,默认为 gremlin-groovy - > --file 和 --script 二者互斥,必须设置其中之一 -- gremlin-schedule,发送 Gremlin 语句到 HugeGraph-Server 来执行查询或修改操作,异步执行,任务提交后立刻返回异步任务id - - --file 或者 -f,指定要执行的脚本文件,UTF-8编码,与 --script 互斥 - - --script 或者 -s,指定要执行的脚本字符串,与 --file 互斥 - - --bindings 或者 -b,Gremlin 绑定设置,格式为:key1=value1,key2=value2,... - - --language 或者 -l,Gremlin 脚本的语言,默认为 gremlin-groovy - > --file 和 --script 二者互斥,必须设置其中之一 - -##### 3.6 备份/恢复类 - -- backup,将某张图中的 schema 或者 data 备份到 HugeGraph 系统之外,以 JSON 形式存在本地磁盘或者 HDFS - - --format,备份的格式,可选值包括 [json, text],默认为 json - - --all-properties,是否备份顶点/边全部的属性,仅在 --format 为 text 是有效,默认 false - - --label,要备份的顶点/边的类型,仅在 --format 为 text 是有效,只有备份顶点或者边的时候有效 - - --properties,要备份的顶点/边的属性,逗号分隔,仅在 --format 为 text 是有效,只有备份顶点或者边的时候有效 - - --compress,备份时是否压缩数据,默认为 true - - --directory 或者 -d,存储 schema 或者 data 的目录,本地目录时,默认为'./{graphName}',HDFS 时,默认为 '{fs.default.name}/{graphName}' - - --huge-types 或者 -t,要备份的数据类型,逗号分隔,可选值为 'all' 或者 一个或多个 [vertex,edge,vertex_label,edge_label,property_key,index_label] 的组合,'all' 代表全部6种类型,即顶点、边和所有schema - - --log 或者 -l,指定日志目录,默认为当前目录 - - --retry,指定失败重试次数,默认为 3 - - --split-size 或者 -s,指定在备份时对顶点或者边分块的大小,默认为 1048576 - - -D,用 -Dkey=value 的模式指定动态参数,用来备份数据到 HDFS 时,指定 HDFS 的配置项,例如:-Dfs.default.name=hdfs://localhost:9000 -- restore,将 JSON 格式存储的 schema 或者 data 恢复到一个新图中(RESTORING 模式)或者合并到已存在的图中(MERGING 模式) - - --directory 或者 -d,存储 schema 或者 data 的目录,本地目录时,默认为'./{graphName}',HDFS 时,默认为 '{fs.default.name}/{graphName}' - - --clean,是否在恢复图完成后删除 --directory 指定的目录,默认为 false - - --huge-types 或者 -t,要恢复的数据类型,逗号分隔,可选值为 'all' 或者 一个或多个 [vertex,edge,vertex_label,edge_label,property_key,index_label] 的组合,'all' 代表全部6种类型,即顶点、边和所有schema - - --log 或者 -l,指定日志目录,默认为当前目录 - - --retry,指定失败重试次数,默认为 3 - - -D,用 -Dkey=value 的模式指定动态参数,用来从 HDFS 恢复图时,指定 HDFS 的配置项,例如:-Dfs.default.name=hdfs://localhost:9000 - > 只有当 --format 为 json 执行 backup 时,才可以使用 restore 命令恢复 -- migrate, 将当前连接的图迁移至另一个 HugeGraphServer 中 - - --target-graph,目标图的名字,默认为 hugegraph - - --target-url,目标图所在的 HugeGraphServer,默认为 http://127.0.0.1:8081 - - --target-username,访问目标图的用户名 - - --target-password,访问目标图的密码 - - --target-timeout,访问目标图的超时时间 - - --target-trust-store-file,访问目标图使用的 truststore 文件 - - --target-trust-store-password,访问目标图使用的 truststore 的密码 - - --directory 或者 -d,迁移过程中,存储源图的 schema 或者 data 的目录,本地目录时,默认为'./{graphName}',HDFS 时,默认为 '{fs.default.name}/{graphName}' - - --huge-types 或者 -t,要迁移的数据类型,逗号分隔,可选值为 'all' 或者 一个或多个 [vertex,edge,vertex_label,edge_label,property_key,index_label] 的组合,'all' 代表全部6种类型,即顶点、边和所有schema - - --log 或者 -l,指定日志目录,默认为当前目录 - - --retry,指定失败重试次数,默认为 3 - - --split-size 或者 -s,指定迁移过程中对源图进行备份时顶点或者边分块的大小,默认为 1048576 - - -D,用 -Dkey=value 的模式指定动态参数,用来在迁移图过程中需要备份数据到 HDFS 时,指定 HDFS 的配置项,例如:-Dfs.default.name=hdfs://localhost:9000 - - --graph-mode 或者 -m,将源图恢复到目标图时将目标图设置的模式,合法值包括 [RESTORING, MERGING] - - --keep-local-data,是否保留在迁移图的过程中产生的源图的备份,默认为 false,即默认迁移图结束后不保留产生的源图备份 -- schedule-backup,周期性对图执行备份操作,并保留一定数目的最新备份(目前仅支持本地文件系统) - - --directory 或者 -d,必填项,指定备份数据的目录 - - --backup-num,选填项,指定保存的最新的备份的数目,默认为 3 - - --interval,选填项,指定进行备份的周期,格式同 Linux crontab 格式 -- dump,把整张图的顶点和边全部导出,默认以`vertex vertex-edge1 vertex-edge2...`JSON格式存储。 -用户也可以自定义存储格式,只需要在`hugegraph-tools/src/main/java/com/baidu/hugegraph/formatter` -目录下实现一个继承自`Formatter`的类,例如`CustomFormatter`,使用时指定该类为formatter即可,例如 -`bin/hugegraph dump -f CustomFormatter` - - --formatter 或者 -f,指定使用的 formatter,默认为 JsonFormatter - - --directory 或者 -d,存储 schema 或者 data 的目录,默认为当前目录 - - --log 或者 -l,指定日志目录,默认为当前目录 - - --retry,指定失败重试次数,默认为 3 - - --split-size 或者 -s,指定在备份时对顶点或者边分块的大小,默认为 1048576 - - -D,用 -Dkey=value 的模式指定动态参数,用来备份数据到 HDFS 时,指定 HDFS 的配置项,例如:-Dfs.default.name=hdfs://localhost:9000 - -##### 3.7 安装部署类 - -- deploy,一键下载、安装和启动 HugeGraph-Server 和 HugeGraph-Studio - - -v,必填项,指明安装的 HugeGraph-Server 和 HugeGraph-Studio 的版本号,最新的是 0.9 - - -p,必填项,指定安装的 HugeGraph-Server 和 HugeGraph-Studio 目录 - - -u,选填项,指定下载 HugeGraph-Server 和 HugeGraph-Studio 压缩包的链接 -- clear,清理 HugeGraph-Server 和 HugeGraph-Studio 目录和tar包 - - -p,必填项,指定要清理的 HugeGraph-Server 和 HugeGraph-Studio 的目录 -- start-all,一键启动 HugeGraph-Server 和 HugeGraph-Studio,并启动监控,服务死掉时自动拉起服务 - - -v,必填项,指明要启动的 HugeGraph-Server 和 HugeGraph-Studio 的版本号,最新的是 0.9 - - -p,必填项,指定安装了 HugeGraph-Server 和 HugeGraph-Studio 的目录 -- stop-all,一键关闭 HugeGraph-Server 和 HugeGraph-Studio - -> deploy命令中有可选参数 -u,提供时会使用指定的下载地址替代默认下载地址下载 tar 包,并且将地址写入`~/hugegraph-download-url-prefix`文件中;之后如果不指定地址时,会优先从`~/hugegraph-download-url-prefix`指定的地址下载 tar 包;如果 -u 和`~/hugegraph-download-url-prefix`都没有时,会从默认下载地址进行下载 - -##### 3.8 具体命令参数 - -各子命令的具体参数如下: +##### 3.3 Graph Management Type,graph-mode-set、graph-mode-get、graph-list、graph-get and graph-clear + +- graph-mode-set,set graph restore mode + - --graph-mode or -m, required, specifies the mode to be set, legal values include [NONE, RESTORING, MERGING, LOADING] +- graph-mode-get,get graph restore mode +- graph-list,list all graphs in a HugeGraph-Server +- graph-get,get a graph and its storage backend type +- graph-clear,clear all schema and data of a graph + - --confirm-message Or -c, required, delete confirmation information, manual input is required, double confirmation to prevent accidental deletion, "I'm sure to delete all data", including double quotes + +> When you need to restore the backup graph to a new graph, you need to set the graph mode to RESTORING mode; when you need to merge the backup graph into an existing graph, you need to first set the graph mode to MERGING model. + +##### 3.4 Asynchronous task management Type,task-list、task-get and task-delete + +- task-list,List the asynchronous tasks in a graph, which can be filtered according to the status of the tasks + - --status,Optional, specify the status of the task to view, i.e. filter tasks by status + - --limit,Optional, specify the number of tasks to be obtained, the default is -1, which means to obtain all eligible tasks +- task-get,Get detailed information about an asynchronous task + - --task-id,Required, specifies the ID of the asynchronous task +- task-delete,Delete information about an asynchronous task + - --task-id,Required, specifies the ID of the asynchronous task +- task-cancel,Cancel the execution of an asynchronous task + - --task-id,ID of the asynchronous task to cancel +- task-clear,Clean up completed asynchronous tasks + - --force,Optional. When set, it means to clean up all asynchronous tasks. Unfinished ones are canceled first, and then all asynchronous tasks are cleared. By default, only completed asynchronous tasks are cleaned up + +##### 3.5 Gremlin Type,gremlin-execute and gremlin-schedule + +- gremlin-execute, send Gremlin statements to HugeGraph-Server to execute query or modification operations, execute synchronously, and return results after completion + - --file or -f, specify the script file to execute, UTF-8 encoding, mutually exclusive with --script + - --script or -s, specifies the script string to execute, mutually exclusive with --file + - --aliases or -a, Gremlin alias settings, the format is: key1=value1,key2=value2,... + - --bindings or -b, Gremlin binding settings, the format is: key1=value1,key2=value2,... + - --language or -l, the language of the Gremlin script, the default is gremlin-groovy + > --file and --script are mutually exclusive, one of them must be set +- gremlin-schedule, send Gremlin statements to HugeGraph-Server to perform query or modification operations, asynchronous execution, and return the asynchronous task id immediately after the task is submitted + - --file or -f, specify the script file to execute, UTF-8 encoding, mutually exclusive with --script + - --script or -s, specifies the script string to execute, mutually exclusive with --file + - --bindings or -b, Gremlin binding settings, the format is: key1=value1,key2=value2,... + - --language or -l, the language of the Gremlin script, the default is gremlin-groovy + > --file and --script are mutually exclusive, one of them must be set + +##### 3.6 Backup/Restore Type + +- backup, back up the schema or data in a certain graph out of the HugeGraph system, and store it on the local disk or HDFS in the form of JSON + - --format, the backup format, optional values include [json, text], the default is json + - --all-properties, whether to back up all properties of vertices/edges, only valid when --format is text, default false + - --label, the type of vertices/edges to be backed up, only valid when --format is text, only valid when backing up vertices or edges + - --properties, properties of vertices/edges to be backed up, separated by commas, only valid when --format is text, valid only when backing up vertices or edges + - --compress, whether to compress data during backup, the default is true + - --directory or -d, the directory to store schema or data, the default is './{graphName}' for local directory, and '{fs.default.name}/{graphName}' for HDFS + - --huge-types or -t, the data types to be backed up, separated by commas, the optional value is 'all' or a combination of one or more [vertex, edge, vertex_label, edge_label, property_key, index_label], 'all' Represents all 6 types, namely vertices, edges and all schemas + - --log or -l, specify the log directory, the default is the current directory + - --retry, specify the number of failed retries, the default is 3 + - --split-size or -s, specifies the size of splitting vertices or edges when backing up, the default is 1048576 + - -D, use the mode of -Dkey=value to specify dynamic parameters, and specify HDFS configuration items when backing up data to HDFS, for example: -Dfs.default.name=hdfs://localhost:9000 +- restore, restore schema or data stored in JSON format to a new graph (RESTORING mode) or merge into an existing graph (MERGING mode) + - --directory or -d, the directory to store schema or data, the default is './{graphName}' for local directory, and '{fs.default.name}/{graphName}' for HDFS + - --clean, whether to delete the directory specified by --directory after the recovery map is completed, the default is false + - --huge-types or -t, data types to restore, separated by commas, optional value is 'all' or a combination of one or more [vertex, edge, vertex_label, edge_label, property_key, index_label], 'all' Represents all 6 types, namely vertices, edges and all schemas + - --log or -l, specify the log directory, the default is the current directory + - --retry, specify the number of failed retries, the default is 3 + - -D, use the mode of -Dkey=value to specify dynamic parameters, which are used to specify HDFS configuration items when restoring graphs from HDFS, for example: -Dfs.default.name=hdfs://localhost:9000 + > restore command can be used only if --format is executed as backup for json +- migrate, migrate the currently connected graph to another HugeGraphServer + - --target-graph, the name of the target graph, the default is hugegraph + - --target-url, the HugeGraphServer where the target graph is located, the default is http://127.0.0.1:8081 + - --target-username, the username to access the target map + - --target-password, the password to access the target map + - --target-timeout, the timeout for accessing the target map + - --target-trust-store-file, access the truststore file used by the target graph + - --target-trust-store-password, the password to access the truststore used by the target map + - --directory or -d, during the migration process, the directory where the schema or data of the source graph is stored. For a local directory, the default is './{graphName}'; for HDFS, the default is '{fs.default.name}/ {graphName}' + - --huge-types or -t, the data types to be migrated, separated by commas, the optional value is 'all' or a combination of one or more [vertex, edge, vertex_label, edge_label, property_key, index_label], 'all' Represents all 6 types, namely vertices, edges and all schemas + - --log or -l, specify the log directory, the default is the current directory + - --retry, specify the number of failed retries, the default is 3 + - --split-size or -s, specify the size of the vertex or edge block when backing up the source graph during the migration process, the default is 1048576 + - -D, use the mode of -Dkey=value to specify dynamic parameters, which are used to specify HDFS configuration items when the data needs to be backed up to HDFS during the migration process, for example: -Dfs.default.name=hdfs://localhost: 9000 + - --graph-mode or -m, the mode to set the target graph when restoring the source graph to the target graph, legal values include [RESTORING, MERGING] + - --keep-local-data, whether to keep the backup of the source map generated in the process of migrating the map, the default is false, that is, the backup of the source map is not kept after the default migration map ends +- schedule-backup, periodically back up the graph and keep a certain number of the latest backups (currently only supports local file systems) + - --directory or -d, required, specifies the directory of the backup data + - --backup-num, optional, specifies the number of latest backups to save, defaults to 3 + - --interval, an optional item, specifies the backup cycle, the format is the same as the Linux crontab format +- dump, export all the vertices and edges of the entire graph, and store them in `vertex vertex-edge1 vertex-edge2...`JSON format by default. + Users can also customize the storage format, just need to be in `hugegraph-tools/src/main/java/com/baidu/hugegraph/formatter` + Implement a class inherited from `Formatter` in the directory, such as `CustomFormatter`, and specify this class as formatter when using it, for example + `bin/hugegraph dump -f CustomFormatter` + - --formatter or -f, specify the formatter to use, the default is JsonFormatter + - --directory or -d, the directory where schema or data is stored, the default is the current directory + - --log or -l, specify the log directory, the default is the current directory + - --retry, specify the number of failed retries, the default is 3 + - --split-size or -s, specifies the size of splitting vertices or edges when backing up, the default is 1048576 + - -D, use the mode of -Dkey=value to specify dynamic parameters, and specify HDFS configuration items when backing up data to HDFS, for example: -Dfs.default.name=hdfs://localhost:9000 + +##### 3.7 Install the deployment type + +- deploy, one-click download, install and start HugeGraph-Server and HugeGraph-Studio + - -v, required, specifies the version number of HugeGraph-Server and HugeGraph-Studio installed, the latest is 0.9 + - -p, required, specifies the installed HugeGraph-Server and HugeGraph-Studio directories + - -u, optional, specifies the link to download the HugeGraph-Server and HugeGraph-Studio compressed packages +- clear, clean up HugeGraph-Server and HugeGraph-Studio directories and tarballs + - -p, required, specifies the directory of HugeGraph-Server and HugeGraph-Studio to be cleaned +- start-all, start HugeGraph-Server and HugeGraph-Studio with one click, and start monitoring, automatically pull up the service when the service dies + - -v, required, specifies the version number of HugeGraph-Server and HugeGraph-Studio to be started, the latest is 0.9 + - -p, required, specifies the directory where HugeGraph-Server and HugeGraph-Studio are installed +- stop-all, close HugeGraph-Server and HugeGraph-Studio with one click + +> There is an optional parameter -u in the deploy command. When provided, the specified download address will be used instead of the default download address to download the tar package, and the address will be written into the `~/hugegraph-download-url-prefix` file; if no address is specified later When -u and `~/hugegraph-download-url-prefix` are not specified, the tar package will be downloaded from the address specified by `~/hugegraph-download-url-prefix`; if there is neither -u nor `~/hugegraph-download-url-prefix`, it will be downloaded from the default download address + +##### 3.8 Specific command parameters + +The specific parameters of each subcommand are as follows: ```bash Usage: hugegraph [options] [command] [command options] @@ -517,19 +517,19 @@ Usage: hugegraph [options] [command] [command options] ``` -##### 3.9 具体命令示例 +##### 3.9 Specific command example -###### 1. gremlin语句 +###### 1. gremlin statement ```bash -# 同步执行gremlin +# Execute gremlin synchronously ./bin/hugegraph --url http://127.0.0.1:8080 --graph hugegraph gremlin-execute --script 'g.V().count()' -# 异步执行gremlin +# Execute gremlin asynchronously ./bin/hugegraph --url http://127.0.0.1:8080 --graph hugegraph gremlin-schedule --script 'g.V().count()' ``` -###### 2. 查看task情况 +###### 2. Show task status ```bash ./bin/hugegraph --url http://127.0.0.1:8080 --graph hugegraph task-list @@ -539,7 +539,7 @@ Usage: hugegraph [options] [command] [command options] ./bin/hugegraph --url http://127.0.0.1:8080 --graph hugegraph task-list --status success ``` -###### 3. 图模式查看和设置 +###### 3. Set and show graph mode ```bash ./bin/hugegraph --url http://127.0.0.1:8080 --graph hugegraph graph-mode-set -m RESTORING MERGING NONE @@ -551,38 +551,38 @@ Usage: hugegraph [options] [command] [command options] ./bin/hugegraph --url http://127.0.0.1:8080 --graph hugegraph graph-list ``` -###### 4. 清理图 +###### 4. Cleanup Graph ```bash ./bin/hugegraph --url http://127.0.0.1:8080 --graph hugegraph graph-clear -c "I'm sure to delete all data" ``` -###### 5. 图备份 +###### 5. Backup Graph ```bash ./bin/hugegraph --url http://127.0.0.1:8080 --graph hugegraph backup -t all --directory ./backup-test ``` -###### 6. 周期性的备份 +###### 6. Periodic Backup Graph ```bash ./bin/hugegraph --url http://127.0.0.1:8080 --graph hugegraph --interval */2 * * * * schedule-backup -d ./backup-0.10.2 ``` -###### 7. 图恢复 +###### 7. Recovery Graph ```bash -# 设置图模式 +# set graph mode ./bin/hugegraph --url http://127.0.0.1:8080 --graph hugegraph graph-mode-set -m RESTORING -# 恢复图 +# recovery graph ./bin/hugegraph --url http://127.0.0.1:8080 --graph hugegraph restore -t all --directory ./backup-test -# 恢复图模式 +# restore graph mode ./bin/hugegraph --url http://127.0.0.1:8080 --graph hugegraph graph-mode-set -m NONE ``` -###### 8. 图迁移 +###### 8. Graph Migration ```bash ./bin/hugegraph --url http://127.0.0.1:8080 --graph hugegraph migrate --target-url http://127.0.0.1:8090 --target-graph hugegraph