From 71f256c5a353c421c2826a809afe7f46e1d6b925 Mon Sep 17 00:00:00 2001 From: mattisonchao Date: Tue, 1 Aug 2023 22:19:04 +0800 Subject: [PATCH 1/4] Add doc for bare metal deployment --- docs/bare-metal-deploy.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/bare-metal-deploy.md diff --git a/docs/bare-metal-deploy.md b/docs/bare-metal-deploy.md new file mode 100644 index 00000000..6f09e2d0 --- /dev/null +++ b/docs/bare-metal-deploy.md @@ -0,0 +1 @@ +# Deploying in the bare metal \ No newline at end of file From d59b191a2f1656af3098885c8b8c89c7eb57bec1 Mon Sep 17 00:00:00 2001 From: mattisonchao Date: Tue, 1 Aug 2023 22:21:31 +0800 Subject: [PATCH 2/4] Support doc --- docs/bare-metal-deploy.md | 134 +++++++++++++++++++++++++++++++++++++- go.mod | 1 - 2 files changed, 133 insertions(+), 2 deletions(-) diff --git a/docs/bare-metal-deploy.md b/docs/bare-metal-deploy.md index 6f09e2d0..9d79c7eb 100644 --- a/docs/bare-metal-deploy.md +++ b/docs/bare-metal-deploy.md @@ -1 +1,133 @@ -# Deploying in the bare metal \ No newline at end of file +# Deploying in the bare metal + +Suppose you don't have the Kubernetes environment or some container-based system. You can try to deploy Oxia with the bare metal environment. + +> The oxia coordinator only supports the file, k8s config map, and memory metadata. Therefore, We only suggest using it for testing or POC. + +## Download code from the GitHub + +You can check https://github.com/streamnative/oxia to download the source of StreamNative oxia. + +## Build from the source code + +Change the directory to the root directory of StreamNative oxia project. + +```shell +cd /oxia +``` + +Then run the command as follows to build the project by source code. + +```shell +make +``` + +After building, you'll see a bin directory at the project's root. + +```shell +oxia/ +├── bin/ +│ ├── oxia +└── ... +``` + +## Deploying oxia storage node + +We should deploy the oxia storage node first. We can start three storage nodes for primary usage. the command is as follows. + +```shell +# storage-node-0 +./bin/oxia server -i 0.0.0.0:6649 -p 0.0.0.0:6648 -m 0.0.0.0:8080 --wal-dir "" --data-dir "" +# storage-node-1 +./bin/oxia server -i 0.0.0.0:6661 -p 0.0.0.0:6660 -m 0.0.0.0:8081 --wal-dir "" --data-dir "" +# storage-node-2 +./bin/oxia server -i 0.0.0.0:6663 -p 0.0.0.0:6662 -m 0.0.0.0:8082 --wal-dir "" --data-dir "" +``` + +The command explanation is as follows: + +```shell +Usage: + oxia server [flags] + +Flags: + --data-dir string Directory where to store data (default "./data/db") + --db-cache-size-mb int Max size of the shared DB cache (default 100) + -h, --help help for server + -i, --internal-addr string Internal service bind address (default "0.0.0.0:6649") + -m, --metrics-addr string Metrics service bind address (default "0.0.0.0:8080") + -p, --public-addr string Public service bind address (default "0.0.0.0:6648") + --wal-dir string Directory for write-ahead-logs (default "./data/wal") + --wal-retention-time duration Retention time for the entries in the write-ahead-log (default 1h0m0s) + +Global Flags: + -j, --log-json Print logs in JSON format + -l, --log-level string Set logging level [disabled|trace|debug|info|warn|error|fatal|panic] (default "info") + --profile Enable pprof profiler + --profile-bind-address string Bind address for pprof (default "127.0.0.1:6060") +``` +## Deploying oxia coordinator + +Since the coordinator is brain-like in the oxia cluster, it should have some configurations to help it to make decisions. + +We can create it in the specific path you need. the configuration template is as follows. + +```yaml +namespaces: + - name: default + initialShardCount: 3 # This configuration indicates the number of shards for keys across the namespace. + replicationFactor: 3 # This configuration indicates the number of replicas for of key-shard. +servers: + # storage-node-0 + - public: 127.0.0.1:6648 + internal: 127.0.0.1:6649 + # storage-node-1 + - public: 127.0.0.1:6660 + internal: 127.0.0.1:6661 + # storage-node-2 + - public: 127.0.0.1:6662 + internal: 127.0.0.1:6663 +``` + +> If you need to know what the namespaces are. You can check the [architecture](https://github.com/streamnative/oxia/blob/main/docs/architecture.md) section to get more information. + +After configuration file creation, we can start the coordinator. The command is as follows. + +```shell +./bin/oxia coordinator --conf "" --file-clusters-status-path "" --metadata file -i 0.0.0.0:6664 -m 0.0.0.0:8083 +``` + +The command explanation is as follows: + +```shell +Usage: + oxia coordinator [flags] + +Flags: + -f, --conf string Cluster config file + --conf-file-refresh-time duration How frequently to check for updates for cluster configuration file (default 1m0s) + --file-clusters-status-path string The path where the cluster status is stored when using 'file' provider (default "data/cluster-status.json") + -h, --help help for coordinator + -i, --internal-addr string Internal service bind address (default "0.0.0.0:6649") + --k8s-configmap-name string ConfigMap name for metadata configmap + --k8s-namespace string Kubernetes namespace for metadata configmap + --metadata MetadataProviderImpl Metadata provider implementation: file, configmap or memory (default file) + -m, --metrics-addr string Metrics service bind address (default "0.0.0.0:8080") + +Global Flags: + -j, --log-json Print logs in JSON format + -l, --log-level string Set logging level [disabled|trace|debug|info|warn|error|fatal|panic] (default "info") + --profile Enable pprof profiler + --profile-bind-address string Bind address for pprof (default "127.0.0.1:6060") +``` + +## Go for testing + +After all of the components are up and running without an error log. We can use oxia-perf to test. the command is as follows. + +```shell +./bin/oxia perf --rate 10000 +``` + + +Well done, please enjoy your powerful oxia cluster. \ No newline at end of file diff --git a/go.mod b/go.mod index d3dea63d..e07ae5d7 100644 --- a/go.mod +++ b/go.mod @@ -99,7 +99,6 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pelletier/go-toml/v2 v2.0.7 // indirect - github.com/planetscale/vtprotobuf v0.4.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.4.0 // indirect github.com/prometheus/common v0.44.0 // indirect From 2fb8783451506343b27789a169ad2e52875097ea Mon Sep 17 00:00:00 2001 From: mattisonchao Date: Tue, 1 Aug 2023 22:23:44 +0800 Subject: [PATCH 3/4] Add to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a479aea3..40d46c92 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ large scale distributed systems. * [Getting started with Oxia](docs/getting-started.md) * [Go client API](docs/go-api.md) * [Deploy using Helm Chart](docs/ks8-deploy.md) +* [Deploy using bare metal](docs/bare-metal-deploy.md) * Developer docs * [Replication protocol](docs/replication-protocol.md) * [Coordinator](docs/replication-coordinator.md) From ce99f340b521c61ee8aca0204f0812d6fff04377 Mon Sep 17 00:00:00 2001 From: mattisonchao Date: Tue, 1 Aug 2023 22:33:57 +0800 Subject: [PATCH 4/4] Revert useless changes --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index e07ae5d7..d3dea63d 100644 --- a/go.mod +++ b/go.mod @@ -99,6 +99,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pelletier/go-toml/v2 v2.0.7 // indirect + github.com/planetscale/vtprotobuf v0.4.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.4.0 // indirect github.com/prometheus/common v0.44.0 // indirect