blob: 95920f720c02debc9aee341030730ef16e680e78 [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="/assets/css/app.css">
<link rel="shortcut icon" href="/assets/images/favicon.ico">
<link rel="stylesheet" href="/assets/css/utilities.min.css">
<link rel="stylesheet" href="/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="Understanding the Onebox Cluster Actions speak louder than words." />
<meta property="og:description" content="Understanding the Onebox Cluster Actions speak louder than words." />
<meta property="og:site_name" content="Pegasus" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2024-04-22T06:39: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-22T06:39:52+00:00","datePublished":"2024-04-22T06:39:52+00:00","description":"Understanding the Onebox Cluster Actions speak louder than words.","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="/" class="navbar-item ">
<!-- Pegasus Icon -->
<img src="/assets/images/pegasus.svg">
</a>
<div class="navbar-item">
<a href="/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.-->
<a class="button is-primary is-outlined is-inverted" href="/zh/overview/onebox/"><strong></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="/community"
class="navbar-link ">
<span class="icon" style="margin-right: .25em">
<i class="fas fa-user-plus"></i>
</span>
<span>
Community
</span>
</a>
<div class="navbar-dropdown">
<a href="/community/#contact-us"
class="navbar-item ">
Contact Us
</a>
<a href="/community/#contribution"
class="navbar-item ">
Contribution
</a>
<a href="https://cwiki.apache.org/confluence/display/PEGASUS/Coding+guides"
class="navbar-item ">
Coding Guides
</a>
<a href="https://github.com/apache/incubator-pegasus/issues?q=is%3Aissue+is%3Aopen+label%3Atype%2Fbug"
class="navbar-item ">
Bug Tracking
</a>
<a href="https://cwiki.apache.org/confluence/display/INCUBATOR/PegasusProposal"
class="navbar-item ">
Apache Proposal
</a>
</div>
</div>
<a href="/blogs"
class="navbar-item ">
<span class="icon" style="margin-right: .25em">
<i class="fas fa-rss"></i>
</span>
<span>Blog</span>
</a>
<a href="/docs/downloads"
class="navbar-item ">
<span class="icon" style="margin-right: .25em">
<i class="fas fa-fire"></i>
</span>
<span>Releases</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.-->
<a class="button is-primary is-outlined is-inverted" href="/zh/overview/onebox/"><strong></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="/overview"
class="">
Overview
</a>
</li>
<li>
<a href="/overview/background"
class="">
Background
</a>
</li>
<li>
<a href="/overview/architecture"
class="">
Architecture
</a>
</li>
<li>
<a href="/overview/data-model"
class="">
Data Model
</a>
</li>
<li>
<a href="/overview/benchmark"
class="">
Benchmark
</a>
</li>
<li>
<a href="/docs/build/compile-by-docker"
class="">
Installation
</a>
</li>
<li>
<a href="/overview/onebox"
class="">
Onebox
</a>
</li>
</ul>
</aside>
</div>
<div class="column is-half">
<div class="content">
<h1 id="Onebox">Onebox</h1>
<h1 id="understanding-the-onebox-cluster">Understanding the Onebox Cluster</h1>
<p>Actions speak louder than words.</p>
<p>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.</p>
<p>Here’s what the onebox cluster does when it starts up:</p>
<ul>
<li>Initiates Zookeeper: Automatically downloads the Zookeeper installation package from a remote source, installs it in the local hidden folder <code class="language-plaintext highlighter-rouge">.zk_install</code>, and then launches the local Zookeeper service on port 22181.</li>
<li>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.</li>
<li>After the cluster starts, it automatically creates a temporary table.</li>
</ul>
<p>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.</p>
<h1 id="how-to-experience-it">How to Experience It</h1>
<p>Before launching the onebox cluster, you need to compile Pegasus. Please refer to <a href="/docs/build/compile-from-source/">Compile and Build</a>.</p>
<p>To start the onebox cluster:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./run.sh start_onebox
</code></pre></div></div>
<p>To view the onebox cluster:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./run.sh list_onebox
</code></pre></div></div>
<p>If you see 3 MetaServer and 3 ReplicaServer processes, congratulations, you’ve successfully launched it. Otherwise, check the logs and core files in the <code class="language-plaintext highlighter-rouge">./onebox</code>
folder and report any errors to us via a pull request. For example, if the replica1 process is missing, find the core file in <code class="language-plaintext highlighter-rouge">onebox/replica1</code> (assuming ulimit allows core file generation), the log files in <code class="language-plaintext highlighter-rouge">onebox/replica1/data/log</code> and the standard error output in <code class="language-plaintext highlighter-rouge">onebox/replica1/result</code>.</p>
<p>To stop the onebox cluster:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./run.sh stop_onebox
</code></pre></div></div>
<p>After stopping, you can restart the cluster using the start_onebox command.</p>
<p>To clean the onebox cluster (<strong>All the data will be clean up as well!</strong>):</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./run.sh clear_onebox
</code></pre></div></div>
<p>To stop/start/restart any individual process:</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>To manage and view the cluster with the shell tool:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./run.sh shell
</code></pre></div></div>
<p>For detailed usage of the shell tool, please refer to <a href="shell">Shell Tools</a>.</p>
<p>To perform read/write tests with the bench tool:</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>
Table of contents
</p>
<ul class="menu-list">
<li><a href="#Onebox">Onebox</a></li>
<li><a href="#understanding-the-onebox-cluster">Understanding the Onebox Cluster</a></li>
<li><a href="#how-to-experience-it">How to Experience It</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>