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
The binary and configuration file will be installed under `~/.snctl-cpp`, so you have to add it to your `PATH`:
21
+
22
+
```bash
23
+
export PATH=$HOME/.snctl-cpp:$PATH
24
+
```
25
+
26
+
Now, you can run `snctl-cpp -h` to see the help message.
27
+
28
+
### Build from source
6
29
7
30
You must have a C++ compiler that supports C++17.
8
31
9
32
```bash
10
33
git submodule update --init --recursive
11
34
cmake -B build
12
35
cmake --build build
36
+
cp build/snctl-cpp .
13
37
```
14
38
15
-
Then you can find the executable in `build/snctl-cpp`.
39
+
You can run `./install.sh` to override the existing installation in `~/.snctl-cpp` directory, but you can also just run `./snctl-cpp` directly without installing it. The `sncloud.ini` file in the current working directory has higher priority than the one in `~/.snctl-cpp` directory.
16
40
17
-
## How to use
41
+
## How to manage topics in the cluster that enables Kafka protocol
18
42
19
43
**Please make sure the `sncloud.ini` file is in the current working directory or `~/.snctl-cpp` directory if you don't specify the `--config` option.**
20
44
21
45
You only need to fill the following fields in `sncloud.ini`:
22
46
-`bootstrap.servers`: the URL of the Kafka service, e.g. `pc-xxx:9093` on StreamNative cloud.
23
47
- (optional) `token`: the token generated by the API key. It's allowed to be empty for quickly testing against a local Kafka cluster without any authentication.
24
48
25
-
Run `./build/snctl-cpp -h` to see the help message.
26
-
27
49
Options:
28
50
- Add the `--config <config-file>` option to specify a different path of the INI config file.
29
51
- Add a `--client-id` option to specify the client id of the underlying Kafka client. In Ursa, the client id carries the zone information, see [here](https://docs.streamnative.io/docs/config-kafka-client#eliminate-cross-az-networking-traffic).
30
52
31
53
### Create a topic
32
54
33
55
```bash
34
-
$ ./build/snctl-cpp create tp0
56
+
$ snctl-cpp create tp0
35
57
Created topic "tp0" with 1 partition
36
-
$ ./build/snctl-cpp create tp1 -p 5
58
+
$ snctl-cpp create tp1 -p 5
37
59
Created topic "tp1" with 5 partitions
38
60
```
39
61
40
62
### Delete a topic
41
63
42
64
```bash
43
-
$ ./build/snctl-cpp delete tp
65
+
$ snctl-cpp delete tp
44
66
Failed to delete topic "tp": Broker: Unknown topic or partition
0 commit comments