blob: 860249ae57a1736d4f2a210f8388246dec640640 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Apache Druid">
<meta name="keywords" content="druid,kafka,database,analytics,streaming,real-time,real time,apache,open source">
<meta name="author" content="Apache Software Foundation">
<title>Druid | Setting up a Clustered Deployment</title>
<link rel="alternate" type="application/atom+xml" href="/feed">
<link rel="shortcut icon" href="/img/favicon.png">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
<link href='//fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700,300italic|Open+Sans:300italic,400italic,600italic,400,300,600,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/css/bootstrap-pure.css?v=1.1">
<link rel="stylesheet" href="/css/base.css?v=1.1">
<link rel="stylesheet" href="/css/header.css?v=1.1">
<link rel="stylesheet" href="/css/footer.css?v=1.1">
<link rel="stylesheet" href="/css/syntax.css?v=1.1">
<link rel="stylesheet" href="/css/docs.css?v=1.1">
<script>
(function() {
var cx = '000162378814775985090:molvbm0vggm';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
</head>
<body>
<!-- Start page_header include -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<div class="top-navigator">
<div class="container">
<div class="left-cont">
<a class="logo" href="/"><span class="druid-logo"></span></a>
</div>
<div class="right-cont">
<ul class="links">
<li class=""><a href="/technology">Technology</a></li>
<li class=""><a href="/use-cases">Use Cases</a></li>
<li class=""><a href="/druid-powered">Powered By</a></li>
<li class=""><a href="/docs/latest/design/">Docs</a></li>
<li class=""><a href="/community/">Community</a></li>
<li class="header-dropdown">
<a>Apache</a>
<div class="header-dropdown-menu">
<a href="https://www.apache.org/" target="_blank">Foundation</a>
<a href="https://www.apache.org/events/current-event" target="_blank">Events</a>
<a href="https://www.apache.org/licenses/" target="_blank">License</a>
<a href="https://www.apache.org/foundation/thanks.html" target="_blank">Thanks</a>
<a href="https://www.apache.org/security/" target="_blank">Security</a>
<a href="https://www.apache.org/foundation/sponsorship.html" target="_blank">Sponsorship</a>
</div>
</li>
<li class=" button-link"><a href="/downloads.html">Download</a></li>
</ul>
</div>
</div>
<div class="action-button menu-icon">
<span class="fa fa-bars"></span> MENU
</div>
<div class="action-button menu-icon-close">
<span class="fa fa-times"></span> MENU
</div>
</div>
<script type="text/javascript">
var $menu = $('.right-cont');
var $menuIcon = $('.menu-icon');
var $menuIconClose = $('.menu-icon-close');
function showMenu() {
$menu.fadeIn(100);
$menuIcon.fadeOut(100);
$menuIconClose.fadeIn(100);
}
$menuIcon.click(showMenu);
function hideMenu() {
$menu.fadeOut(100);
$menuIconClose.fadeOut(100);
$menuIcon.fadeIn(100);
}
$menuIconClose.click(hideMenu);
$(window).resize(function() {
if ($(window).width() >= 840) {
$menu.fadeIn(100);
$menuIcon.fadeOut(100);
$menuIconClose.fadeOut(100);
}
else {
$menu.fadeOut(100);
$menuIcon.fadeIn(100);
$menuIconClose.fadeOut(100);
}
});
</script>
<!-- Stop page_header include -->
<div class="container doc-container">
<p> Looking for the <a href="/docs/0.19.0/">latest stable documentation</a>?</p>
<div class="row">
<div class="col-md-9 doc-content">
<p>
<a class="btn btn-default btn-xs visible-xs-inline-block visible-sm-inline-block" href="#toc">Table of Contents</a>
</p>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<h1 id="setting-up-a-clustered-deployment">Setting up a Clustered Deployment</h1>
<p>Apache Druid (incubating) is designed to be deployed as a scalable, fault-tolerant cluster.</p>
<p>In this document, we&#39;ll set up a simple cluster and discuss how it can be further configured to meet
your needs. </p>
<p>This simple cluster will feature:
- A Master server to host the Coordinator and Overlord processes
- Two scalable, fault-tolerant Data servers running Historical and MiddleManager processes
- A query server, hosting the Druid Broker and Router processes</p>
<p>In production, we recommend deploying multiple Master servers and multiple Query servers in a fault-tolerant configuration based on your specific fault-tolerance needs, but you can get started quickly with one Master and one Query server and add more servers later.</p>
<h2 id="select-hardware">Select hardware</h2>
<h3 id="fresh-deployment">Fresh Deployment</h3>
<p>If you do not have an existing Druid cluster, and wish to start running Druid in a clustered deployment, this guide provides an example clustered deployment with pre-made configurations.</p>
<h4 id="master-server">Master Server</h4>
<p>The Coordinator and Overlord processes are responsible for handling the metadata and coordination needs of your cluster. They can be colocated together on the same server. </p>
<p>In this example, we will be deploying the equivalent of one AWS <a href="https://aws.amazon.com/ec2/instance-types/m5/">m5.2xlarge</a> instance.</p>
<p>This hardware offers:
- 8 vCPUs
- 31 GB RAM</p>
<p>Example Master server configurations that have been sized for this hardware can be found under <code>conf/druid/cluster/master</code>.</p>
<h4 id="data-server">Data Server</h4>
<p>Historicals and MiddleManagers can be colocated on the same server to handle the actual data in your cluster. These servers benefit greatly from CPU, RAM,
and SSDs. </p>
<p>In this example, we will be deploying the equivalent of two AWS <a href="https://aws.amazon.com/ec2/instance-types/i3/">i3.4xlarge</a> instances. </p>
<p>This hardware offers:</p>
<ul>
<li>16 vCPUs</li>
<li>122 GB RAM</li>
<li>2 * 1.9TB SSD storage</li>
</ul>
<p>Example Data server configurations that have been sized for this hardware can be found under <code>conf/druid/cluster/data</code>.</p>
<h4 id="query-server">Query Server</h4>
<p>Druid Brokers accept queries and farm them out to the rest of the cluster. They also optionally maintain an
in-memory query cache. These servers benefit greatly from CPU and RAM.</p>
<p>In this example, we will be deploying the equivalent of one AWS <a href="https://aws.amazon.com/ec2/instance-types/m5/">m5.2xlarge</a> instance. </p>
<p>This hardware offers:
- 8 vCPUs
- 31 GB RAM</p>
<p>You can consider co-locating any open source UIs or query libraries on the same server that the Broker is running on.</p>
<p>Example Query server configurations that have been sized for this hardware can be found under <code>conf/druid/cluster/query</code>.</p>
<h4 id="other-hardware-sizes">Other Hardware Sizes</h4>
<p>The example cluster above is chosen as a single example out of many possible ways to size a Druid cluster.</p>
<p>You can choose smaller/larger hardware or less/more servers for your specific needs and constraints.</p>
<p>If your use case has complex scaling requirements, you can also choose to not co-locate Druid processes (e.g., standalone Historical servers).</p>
<p>The information in the <a href="../operations/basic-cluster-tuning.html">basic cluster tuning guide</a> can help with your decision-making process and with sizing your configurations.</p>
<h3 id="migrating-from-a-single-server-deployment">Migrating from a Single-Server Deployment</h3>
<p>If you have an existing single-server deployment, such as the ones from the <a href="../operations/single-server.html">single-server deployment examples</a>, and you wish to migrate to a clustered deployment of similar scale, the following section contains guidelines for choosing equivalent hardware using the Master/Data/Query server organization.</p>
<h4 id="master-server">Master Server</h4>
<p>The main considerations for the Master server are available CPUs and RAM for the Coordinator and Overlord heaps.</p>
<p>Sum up the allocated heap sizes for your Coordinator and Overlord from the single-server deployment, and choose Master server hardware with enough RAM for the combined heaps, with some extra RAM for other processes on the machine.</p>
<p>For CPU cores, you can choose hardware with approximately 1/4th of the cores of the single-server deployment.</p>
<h4 id="data-server">Data Server</h4>
<p>When choosing Data server hardware for the cluster, the main considerations are available CPUs and RAM, and using SSD storage if feasible.</p>
<p>In a clustered deployment, having multiple Data servers is a good idea for fault-tolerance purposes.</p>
<p>When choosing the Data server hardware, you can choose a split factor <code>N</code>, divide the original CPU/RAM of the single-server deployment by <code>N</code>, and deploy <code>N</code> Data servers of reduced size in the new cluster.</p>
<p>Instructions for adjusting the Historical/MiddleManager configs for the split are described in a later section in this guide.</p>
<h4 id="query-server">Query Server</h4>
<p>The main considerations for the Query server are available CPUs and RAM for the Broker heap + direct memory, and Router heap.</p>
<p>Sum up the allocated memory sizes for your Broker and Router from the single-server deployment, and choose Query server hardware with enough RAM to cover the Broker/Router, with some extra RAM for other processes on the machine.</p>
<p>For CPU cores, you can choose hardware with approximately 1/4th of the cores of the single-server deployment.</p>
<p>The <a href="../operations/basic-cluster-tuning.html">basic cluster tuning guide</a> has information on how to calculate Broker/Router memory usage.</p>
<h2 id="select-os">Select OS</h2>
<p>We recommend running your favorite Linux distribution. You will also need:</p>
<ul>
<li>Java 8</li>
</ul>
<p>Your OS package manager should be able to help for both Java. If your Ubuntu-based OS
does not have a recent enough version of Java, WebUpd8 offers <a href="http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html">packages for those
OSes</a>.</p>
<h2 id="download-the-distribution">Download the distribution</h2>
<p>First, download and unpack the release archive. It&#39;s best to do this on a single machine at first,
since you will be editing the configurations and then copying the modified distribution out to all
of your servers.</p>
<p><a href="https://www.apache.org/dyn/closer.cgi?path=/incubator/druid/0.15.0-incubating/apache-druid-0.15.0-incubating-bin.tar.gz">Download</a>
the 0.15.0-incubating release.</p>
<p>Extract Druid by running the following commands in your terminal:</p>
<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span></span>tar -xzf apache-druid-0.15.0-incubating-bin.tar.gz
<span class="nb">cd</span> apache-druid-0.15.0-incubating
</code></pre></div>
<p>In the package, you should find:</p>
<ul>
<li><code>DISCLAIMER</code>, <code>LICENSE</code>, and <code>NOTICE</code> files</li>
<li><code>bin/*</code> - scripts related to the <a href="index.html">single-machine quickstart</a></li>
<li><code>conf/druid/cluster/*</code> - template configurations for a clustered setup</li>
<li><code>extensions/*</code> - core Druid extensions</li>
<li><code>hadoop-dependencies/*</code> - Druid Hadoop dependencies</li>
<li><code>lib/*</code> - libraries and dependencies for core Druid</li>
<li><code>quickstart/*</code> - files related to the <a href="index.html">single-machine quickstart</a></li>
</ul>
<p>We&#39;ll be editing the files in <code>conf/druid/cluster/</code> in order to get things running.</p>
<h3 id="migrating-from-single-server-deployments">Migrating from Single-Server Deployments</h3>
<p>In the following sections we will be editing the configs under <code>conf/druid/cluster</code>.</p>
<p>If you have an existing single-server deployment, please copy your existing configs to <code>conf/druid/cluster</code> to preserve any config changes you have made.</p>
<h2 id="configure-metadata-storage-and-deep-storage">Configure metadata storage and deep storage</h2>
<h3 id="migrating-from-single-server-deployments">Migrating from Single-Server Deployments</h3>
<p>If you have an existing single-server deployment and you wish to preserve your data across the migration, please follow the instructions at <a href="../operations/metadata-migration.html">metadata migration</a> and <a href="../operations/deep-storage-migration.html">deep storage migration</a> before updating your metadata/deep storage configs.</p>
<p>These guides are targeted at single-server deployments that use the Derby metadata store and local deep storage. If you are already using a non-Derby metadata store in your single-server cluster, you can reuse the existing metadata store for the new cluster.</p>
<p>These guides also provide information on migrating segments from local deep storage. A clustered deployment requires distributed deep storage like S3 or HDFS. If your single-server deployment was already using distributed deep storage, you can reuse the existing deep storage for the new cluster.</p>
<h3 id="metadata-storage">Metadata Storage</h3>
<p>In <code>conf/druid/cluster/_common/common.runtime.properties</code>, replace
&quot;metadata.storage.*&quot; with the address of the machine that you will use as your metadata store:</p>
<ul>
<li><code>druid.metadata.storage.connector.connectURI</code></li>
<li><code>druid.metadata.storage.connector.host</code></li>
</ul>
<p>In a production deployment, we recommend running a dedicated metadata store such as MySQL or PostgreSQL with replication, deployed separately from the Druid servers.</p>
<p>The <a href="../development/extensions-core/mysql.html">MySQL extension</a> and <a href="../development/extensions-core/postgresql.html">PostgreSQL extension</a> docs have instructions for extension configuration and initial database setup.</p>
<h3 id="deep-storage">Deep Storage</h3>
<p>Druid relies on a distributed filesystem or large object (blob) store for data storage. The most
commonly used deep storage implementations are S3 (popular for those on AWS) and HDFS (popular if
you already have a Hadoop deployment).</p>
<h4 id="s3">S3</h4>
<p>In <code>conf/druid/cluster/_common/common.runtime.properties</code>,</p>
<ul>
<li><p>Add &quot;druid-s3-extensions&quot; to <code>druid.extensions.loadList</code>.</p></li>
<li><p>Comment out the configurations for local storage under &quot;Deep Storage&quot; and &quot;Indexing service logs&quot;.</p></li>
<li><p>Uncomment and configure appropriate values in the &quot;For S3&quot; sections of &quot;Deep Storage&quot; and
&quot;Indexing service logs&quot;.</p></li>
</ul>
<p>After this, you should have made the following changes:</p>
<div class="highlight"><pre><code class="language-text" data-lang="text"><span></span>druid.extensions.loadList=[&quot;druid-s3-extensions&quot;]
#druid.storage.type=local
#druid.storage.storageDirectory=var/druid/segments
druid.storage.type=s3
druid.storage.bucket=your-bucket
druid.storage.baseKey=druid/segments
druid.s3.accessKey=...
druid.s3.secretKey=...
#druid.indexer.logs.type=file
#druid.indexer.logs.directory=var/druid/indexing-logs
druid.indexer.logs.type=s3
druid.indexer.logs.s3Bucket=your-bucket
druid.indexer.logs.s3Prefix=druid/indexing-logs
</code></pre></div>
<p>Please see the <a href="../development/extensions-core/s3.html">S3 extension</a> documentation for more info.</p>
<h4 id="hdfs">HDFS</h4>
<p>In <code>conf/druid/cluster/_common/common.runtime.properties</code>,</p>
<ul>
<li><p>Add &quot;druid-hdfs-storage&quot; to <code>druid.extensions.loadList</code>.</p></li>
<li><p>Comment out the configurations for local storage under &quot;Deep Storage&quot; and &quot;Indexing service logs&quot;.</p></li>
<li><p>Uncomment and configure appropriate values in the &quot;For HDFS&quot; sections of &quot;Deep Storage&quot; and
&quot;Indexing service logs&quot;.</p></li>
</ul>
<p>After this, you should have made the following changes:</p>
<div class="highlight"><pre><code class="language-text" data-lang="text"><span></span>druid.extensions.loadList=[&quot;druid-hdfs-storage&quot;]
#druid.storage.type=local
#druid.storage.storageDirectory=var/druid/segments
druid.storage.type=hdfs
druid.storage.storageDirectory=/druid/segments
#druid.indexer.logs.type=file
#druid.indexer.logs.directory=var/druid/indexing-logs
druid.indexer.logs.type=hdfs
druid.indexer.logs.directory=/druid/indexing-logs
</code></pre></div>
<p>Also,</p>
<ul>
<li>Place your Hadoop configuration XMLs (core-site.xml, hdfs-site.xml, yarn-site.xml,
mapred-site.xml) on the classpath of your Druid processes. You can do this by copying them into
<code>conf/druid/cluster/_common/</code>.</li>
</ul>
<p>Please see the <a href="../development/extensions-core/hdfs.html">HDFS extension</a> documentation for more info.</p>
<h2 id="configure-tranquility-server-optional">Configure Tranquility Server (optional)</h2>
<p>Data streams can be sent to Druid through a simple HTTP API powered by Tranquility
Server. If you will be using this functionality, then at this point you should <a href="../ingestion/stream-ingestion.html#server">configure
Tranquility Server</a>.</p>
<h2 id="configure-for-connecting-to-hadoop-optional">Configure for connecting to Hadoop (optional)</h2>
<p>If you will be loading data from a Hadoop cluster, then at this point you should configure Druid to be aware
of your cluster:</p>
<ul>
<li><p>Update <code>druid.indexer.task.hadoopWorkingPath</code> in <code>conf/druid/cluster/middleManager/runtime.properties</code> to
a path on HDFS that you&#39;d like to use for temporary files required during the indexing process.
<code>druid.indexer.task.hadoopWorkingPath=/tmp/druid-indexing</code> is a common choice.</p></li>
<li><p>Place your Hadoop configuration XMLs (core-site.xml, hdfs-site.xml, yarn-site.xml,
mapred-site.xml) on the classpath of your Druid processes. You can do this by copying them into
<code>conf/druid/cluster/_common/core-site.xml</code>, <code>conf/druid/cluster/_common/hdfs-site.xml</code>, and so on.</p></li>
</ul>
<p>Note that you don&#39;t need to use HDFS deep storage in order to load data from Hadoop. For example, if
your cluster is running on Amazon Web Services, we recommend using S3 for deep storage even if you
are loading data using Hadoop or Elastic MapReduce.</p>
<p>For more info, please see <a href="../ingestion/batch-ingestion.html">batch ingestion</a>.</p>
<h2 id="configure-zookeeper-connection">Configure Zookeeper connection</h2>
<p>In a production cluster, we recommend using a dedicated ZK cluster in a quorum, deployed separately from the Druid servers.</p>
<p>In <code>conf/druid/cluster/_common/common.runtime.properties</code>, set
<code>druid.zk.service.host</code> to a <a href="https://zookeeper.apache.org/doc/current/zookeeperProgrammers.html">connection string</a>
containing a comma separated list of host:port pairs, each corresponding to a ZooKeeper server in your ZK quorum.
(e.g. &quot;127.0.0.1:4545&quot; or &quot;127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002&quot;)</p>
<p>You can also choose to run ZK on the Master servers instead of having a dedicated ZK cluster. If doing so, we recommend deploying 3 Master servers so that you have a ZK quorum.</p>
<h2 id="configuration-tuning">Configuration Tuning</h2>
<h3 id="migrating-from-a-single-server-deployment">Migrating from a Single-Server Deployment</h3>
<h4 id="master">Master</h4>
<p>If you are using an example configuration from <a href="../operations/single-server.html">single-server deployment examples</a>, these examples combine the Coordinator and Overlord processes into one combined process.</p>
<p>The example configs under <code>conf/druid/cluster/master/coordinator-overlord</code> also combine the Coordinator and Overlord processes.</p>
<p>You can copy your existing <code>coordinator-overlord</code> configs from the single-server deployment to <code>conf/druid/cluster/master/coordinator-overlord</code>.</p>
<h4 id="data">Data</h4>
<p>Suppose we are migrating from a single-server deployment that had 32 CPU and 256GB RAM. In the old deployment, the following configurations for Historicals and MiddleManagers were applied:</p>
<p>Historical (Single-server)
<code>
druid.processing.buffer.sizeBytes=500000000
druid.processing.numMergeBuffers=8
druid.processing.numThreads=31
</code></p>
<p>MiddleManager (Single-server)
<code>
druid.worker.capacity=8
druid.indexer.fork.property.druid.processing.numMergeBuffers=2
druid.indexer.fork.property.druid.processing.buffer.sizeBytes=100000000
druid.indexer.fork.property.druid.processing.numThreads=1
</code></p>
<p>In the clustered deployment, we can choose a split factor (2 in this example), and deploy 2 Data servers with 16CPU and 128GB RAM each. The areas to scale are the following:</p>
<p>Historical
- <code>druid.processing.numThreads</code>: Set to <code>(num_cores - 1)</code> based on the new hardware
- <code>druid.processing.numMergeBuffers</code>: Divide the old value from the single-server deployment by the split factor
- <code>druid.processing.buffer.sizeBytes</code>: Keep this unchanged</p>
<p>MiddleManager:
- <code>druid.worker.capacity</code>: Divide the old value from the single-server deployment by the split factor
- <code>druid.indexer.fork.property.druid.processing.numMergeBuffers</code>: Keep this unchanged
- <code>druid.indexer.fork.property.druid.processing.buffer.sizeBytes</code>: Keep this unchanged
- <code>druid.indexer.fork.property.druid.processing.numThreads</code>: Keep this unchanged</p>
<p>The resulting configs after the split:</p>
<p>New Historical (on 2 Data servers)
<code>
druid.processing.buffer.sizeBytes=500000000
druid.processing.numMergeBuffers=8
druid.processing.numThreads=31
</code></p>
<p>New MiddleManager (on 2 Data servers)
<code>
druid.worker.capacity=4
druid.indexer.fork.property.druid.processing.numMergeBuffers=2
druid.indexer.fork.property.druid.processing.buffer.sizeBytes=100000000
druid.indexer.fork.property.druid.processing.numThreads=1
</code></p>
<h4 id="query">Query</h4>
<p>You can copy your existing Broker and Router configs to the directories under <code>conf/druid/cluster/query</code>, no modifications are needed, as long as the new hardware is sized accordingly.</p>
<h3 id="fresh-deployment">Fresh deployment</h3>
<p>If you are using the example cluster described above:
- 1 Master server (m5.2xlarge)
- 2 Data servers (i3.4xlarge)
- 1 Query server (m5.2xlarge)</p>
<p>The configurations under <code>conf/druid/cluster</code> have already been sized for this hardware and you do not need to make further modifications for general use cases.</p>
<p>If you have chosen different hardware, the <a href="../operations/basic-cluster-tuning.html">basic cluster tuning guide</a> can help you size your configurations.</p>
<h2 id="open-ports-if-using-a-firewall">Open ports (if using a firewall)</h2>
<p>If you&#39;re using a firewall or some other system that only allows traffic on specific ports, allow
inbound connections on the following:</p>
<h3 id="master-server">Master Server</h3>
<ul>
<li>1527 (Derby metadata store; not needed if you are using a separate metadata store like MySQL or PostgreSQL)</li>
<li>2181 (ZooKeeper; not needed if you are using a separate ZooKeeper cluster)</li>
<li>8081 (Coordinator)</li>
<li>8090 (Overlord)</li>
</ul>
<h3 id="data-server">Data Server</h3>
<ul>
<li>8083 (Historical)</li>
<li>8091, 8100&ndash;8199 (Druid Middle Manager; you may need higher than port 8199 if you have a very high <code>druid.worker.capacity</code>)</li>
</ul>
<h3 id="query-server">Query Server</h3>
<ul>
<li>8082 (Broker)</li>
<li>8088 (Router, if used)</li>
</ul>
<h3 id="other">Other</h3>
<ul>
<li>8200 (Tranquility Server, if used)</li>
</ul>
<div class="note caution">
In production, we recommend deploying ZooKeeper and your metadata store on their own dedicated hardware,
rather than on the Master server.
</div>
<h2 id="start-master-server">Start Master Server</h2>
<p>Copy the Druid distribution and your edited configurations to your Master server.</p>
<p>If you have been editing the configurations on your local machine, you can use <em>rsync</em> to copy them:</p>
<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span></span>rsync -az apache-druid-0.15.0-incubating/ MASTER_SERVER:apache-druid-0.15.0-incubating/
</code></pre></div>
<h3 id="no-zookeper-on-master">No Zookeper on Master</h3>
<p>From the distribution root, run the following command to start the Master server:</p>
<div class="highlight"><pre><code class="language-text" data-lang="text"><span></span>bin/start-cluster-master-no-zk-server
</code></pre></div>
<h3 id="with-zookeeper-on-master">With Zookeeper on Master</h3>
<p>If you plan to run ZK on Master servers, first update <code>conf/zoo.cfg</code> to reflect how you plan to run ZK. Then log on to your Master servers and install Zookeeper:</p>
<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span></span>curl http://www.gtlib.gatech.edu/pub/apache/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz -o zookeeper-3.4.11.tar.gz
tar -xzf zookeeper-3.4.11.tar.gz
mv zookeeper-3.4.11 zk
</code></pre></div>
<p>If you are running ZK on the Master server, you can start the Master server processes together with ZK using:</p>
<div class="highlight"><pre><code class="language-text" data-lang="text"><span></span>bin/start-cluster-master-with-zk-server
</code></pre></div>
<div class="note caution">
In production, we also recommend running a ZooKeeper cluster on its own dedicated hardware.
</div>
<h2 id="start-data-server">Start Data Server</h2>
<p>Copy the Druid distribution and your edited configurations to your Data servers.</p>
<p>From the distribution root, run the following command to start the Data server:</p>
<div class="highlight"><pre><code class="language-text" data-lang="text"><span></span>bin/start-cluster-data-server
</code></pre></div>
<p>You can add more Data servers as needed.</p>
<div class="note info">
For clusters with complex resource allocation needs, you can break apart Historicals and MiddleManagers and scale the components individually.
This also allows you take advantage of Druid's built-in MiddleManager autoscaling facility.
</div>
<h3 id="tranquility">Tranquility</h3>
<p>If you are doing push-based stream ingestion with Kafka or over HTTP, you can also start Tranquility Server on the Data server. </p>
<p>For large scale production, Data server processes and the Tranquility Server can still be co-located. </p>
<p>If you are running Tranquility (not server) with a stream processor, you can co-locate Tranquility with the stream processor and not require Tranquility Server.</p>
<p>First install Tranquility:</p>
<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span></span>curl http://static.druid.io/tranquility/releases/tranquility-distribution-0.8.3.tgz -o tranquility-distribution-0.8.3.tgz
tar -xzf tranquility-distribution-0.8.3.tgz
mv tranquility-distribution-0.8.3 tranquility
</code></pre></div>
<p>Afterwards, in <code>conf/supervise/cluster/data.conf</code>, uncomment out the <code>tranquility-server</code> line, and restart the Data server proceses.</p>
<h2 id="start-query-server">Start Query Server</h2>
<p>Copy the Druid distribution and your edited configurations to your Query servers.</p>
<p>From the distribution root, run the following command to start the Query server:</p>
<div class="highlight"><pre><code class="language-text" data-lang="text"><span></span>bin/start-cluster-query-server
</code></pre></div>
<p>You can add more Query servers as needed based on query load. If you increase the number of Query servers, be sure to adjust the connection pools on your Historicals and Tasks as described in the <a href="../operations/basic-cluster-tuning.html">basic cluster tuning guide</a>.</p>
<h2 id="loading-data">Loading data</h2>
<p>Congratulations, you now have a Druid cluster! The next step is to learn about recommended ways to load data into
Druid based on your use case. Read more about <a href="../ingestion/index.html">loading data</a>.</p>
</div>
<div class="col-md-3">
<div class="searchbox">
<gcse:searchbox-only></gcse:searchbox-only>
</div>
<div id="toc" class="nav toc hidden-print">
</div>
</div>
</div>
</div>
<!-- Start page_footer include -->
<footer class="druid-footer">
<div class="container">
<div class="text-center">
<p>
<a href="/technology">Technology</a>&ensp;·&ensp;
<a href="/use-cases">Use Cases</a>&ensp;·&ensp;
<a href="/druid-powered">Powered by Druid</a>&ensp;·&ensp;
<a href="/docs/latest/">Docs</a>&ensp;·&ensp;
<a href="/community/">Community</a>&ensp;·&ensp;
<a href="/downloads.html">Download</a>&ensp;·&ensp;
<a href="/faq">FAQ</a>
</p>
</div>
<div class="text-center">
<a title="Join the user group" href="https://groups.google.com/forum/#!forum/druid-user" target="_blank"><span class="fa fa-comments"></span></a>&ensp;·&ensp;
<a title="Follow Druid" href="https://twitter.com/druidio" target="_blank"><span class="fab fa-twitter"></span></a>&ensp;·&ensp;
<a title="GitHub" href="https://github.com/apache/druid" target="_blank"><span class="fab fa-github"></span></a>
</div>
<div class="text-center license">
Copyright © 2020 <a href="https://www.apache.org/" target="_blank">Apache Software Foundation</a>.<br>
Except where otherwise noted, licensed under <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>.<br>
Apache Druid, Druid, and the Druid logo are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries.
</div>
</div>
</footer>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-131010415-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-131010415-1');
</script>
<script>
function trackDownload(type, url) {
ga('send', 'event', 'download', type, url);
}
</script>
<script src="//code.jquery.com/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="/assets/js/druid.js"></script>
<!-- stop page_footer include -->
<script>
$(function() {
$(".toc").load("/docs/0.15.0-incubating/toc.html");
// There is no way to tell when .gsc-input will be async loaded into the page so just try to set a placeholder until it works
var tries = 0;
var timer = setInterval(function() {
tries++;
if (tries > 300) clearInterval(timer);
var searchInput = $('input.gsc-input');
if (searchInput.length) {
searchInput.attr('placeholder', 'Search');
clearInterval(timer);
}
}, 100);
});
</script>
</body>
</html>