blob: 7d8f9ad5d26cfa6a4b7f1f657d4c876f47ca4259 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Pegasus | Onebox</title>
<link rel="stylesheet" href="/zh/assets/css/app.css">
<link rel="shortcut icon" href="/zh/assets/images/favicon.ico">
<link rel="stylesheet" href="/zh/assets/css/utilities.min.css">
<link rel="stylesheet" href="/zh/assets/css/docsearch.v3.css">
<script src="/assets/js/jquery.min.js"></script>
<script src="/assets/js/all.min.js"></script>
<script src="/assets/js/docsearch.v3.js"></script>
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>Onebox | Pegasus</title>
<meta name="generator" content="Jekyll v4.3.3" />
<meta property="og:title" content="Onebox" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="什么是 onebox 集群" />
<meta property="og:description" content="什么是 onebox 集群" />
<meta property="og:site_name" content="Pegasus" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2024-04-22T13:02:52+00:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="Onebox" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","dateModified":"2024-04-22T13:02:52+00:00","datePublished":"2024-04-22T13:02:52+00:00","description":"什么是 onebox 集群","headline":"Onebox","mainEntityOfPage":{"@type":"WebPage","@id":"/overview/onebox/"},"url":"/overview/onebox/"}</script>
<!-- End Jekyll SEO tag -->
</head>
<body>
<nav class="navbar is-primary">
<div class="container">
<!--container will be unwrapped when it's in docs-->
<div class="navbar-brand">
<a href="/zh/" class="navbar-item ">
<!-- Pegasus Icon -->
<img src="/assets/images/pegasus.svg">
</a>
<div class="navbar-item">
<a href="/zh/docs" class="button is-primary is-outlined is-inverted">
<span class="icon"><i class="fas fa-book"></i></span>
<span>Docs</span>
</a>
</div>
<div class="navbar-item is-hidden-desktop">
<!--A simple language switch button that only supports zh and en.-->
<!--IF its language is zh, then switches to en.-->
<!--If you don't want a url to be relativized, you can add a space explicitly into the href to
prevents a url from being relativized by polyglot.-->
<a class="button is-primary is-outlined is-inverted" href=" /overview/onebox/"><strong>En</strong></a>
</div>
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false" data-target="navMenu">
<!-- Appears in mobile mode only -->
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
<div class="navbar-menu" id="navMenu">
<div class="navbar-end">
<!--dropdown-->
<div class="navbar-item has-dropdown is-hoverable ">
<a href=""
class="navbar-link ">
<span class="icon" style="margin-right: .25em">
<i class="fas fa-users"></i>
</span>
<span>
ASF
</span>
</a>
<div class="navbar-dropdown">
<a href="https://www.apache.org/"
class="navbar-item ">
Foundation
</a>
<a href="https://www.apache.org/licenses/"
class="navbar-item ">
License
</a>
<a href="https://www.apache.org/events/current-event.html"
class="navbar-item ">
Events
</a>
<a href="https://www.apache.org/foundation/sponsorship.html"
class="navbar-item ">
Sponsorship
</a>
<a href="https://www.apache.org/security/"
class="navbar-item ">
Security
</a>
<a href="https://privacy.apache.org/policies/privacy-policy-public.html"
class="navbar-item ">
Privacy
</a>
<a href="https://www.apache.org/foundation/thanks.html"
class="navbar-item ">
Thanks
</a>
</div>
</div>
<!--dropdown-->
<div class="navbar-item has-dropdown is-hoverable ">
<a href="/zh/community"
class="navbar-link ">
<span class="icon" style="margin-right: .25em">
<i class="fas fa-user-plus"></i>
</span>
<span>
开源社区
</span>
</a>
<div class="navbar-dropdown">
<a href="/zh/community/#contact-us"
class="navbar-item ">
联系我们
</a>
<a href="/zh/community/#contribution"
class="navbar-item ">
参与贡献
</a>
<a href="https://cwiki.apache.org/confluence/display/PEGASUS/Coding+guides"
class="navbar-item ">
编码指引
</a>
<a href="https://github.com/apache/incubator-pegasus/issues?q=is%3Aissue+is%3Aopen+label%3Atype%2Fbug"
class="navbar-item ">
Bug 追踪
</a>
<a href="https://cwiki.apache.org/confluence/display/INCUBATOR/PegasusProposal"
class="navbar-item ">
Apache 提案
</a>
</div>
</div>
<a href="/zh/blogs"
class="navbar-item ">
<span class="icon" style="margin-right: .25em">
<i class="fas fa-rss"></i>
</span>
<span>Blog</span>
</a>
<a href="/zh/docs/downloads"
class="navbar-item ">
<span class="icon" style="margin-right: .25em">
<i class="fas fa-fire"></i>
</span>
<span>版本发布</span>
</a>
</div>
<div class="navbar-item is-hidden-mobile">
<!--A simple language switch button that only supports zh and en.-->
<!--IF its language is zh, then switches to en.-->
<!--If you don't want a url to be relativized, you can add a space explicitly into the href to
prevents a url from being relativized by polyglot.-->
<a class="button is-primary is-outlined is-inverted" href=" /overview/onebox/"><strong>En</strong></a>
</div>
</div>
</div>
</nav>
<section class="section">
<div class="container">
<div class="columns is-multiline">
<div class="column is-one-fourth">
<aside class="menu">
<p class="menu-label"></p>
<ul class="menu-list">
<li>
<a href="/zh/overview"
class="">
概览
</a>
</li>
<li>
<a href="/zh/overview/background"
class="">
项目背景
</a>
</li>
<li>
<a href="/zh/overview/architecture"
class="">
系统架构
</a>
</li>
<li>
<a href="/zh/overview/data-model"
class="">
数据模型
</a>
</li>
<li>
<a href="/zh/overview/benchmark"
class="">
性能测试
</a>
</li>
<li>
<a href="/zh/docs/build/compile-by-docker"
class="">
安装构建
</a>
</li>
<li>
<a href="/zh/overview/onebox"
class="">
体验 Onebox 集群
</a>
</li>
</ul>
</aside>
</div>
<div class="column is-half">
<div class="content">
<h1 id="体验 Onebox 集群">体验 Onebox 集群</h1>
<h1 id="什么是-onebox-集群">什么是 onebox 集群</h1>
<p>千言万语不如一个行动。</p>
<p>初次接触 Pegasus, 你肯定最想了解这个集群运行起来是什么样子的。但是这是一个分布式系统, 然而你手上未必有那么多机器。因此我们提供了 onebox 集群, 让你在一台机器上就能体验 Pegasus 的集群式服务。</p>
<p>onebox 集群在启动时实际上做了这些事情:</p>
<ul>
<li>启动 Zookeeper: 自动从远程下载 zookeeper安装包, 安装在本地的隐藏文件夹<code class="language-plaintext highlighter-rouge">.zk_install</code>下, 然后启动本地 Zookeeper 服务,端口为 22181。</li>
<li>启动 3 个 MetaServer 和 3 个 ReplicaServer:MetaServer 的端口分别为 34601,34602,34603;ReplicaServer 的端口分别为 34801,34802,34803。</li>
<li>集群启动后会默认创建一个 temp 表。</li>
</ul>
<p>你可以用 onebox 集群感受下 Pegasus 如何工作的, 用 shell 工具读写数据,用 bench 工具跑跑测试 ( 当然别指望 onebox 的性能有多好 ), 也可以通过看日志来了解实现上的一些细节, 或者在集群上折腾各种实验。</p>
<h1 id="如何体验">如何体验</h1>
<p>在启动 onebox 集群之前,你需要先编译 Pegasus, 请参考<a href="/zh/docs/build/compile-from-source/">编译构建</a></p>
<p>启动 onebox 集群:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./run.sh start_onebox
</code></pre></div></div>
<p>查看 onebox 集群:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./run.sh list_onebox
</code></pre></div></div>
<p>如果你能看到 3 个 MetaServer 和 3 个 ReplicaServer 进程, 那么恭喜你, 启动成功了。否则就到<code class="language-plaintext highlighter-rouge">./onebox</code>文件夹下查看<code class="language-plaintext highlighter-rouge">result</code>文件(标准错误输出)、日志、core文件等, 然后给我们发 pull request 报告错误吧。譬如 replica1 进程不在了,那么就到<code class="language-plaintext highlighter-rouge">onebox/replica1</code>下面找 core 文件 (前提是 ulimit 配置为允许产生 core 文件), 到<code class="language-plaintext highlighter-rouge">onebox/replica1/data/log</code>下面找日志文件, 在<code class="language-plaintext highlighter-rouge">onebox/replica1/result</code>查看标准错误输出。</p>
<p>停止 onebox 集群:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./run.sh stop_onebox
</code></pre></div></div>
<p>停止之后你还可以使用 start_onebox 命令重启集群。</p>
<p>清理 onebox 集群 (<strong>数据也会被清理</strong>):</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./run.sh clear_onebox
</code></pre></div></div>
<p>停止/启动/重启其中的某一个进程:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./run.sh start_onebox_instance <span class="nt">-h</span>
./run.sh stop_onebox_instance <span class="nt">-h</span>
./run.sh restart_onebox_instance <span class="nt">-h</span>
</code></pre></div></div>
<p>用 shell 工具来查看和管理集群:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./run.sh shell
</code></pre></div></div>
<p>关于 shell 工具的详细用法, 请参考<a href="shell">Shell工具</a></p>
<p>用 bench 工具进行读写测试:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./run.sh bench
</code></pre></div></div>
</div>
</div>
<div class="column is-one-fourth is-hidden-mobile" style="padding-left: 3rem">
<p class="menu-label">
<span class="icon">
<i class="fa fa-bars" aria-hidden="true"></i>
</span>
本页导航
</p>
<ul class="menu-list">
<li><a href="#体验 Onebox 集群">体验 Onebox 集群</a></li>
<li><a href="#什么是-onebox-集群">什么是 onebox 集群</a></li>
<li><a href="#如何体验">如何体验</a></li>
</ul>
</div>
</div>
</div>
</section>
<footer class="footer">
<div class="container">
<div class="content is-small has-text-centered">
<div style="margin-bottom: 20px;">
<a href="http://incubator.apache.org">
<img src="/assets/images/egg-logo.png"
width="15%"
alt="Apache Incubator"/>
</a>
</div>
Copyright &copy; 2023 <a href="http://www.apache.org">The Apache Software Foundation</a>.
Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version
2.0</a>.
<br><br>
Apache Pegasus is an effort undergoing incubation at The Apache Software Foundation (ASF),
sponsored by the Apache Incubator. Incubation is required of all newly accepted projects
until a further review indicates that the infrastructure, communications, and decision making process
have stabilized in a manner consistent with other successful ASF projects. While incubation status is
not necessarily a reflection of the completeness or stability of the code, it does indicate that the
project has yet to be fully endorsed by the ASF.
<br><br>
Apache Pegasus, Pegasus, Apache, the Apache feather logo, and the Apache Pegasus project logo are either
registered trademarks or trademarks of The Apache Software Foundation in the United States and other
countries.
</div>
</div>
</footer>
<script src="/assets/js/app.js" type="text/javascript"></script>
</body>
</html>