Skip to content

Commit

Permalink
Update onebox docs (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samunroyu authored Dec 29, 2023
1 parent bbd28bc commit 03e8162
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 18 deletions.
60 changes: 59 additions & 1 deletion _overview/en/onebox.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,62 @@
permalink: /overview/onebox/
---

TRANSLATING
# Understanding the Onebox Cluster
Actions speak louder than words.

When you first delve into Pegasus, you're probably most eager to understand how its cluster functions in action. But as it's a distributed system, you may not have an abundance of machines at your disposal. Hence, we provide the onebox cluster, enabling you to experience the cluster-style service of Pegasus on a single machine.

Here's what the onebox cluster does when it starts up:

- Initiates Zookeeper: Automatically downloads the Zookeeper installation package from a remote source, installs it in the local hidden folder `.zk_install`, and then launches the local Zookeeper service on port 22181.
- Launches 3 MetaServers and 3 ReplicaServers: The ports for the MetaServers are 34601, 34602, and 34603; for the ReplicaServers, they are 34801, 34802, and 34803.
- After the cluster starts, it automatically creates a temporary table.

With the onebox cluster, you can explore how Pegasus operates. You can use the shell tool for reading and writing data, run tests with the bench tool (though don't expect stellar performance from onebox), delve into implementation details through logs, or conduct various experiments on the cluster.

# How to Experience It
Before launching the onebox cluster, you need to compile Pegasus. Please refer to [Compile and Build](/docs/build/compile-from-source/).

To start the onebox cluster:
```bash
./run.sh start_onebox
```

To view the onebox cluster:
```bash
./run.sh list_onebox
```

If you see 3 MetaServer and 3 ReplicaServer processes, congratulations, you've successfully launched it. Otherwise, check the logs and core files in the `./onebox`
folder and report any errors to us via a pull request. For example, if the replica1 process is missing, find the core file in `onebox/replica1` (assuming ulimit allows core file generation), the log files in `onebox/replica1/data/log` and the standard error output in `onebox/replica1/result`.

To stop the onebox cluster:
```bash
./run.sh stop_onebox
```

After stopping, you can restart the cluster using the start_onebox command.

To clean the onebox cluster (**All the data will be clean up as well!**):
```bash
./run.sh clear_onebox
```

To stop/start/restart any individual process:
```bash
./run.sh start_onebox_instance -h
./run.sh stop_onebox_instance -h
./run.sh restart_onebox_instance -h
```

To manage and view the cluster with the shell tool:
```bash
./run.sh shell
```

For detailed usage of the shell tool, please refer to [Shell Tools](shell).

To perform read/write tests with the bench tool:
```bash
./run.sh bench
```
35 changes: 18 additions & 17 deletions _overview/zh/onebox.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,41 @@
permalink: /overview/onebox/
---

# 什么是onebox集群
# 什么是 onebox 集群

千言万语不如一个行动。

初次接触Pegasus,你肯定最想了解这个集群运行起来是什么样子的。但是这是一个分布式系统然而你手上未必有那么多机器。因此我们提供了onebox集群,让你在一台机器上就能体验Pegasus的集群式服务
初次接触 Pegasus, 你肯定最想了解这个集群运行起来是什么样子的。但是这是一个分布式系统, 然而你手上未必有那么多机器。因此我们提供了 onebox 集群, 让你在一台机器上就能体验 Pegasus 的集群式服务

onebox集群在启动时实际上做了这些事情:
* 启动Zookeeper:自动从远程下载zookeeper安装包,安装在本地的隐藏文件夹```.zk_install```,然后启动本地Zookeeper服务,端口为22181
* 启动3个MetaServer和3个ReplicaServer:MetaServer的端口分别为34601,34602,34603;ReplicaServer的端口分别为34801,34802,34803。
* 集群启动后会默认创建一个temp表
onebox 集群在启动时实际上做了这些事情:
- 启动 Zookeeper: 自动从远程下载 zookeeper安装包, 安装在本地的隐藏文件夹```.zk_install```, 然后启动本地 Zookeeper 服务,端口为 22181
- 启动 3 个 MetaServer 和 3 个 ReplicaServer:MetaServer 的端口分别为 34601,34602,34603;ReplicaServer 的端口分别为 34801,34802,34803。
- 集群启动后会默认创建一个 temp 表

你可以用onebox集群感受下Pegasus如何工作的,用shell工具读写数据,用bench工具跑跑测试(当然别指望onebox的性能有多好),也可以通过看日志来了解实现上的一些细节或者在集群上折腾各种实验。
你可以用 onebox 集群感受下 Pegasus 如何工作的, 用 shell 工具读写数据,用 bench 工具跑跑测试 ( 当然别指望 onebox 的性能有多好 ), 也可以通过看日志来了解实现上的一些细节, 或者在集群上折腾各种实验。

# 如何体验

在启动onebox集群之前,你需要先编译Pegasus,请参考[编译构建](/docs/build/compile-from-source/)
在启动 onebox 集群之前,你需要先编译 Pegasus, 请参考[编译构建](/docs/build/compile-from-source/)

启动onebox集群:
启动 onebox 集群:
```bash
./run.sh start_onebox
```

查看onebox集群:
查看 onebox 集群:
```bash
./run.sh list_onebox
```
如果你能看到3个MetaServer和3个ReplicaServer进程,那么恭喜你启动成功了。否则就到```./onebox```文件夹下查看日志和core文件,然后给我们发pull request报告错误吧。譬如replica1进程不在了,那么就到```onebox/replica1```下面找core文件(前提是ulimit配置为允许产生core文件),到```onebox/replica1/data/log```下面找日志文件
如果你能看到 3 个 MetaServer 和 3 个 ReplicaServer 进程, 那么恭喜你, 启动成功了。否则就到`./onebox`文件夹下查看`result`文件(标准错误输出)、日志、core文件等, 然后给我们发 pull request 报告错误吧。譬如 replica1 进程不在了,那么就到`onebox/replica1`下面找 core 文件 (前提是 ulimit 配置为允许产生 core 文件), 到`onebox/replica1/data/log`下面找日志文件, 在`onebox/replica1/result`查看标准错误输出

停止onebox集群:
停止 onebox 集群:
```bash
./run.sh stop_onebox
```
停止之后你还可以使用start_onebox命令重启集群
停止之后你还可以使用 start_onebox 命令重启集群

清理onebox集群(包括数据):
清理 onebox 集群 (**数据也会被清理**):
```bash
./run.sh clear_onebox
```
Expand All @@ -48,13 +48,14 @@ onebox集群在启动时实际上做了这些事情:
./run.sh restart_onebox_instance -h
```

用shell工具来查看和管理集群:
用 shell 工具来查看和管理集群:
```bash
./run.sh shell
```
关于shell工具的详细用法,请参考[Shell工具](shell)

用bench工具进行读写测试:
关于 shell 工具的详细用法, 请参考[Shell工具](shell)

用 bench 工具进行读写测试:
```bash
./run.sh bench
```

0 comments on commit 03e8162

Please sign in to comment.