You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cli/README.md
+87-3Lines changed: 87 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,15 @@ This command-line tool provides a simple way to config an orion database server.
6
6
1. Run from `orion-sdk` root folder
7
7
2. Run `make binary` to create an executable file named bcdbadmin under `bin` directory.
8
8
9
+
9
10
## Commands
10
11
11
12
Here we list and describe the available commands.
12
13
We give a short explanation of their usage and describe the flags for each command.
13
14
We provide real-world examples demonstrating how to use the CLI tool for various tasks.
14
15
15
16
17
+
16
18
### Version Command
17
19
This command prints the version of the CLI tool.
18
20
1. Run from `orion-sdk` root folder.
@@ -23,6 +25,8 @@ This command prints the version of the CLI tool.
23
25
### Config Command
24
26
This command enables to config an orion server or ask for the configuration of an orion server.
25
27
28
+
###
29
+
<aid="get_config_command"></a>
26
30
#### Get Config Command
27
31
1. Run from 'orion-sdk' root folder.
28
32
2. For Get Config Run `bin/bcdbadmin config get [args]`.
@@ -45,11 +49,65 @@ Running
45
49
`bin/bcdbadmin config get -d "connection-session-config.yaml" -c "local/config"`
46
50
reads the connection and session details needed for connecting to a server from `connection-session-config.yaml` and
47
51
sends a config TX.
48
-
It creates directories in `local/config` with the respective certificates, a yaml file, named shared_cluster_config.yml, that includes the cluster configuration
49
-
and a yaml file, named version.yml, that includes the version.
52
+
It creates directories in `local/config` with the respective certificates, a yaml file, named `shared_cluster_config.yml`, that includes the cluster configuration
53
+
and a yaml file, named `version.yml`, that includes the version.
54
+
55
+
56
+
###
57
+
<aid="get_last_config_block_command"></a>
58
+
#### Get Last Config Block Command
59
+
1. Run from 'orion-sdk' root folder.
60
+
2. For Get last config block Run `bin/bcdbadmin config getLastConfigBlock [args]`.
reads the connection and session details needed for connecting to a server from `connection-session-config.yaml` and
105
+
sends a config TX.
106
+
It prints the output (the cluster status) to the screen.
107
+
108
+
109
+
###
110
+
<aid="set_config_command"></a>
53
111
#### Set Config Command
54
112
1. Run from 'orion-sdk' root folder.
55
113
2. For Set Config Run:
@@ -77,4 +135,30 @@ Running
77
135
`bin/bcdbadmin config set -d "connection-session-config.yaml" -c "local/new_cluster_config.yml"`
78
136
reads the connection and session details needed for connecting to a server from `connection-session-config.yaml` and
79
137
sends a config TX.
80
-
It reads the `local/new_cluster_config.yml` to fetch the new cluster configuration and set it.
138
+
It reads the `local/new_cluster_config.yml` to fetch the new cluster configuration and set it.
139
+
140
+
141
+
###
142
+
#### Using the set config command to manage the cluster configuration
143
+
In addition to reconfiguring parameters, the above commands can be used to add or remove a node.
144
+
145
+
The following steps describe how to add a node to the cluster:
146
+
1. Run from 'orion-sdk' root folder.
147
+
2. Run `bin/bcdbadmin config get [args]` to get the cluster configuration. Replace `[args]` with corresponding flags as detailed above, see [Get Config Command](#get_config_command).
148
+
3. Create a new shared configuration file, named `new_cluster_config.yml`, and add the 4th node to the configuration. Make sure to add the node to both the Members list and the Nodes list.
149
+
150
+
Note: it is possible to create a new file or to edit the `shared_cluster_config.yml` obtained in the previous step.
151
+
4. Run `bin/bcdbadmin config set [args]` to set the new configuration. Replace `[args]` with corresponding flags as detailed above, see [Set Config Command](#set_config_command).
152
+
153
+
After this step the cluster configuration should contain 4 nodes.
154
+
5. Run `bin/bcdbadmin config getLastConfigBlock [args]` to get the last config block. Replace `[args]` with corresponding flags as detailed above, see [Get Last Config Block Command](#get_last_config_block_command).
155
+
6. Edit the `config.yml` file of 4th node and change the boostrap method and file:
156
+
```yaml
157
+
- bootstrap:
158
+
method: join
159
+
file: [the path for last_config_block.yml file]
160
+
```
161
+
8. Start the 4th node.
162
+
9. Run `bin/bcdbadmin config getClusterStatus [args]` to get the cluster status. Replace `[args]` with corresponding flags as detailed above, see [Get Cluster Status Command](#get_cluster_status_command).
163
+
164
+
Make sure there are 4 nodes in the resulting configuration.
getLastConfigBlockCmd.PersistentFlags().StringP("last-config-block-path", "c", "", "set the absolute or relative path of the last configuration block file")
0 commit comments