Skip to content

Commit

Permalink
refactor install page
Browse files Browse the repository at this point in the history
  • Loading branch information
UlricQin committed Jan 26, 2025
1 parent d891374 commit 99f5d89
Show file tree
Hide file tree
Showing 7 changed files with 200 additions and 6 deletions.
44 changes: 39 additions & 5 deletions content/en/docs/install/binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ toc: true

Download the latest release from [GitHub](https://github.com/ccfos/nightingale/releases), then you will get a tarball which name is like `n9e-{version}-linux-amd64.tar.gz`

## Install
## Install using sqlite and miniredis

This approach doesn't rely on MySQL and Redis. You can simply start it using the n9e binary. However, this method isn't suitable for production environments and is only intended for testing purposes.

```bash
#!/bin/bash
mkdir /opt/n9e && tar zxvf n9e-{version}-linux-amd64.tar.gz -C /opt/n9e

cd /opt/n9e

# init database
mysql -uroot -p1234 < n9e.sql

# check configurations in /opt/n9e/etc/config.toml and start n9e
nohup ./n9e &> n9e.log &
```
Expand All @@ -41,4 +40,39 @@ ss -tlnp|grep 17000

## Login

Open web browser and go to [http://localhost:17000](http://localhost:17000). The default username is `root` and default password is `root.2020`.
Open web browser and go to [http://localhost:17000](http://localhost:17000). The default username is `root` and default password is `root.2020`.

> Please replace localhost with your server's IP address.
## Install using MySQL and Redis

In production environments, we recommend using MySQL and Redis to store data. Modify the `/opt/n9e/etc/config.toml` configuration file to configure the connection information for MySQL and Redis.

DB section:

```toml
[DB]
DBType = "mysql"
DSN="YourUsername:YourPassword@tcp(127.0.0.1:3306)/n9e_v6?charset=utf8mb4&parseTime=True&loc=Local"
```

Redis section:

```toml
[Redis]
Address = "127.0.0.1:6379"
Password = "YourRedisPassword"
RedisType = "standalone"
```

Start the n9e binary, and Nightingale will automatically create the database tables. Of course, your DB connection account needs to have the permission to create database tables.

```bash
nohup ./n9e &> n9e.log &
```

Open web browser and go to [http://localhost:17000](http://localhost:17000). The default username is `root` and default password is `root.2020`.

> Please replace localhost with your server's IP address.
We recommend using `systemd` to manage the n9e process in production environments and set it to start automatically at boot time.
9 changes: 9 additions & 0 deletions content/zh/docs/install/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: "安装"
description: "安装夜莺监控,可以使用 docker compose 方式快速体验,或通过二进制方式安装,亦可以通过 helm 方式安装"
lead: ""
date: 2020-10-06T08:49:15+00:00
lastmod: 2025-01-26T10:11:40+08:00
draft: false
images: []
---
78 changes: 78 additions & 0 deletions content/zh/docs/install/binary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
title: "二进制部署"
description: "使用二进制方式部署夜莺监控项目"
lead: ""
date: 2020-11-12T13:26:54+01:00
lastmod: 2020-11-12T13:26:54+01:00
draft: false
images: []
menu:
docs:
parent: "install"
weight: 630
toc: true
---

## 下载

[GitHub](https://github.com/ccfos/nightingale/releases) 下载最新版本,然后你会得到一个类似 `n9e-{version}-linux-amd64.tar.gz` 的压缩包。

## 安装(使用 sqlite 和 miniredis)

这种方式不需要依赖 mysql 和 redis,使用 n9e 二进制直接启动即可。不过,这种方式不适合生产环境,仅用于测试。

```bash
#!/bin/bash
mkdir /opt/n9e && tar zxvf n9e-{version}-linux-amd64.tar.gz -C /opt/n9e

cd /opt/n9e

# check configurations in /opt/n9e/etc/config.toml and start n9e
nohup ./n9e &> n9e.log &
```

## 检查进程

```bash
# check process is runing or not
ss -tlnp|grep 17000
```

## 登录

打开浏览器访问 [http://localhost:17000](http://localhost:17000)。默认用户名是 `root`,默认密码是 `root.2020`

> 请把 localhost 替换成你的服务器 IP 地址。
## 安装(使用 MySQL 和 Redis)

生成环境中,我们建议使用 MySQL 和 Redis 来存储数据。修改 `/opt/n9e/etc/config.toml` 配置文件,配置 MySQL 和 Redis 的连接信息。

DB 部分:

```toml
[DB]
DBType = "mysql"
DSN="YourUsername:YourPassword@tcp(127.0.0.1:3306)/n9e_v6?charset=utf8mb4&parseTime=True&loc=Local"
```

Redis 部分:

```toml
[Redis]
Address = "127.0.0.1:6379"
Password = "YourRedisPassword"
RedisType = "standalone"
```

启动 n9e 二进制即可,夜莺会自动创建数据库表。当然,这需要你的 DB 连接账号具备创建数据库表的权限。

```bash
nohup ./n9e &> n9e.log &
```

打开浏览器访问 [http://localhost:17000](http://localhost:17000)。默认用户名是 `root`,默认密码是 `root.2020`

> 请把 localhost 替换成你的服务器 IP 地址。
生产环境,我们建议使用 `systemd` 来管理 n9e 进程,并设置 n9e 进程开机自启动。
44 changes: 44 additions & 0 deletions content/zh/docs/install/compose.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: "Docker Compose"
description: "使用 Docker Compose 方式部署夜莺监控项目"
lead: ""
date: 2020-11-12T13:26:54+01:00
lastmod: 2025-01-26T09:26:54+08:00
draft: false
images: []
menu:
docs:
parent: "install"
weight: 610
toc: true
---


```bash
$ git clone https://github.com/ccfos/nightingale.git
$ cd nightingale/docker/compose-bridge

$ docker-compose up -d
Creating network "docker_nightingale" with driver "bridge"
Creating mysql ... done
Creating redis ... done
Creating prometheus ... done
Creating ibex ... done
Creating agentd ... done
Creating nwebapi ... done
Creating nserver ... done
Creating telegraf ... done

$ docker-compose ps
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
categraf flashcatcloud/categraf:latest "/entrypoint.sh" categraf 2 days ago Up 2 days
ibex ulric2019/ibex:0.3 "sh -c '/wait && /ap…" ibex 2 days ago Up 2 days
mysql mysql:5.7 "docker-entrypoint.s…" mysql 2 days ago Up 2 days
n9e flashcatcloud/nightingale:latest "sh -c '/wait && /ap…" n9e 2 days ago Up 2 days
prometheus prom/prometheus "/bin/prometheus --c…" prometheus 2 days ago Up 2 days
redis redis:6.2 "docker-entrypoint.s…" redis 2 days ago Up 2 days
```

使用浏览器访问 [http://localhost:17000](http://localhost:17000) 打开夜莺监控的页面,默认用户名是 `root`,默认密码是 `root.2020`

> 请把 localhost 替换成你的服务器 IP 地址。
20 changes: 20 additions & 0 deletions content/zh/docs/install/helm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: "Helm"
description: "使用 Helm chart 安装夜莺"
lead: ""
date: 2020-11-12T13:26:54+01:00
lastmod: 2025-01-26T09:29:54+08:00
draft: false
images: []
menu:
docs:
parent: "install"
weight: 620
toc: true
---

你可以使用 [n9e helm chart](https://github.com/flashcatcloud/n9e-helm) 在 Kubernetes 集群中运行夜莺。

默认的夜莺用户名是 `root`,密码是 `root.2020`

不过,我们不建议您把夜莺部署到 Kubernetes 中,因为监控系统太过重要,如果 Kubernetes 集群出现问题,可能会导致监控系统无法正常工作。而此时您可能希望通过监控数据排查 Kubernetes 的问题,导致循环依赖。尤其是,其他团队此时想使用监控系统发现用不了,可能会来怼你。
9 changes: 9 additions & 0 deletions content/zh/docs/prologue/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title : "前言"
description: "夜莺项目介绍"
lead: ""
date: 2020-10-06T08:48:45+00:00
lastmod: 2025-01-26T10:36:54+08:00
draft: false
images: []
---
2 changes: 1 addition & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h2 class="h4">Professional alerting</h2>
</div>
<div class="col-lg-5">
<h2 class="h4">Open community</h2>
<p>Nightingale is hosted by the Open Source Development Committee of the China Computer Federation, has thousands of community users.</p>
<p>Nightingale is hosted by the Open Source Development Committee of the China Computer Federation. With the active participation of thousands of community users, it ensures the healthy and sustainable development of the Nightingale open-source community.</p>
</div>
</div>
</div>
Expand Down

0 comments on commit 99f5d89

Please sign in to comment.