Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: check db status in the quick start documentation #1003

Merged
merged 4 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions docs/nightly/en/getting-started/quick-start/prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ services:
image: grafana/grafana-oss:<%grafana-version%>
container_name: grafana
ports:
- 3000:3000
- 127.0.0.1:3000:3000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is 127.0.0.1: necessary?

Copy link
Collaborator Author

@nicecui nicecui Jun 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If host IP is not set, it binds to all network interfaces(0.0.0.0), which is unsafe.
https://docs.docker.com/network/#published-ports
https://docs.docker.com/compose/compose-file/05-services/#ports


greptime:
image: greptime/greptimedb:<%greptimedb-version%>
container_name: greptimedb
ports:
- 4000:4000
- 4001:4001
- 4002:4002
- 4003:4003
- 127.0.0.1:4000:4000
- 127.0.0.1:4001:4001
- 127.0.0.1:4002:4002
- 127.0.0.1:4003:4003
command: "standalone start --http-addr 0.0.0.0:4000 --rpc-addr 0.0.0.0:4001 --mysql-addr 0.0.0.0:4002 --postgres-addr 0.0.0.0:4003"
volumes:
- ./greptimedb:/tmp/greptimedb
Expand All @@ -38,3 +38,23 @@ docker-compose up
:::tip NOTE
The following steps assume that you have followed the documentation above, which uses Docker Compose to install GreptimeDB and Grafana.
:::

Once you've successfully started GreptimeDB,
you can verify the database status using the following command:

```shell
curl http://127.0.0.1:4000/status
```

If the database is running, you will see an output like the following:

```json
{
"source_time": "2024-05-30T07:59:52Z",
"commit": "05751084e7bbfc5e646df7f51bb7c3e5cbf16d58",
"branch": "HEAD",
"rustc_version": "rustc 1.79.0-nightly (f9b161492 2024-04-19)",
"hostname": "977898bbda4f",
"version": "0.8.1"
}
```
14 changes: 7 additions & 7 deletions docs/nightly/en/getting-started/quick-start/prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ services:
image: grafana/grafana-oss:<%grafana-version%>
container_name: grafana
ports:
- 3000:3000
- 127.0.0.1:3000:3000

greptime:
image: greptime/greptimedb:<%greptimedb-version%>
container_name: greptimedb
ports:
- 4000:4000
- 4001:4001
- 4002:4002
- 4003:4003
- 127.0.0.1:4000:4000
- 127.0.0.1:4001:4001
- 127.0.0.1:4002:4002
- 127.0.0.1:4003:4003
command: "standalone start --http-addr 0.0.0.0:4000 --rpc-addr 0.0.0.0:4001 --mysql-addr 0.0.0.0:4002 --postgres-addr 0.0.0.0:4003"
volumes:
- ./greptimedb:/tmp/greptimedb
Expand All @@ -57,15 +57,15 @@ services:
depends_on:
- node_exporter
ports:
- 9090:9090
- 127.0.0.1:9090:9090
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro

node_exporter:
image: quay.io/prometheus/node-exporter:<%node-exporter-version%>
container_name: node_exporter_local
ports:
- 9100:9100
- 127.0.0.1:9100:9100
command:
- '--path.rootfs=/'

Expand Down
12 changes: 6 additions & 6 deletions docs/nightly/en/getting-started/quick-start/vector.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ services:
image: grafana/grafana-oss:<%grafana-version%>
container_name: grafana
ports:
- 3000:3000
- 127.0.0.1:3000:3000

greptime:
image: greptime/greptimedb:<%greptimedb-version%>
container_name: greptimedb
ports:
- 4000:4000
- 4001:4001
- 4002:4002
- 4003:4003
- 127.0.0.1:4000:4000
- 127.0.0.1:4001:4001
- 127.0.0.1:4002:4002
- 127.0.0.1:4003:4003
command: "standalone start --http-addr 0.0.0.0:4000 --rpc-addr 0.0.0.0:4001 --mysql-addr 0.0.0.0:4002 --postgres-addr 0.0.0.0:4003"
volumes:
- ./greptimedb:/tmp/greptimedb
Expand All @@ -51,7 +51,7 @@ services:
image: timberio/vector:<%vector-version%>
container_name: vector
ports:
- 8686:8686
- 127.0.0.1:8686:8686
volumes:
- ./vector.toml:/etc/vector/vector.toml:ro

