Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
karencfv committed Nov 3, 2023
1 parent 43b1754 commit 17915d6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
16 changes: 5 additions & 11 deletions dev-tools/omicron-dev/src/bin/omicron-dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ async fn start_single_node(port: u16) -> Result<(), anyhow::Error> {
let mut db_instance =
dev::clickhouse::ClickHouseInstance::new_single_node(port).await?;
println!(
"\nomicron-dev: running ClickHouse with full command:\n\"clickhouse {}\"",
"omicron-dev: running ClickHouse with full command:\n\"clickhouse {}\"",
db_instance.cmdline().join(" ")
);
println!(
Expand Down Expand Up @@ -349,14 +349,14 @@ async fn start_replicated_cluster() -> Result<(), anyhow::Error> {
dev::clickhouse::ClickHouseCluster::new(replica_config, keeper_config)
.await?;
println!(
"\nomicron-dev: running ClickHouse cluster with configuration files:\n \
replicas: {}\n keepers: {}\n",
"omicron-dev: running ClickHouse cluster with configuration files:\n \
replicas: {}\n keepers: {}",
cluster.replica_config_path().display(),
cluster.keeper_config_path().display()
);
let pid_error_msg = "Failed to get process PID, it may not have started";
println!(
"omicron-dev: ClickHouse cluster is running with PIDs: {}, {}, {}, {}, {}\n",
"omicron-dev: ClickHouse cluster is running with PIDs: {}, {}, {}, {}, {}",
cluster.replica_1
.pid()
.expect(pid_error_msg),
Expand All @@ -374,16 +374,10 @@ async fn start_replicated_cluster() -> Result<(), anyhow::Error> {
.expect(pid_error_msg),
);
println!(
"omicron-dev: ClickHouse HTTP servers listening on ports: {}, {}\n",
"omicron-dev: ClickHouse HTTP servers listening on ports: {}, {}",
cluster.replica_1.port(),
cluster.replica_2.port()
);
println!(
"omicron-dev: ClickHouse keepers listening on ports: {}, {}, {}\n",
cluster.keeper_1.port(),
cluster.keeper_2.port(),
cluster.keeper_3.port()
);
println!(
"omicron-dev: using {} and {} for ClickHouse data storage",
cluster.replica_1.data_path().display(),
Expand Down
14 changes: 14 additions & 0 deletions docs/how-to-run-simulated.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,20 @@ $ cargo run --bin omicron-dev -- ch-run
omicron-dev: running ClickHouse (PID: 2463), full command is "clickhouse server --log-file /var/folders/67/2tlym22x1r3d2kwbh84j298w0000gn/T/.tmpJ5nhot/clickhouse-server.log --errorlog-file /var/folders/67/2tlym22x1r3d2kwbh84j298w0000gn/T/.tmpJ5nhot/clickhouse-server.errlog -- --http_port 8123 --path /var/folders/67/2tlym22x1r3d2kwbh84j298w0000gn/T/.tmpJ5nhot"
omicron-dev: using /var/folders/67/2tlym22x1r3d2kwbh84j298w0000gn/T/.tmpJ5nhot for ClickHouse data storage
----
+
If you wish to start a ClickHouse replicated cluster instead of a single node, run the following instead:
[source,text]
---
$ cargo run --bin omicron-dev -- ch-run --replicated
Finished dev [unoptimized + debuginfo] target(s) in 0.31s
Running `target/debug/omicron-dev ch-run --replicated`
omicron-dev: running ClickHouse cluster with configuration files:
replicas: /home/{user}/src/omicron/oximeter/db/src/configs/replica_config.xml
keepers: /home/{user}/src/omicron/oximeter/db/src/configs/keeper_config.xml
omicron-dev: ClickHouse cluster is running with PIDs: 1113482, 1113681, 1113387, 1113451, 1113419
omicron-dev: ClickHouse HTTP servers listening on ports: 8123, 8124
omicron-dev: using /tmp/.tmpFH6v8h and /tmp/.tmpkUjDji for ClickHouse data storage
---

. `nexus` requires a configuration file to run. You can use `nexus/examples/config.toml` to start with. Build and run it like this:
+
Expand Down

0 comments on commit 17915d6

Please sign in to comment.