Expand Down
29 changes: 24 additions & 5 deletions docs/nightly/zh/getting-started/quick-start/prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ services:
image: grafana/grafana-oss:<%grafana-version%>
container_name: grafana
ports:
- 3000:3000
- 127.0.0.1:3000:3000

greptime:
image: greptime/greptimedb:<%greptimedb-version%>
container_name: greptimedb
ports:
- 4000:4000
- 4001:4001
- 4002:4002
- 4003:4003
- 127.0.0.1:4000:4000
- 127.0.0.1:4001:4001
- 127.0.0.1:4002:4002
- 127.0.0.1:4003:4003
command: "standalone start --http-addr 0.0.0.0:4000 --rpc-addr 0.0.0.0:4001 --mysql-addr 0.0.0.0:4002 --postgres-addr 0.0.0.0:4003"
volumes:
- ./greptimedb:/tmp/greptimedb
Expand All @@ -38,3 +38,22 @@ docker-compose up
:::tip 注意
接下来的步骤假设你按照上面的文档安装了 GreptimeDB 和 Grafana。
:::

当你成功启动 GreptimeDB 之后,可以使用以下命令验证数据库状态:

```shell
curl http://127.0.0.1:4000/status
```

如果数据库正在运行,你将看到类似如下的输出:

```json
{
"source_time": "2024-05-30T07:59:52Z",
"commit": "05751084e7bbfc5e646df7f51bb7c3e5cbf16d58",
"branch": "HEAD",
"rustc_version": "rustc 1.79.0-nightly (f9b161492 2024-04-19)",
"hostname": "977898bbda4f",
"version": "0.8.1"
}
```
14 changes: 7 additions & 7 deletions docs/nightly/zh/getting-started/quick-start/prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ services:
image: grafana/grafana-oss:<%grafana-version%>
container_name: grafana
ports:
- 3000:3000
- 127.0.0.1:3000:3000

greptime:
image: greptime/greptimedb:<%greptimedb-version%>
container_name: greptimedb
ports:
- 4000:4000
- 4001:4001
- 4002:4002
- 4003:4003
- 127.0.0.1:4000:4000
- 127.0.0.1:4001:4001
- 127.0.0.1:4002:4002
- 127.0.0.1:4003:4003
command: "standalone start --http-addr 0.0.0.0:4000 --rpc-addr 0.0.0.0:4001 --mysql-addr 0.0.0.0:4002 --postgres-addr 0.0.0.0:4003"
volumes:
- ./greptimedb:/tmp/greptimedb
Expand All @@ -57,15 +57,15 @@ services:
depends_on:
- node_exporter
ports:
- 9090:9090
- 127.0.0.1:9090:9090
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro

node_exporter:
image: quay.io/prometheus/node-exporter:<%node-exporter-version%>
container_name: node_exporter_local
ports:
- 9100:9100
- 127.0.0.1:9100:9100
command:
- '--path.rootfs=/'

Expand Down
12 changes: 6 additions & 6 deletions docs/nightly/zh/getting-started/quick-start/vector.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ services:
image: grafana/grafana-oss:<%grafana-version%>
container_name: grafana
ports:
- 3000:3000
- 127.0.0.1:3000:3000

greptime:
image: greptime/greptimedb:<%greptimedb-version%>
container_name: greptimedb
ports:
- 4000:4000
- 4001:4001
- 4002:4002
- 4003:4003
- 127.0.0.1:4000:4000
- 127.0.0.1:4001:4001
- 127.0.0.1:4002:4002
- 127.0.0.1:4003:4003
command: "standalone start --http-addr 0.0.0.0:4000 --rpc-addr 0.0.0.0:4001 --mysql-addr 0.0.0.0:4002 --postgres-addr 0.0.0.0:4003"
volumes:
- ./greptimedb:/tmp/greptimedb
Expand All @@ -50,7 +50,7 @@ services:
image: timberio/vector:<%vector-version%>
container_name: vector
ports:
- 8686:8686
- 127.0.0.1:8686:8686
volumes:
- ./vector.toml:/etc/vector/vector.toml:ro

Expand Down