blob: d3ff224163092df5c98fe42fe842d0eee69c39a0 [file] [log] [blame]
Ian Maxon49d15b22020-12-06 16:23:00 -08001<!DOCTYPE html>
2<!--
3 | Generated by Apache Maven Doxia Site Renderer 1.8.1 from target/generated-site/markdown/ansible.md at 2020-12-06
4 | Rendered using Apache Maven Fluido Skin 1.7
5-->
6<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <head>
8 <meta charset="UTF-8" />
9 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
10 <meta name="Date-Revision-yyyymmdd" content="20201206" />
11 <meta http-equiv="Content-Language" content="en" />
12 <title>AsterixDB &#x2013; Installation using Ansible</title>
13 <link rel="stylesheet" href="./css/apache-maven-fluido-1.7.min.css" />
14 <link rel="stylesheet" href="./css/site.css" />
15 <link rel="stylesheet" href="./css/print.css" media="print" />
16 <script type="text/javascript" src="./js/apache-maven-fluido-1.7.min.js"></script>
17
18 </head>
19 <body class="topBarDisabled">
20 <div class="container-fluid">
21 <div id="banner">
22 <div class="pull-left"><a href="./" id="bannerLeft"><img src="images/asterixlogo.png" alt="AsterixDB"/></a></div>
23 <div class="pull-right"></div>
24 <div class="clear"><hr/></div>
25 </div>
26
27 <div id="breadcrumbs">
28 <ul class="breadcrumb">
29 <li id="publishDate">Last Published: 2020-12-06</li>
30 <li id="projectVersion" class="pull-right">Version: 0.9.6-SNAPSHOT</li>
31 <li class="pull-right"><a href="index.html" title="Documentation Home">Documentation Home</a></li>
32 </ul>
33 </div>
34 <div class="row-fluid">
35 <div id="leftColumn" class="span2">
36 <div class="well sidebar-nav">
37 <ul class="nav nav-list">
38 <li class="nav-header">Get Started - Installation</li>
39 <li><a href="ncservice.html" title="Option 1: using NCService"><span class="none"></span>Option 1: using NCService</a></li>
40 <li class="active"><a href="#"><span class="none"></span>Option 2: using Ansible</a></li>
41 <li><a href="aws.html" title="Option 3: using Amazon Web Services"><span class="none"></span>Option 3: using Amazon Web Services</a></li>
42 <li class="nav-header">AsterixDB Primer</li>
43 <li><a href="sqlpp/primer-sqlpp.html" title="Using SQL++"><span class="none"></span>Using SQL++</a></li>
44 <li class="nav-header">Data Model</li>
45 <li><a href="datamodel.html" title="The Asterix Data Model"><span class="none"></span>The Asterix Data Model</a></li>
46 <li class="nav-header">Queries</li>
47 <li><a href="sqlpp/manual.html" title="The SQL++ Query Language"><span class="none"></span>The SQL++ Query Language</a></li>
48 <li><a href="SQLPP.html" title="Raw SQL++ Grammar"><span class="none"></span>Raw SQL++ Grammar</a></li>
49 <li><a href="sqlpp/builtins.html" title="Builtin Functions"><span class="none"></span>Builtin Functions</a></li>
50 <li class="nav-header">API/SDK</li>
51 <li><a href="api.html" title="HTTP API"><span class="none"></span>HTTP API</a></li>
52 <li><a href="csv.html" title="CSV Output"><span class="none"></span>CSV Output</a></li>
53 <li class="nav-header">Advanced Features</li>
54 <li><a href="aql/externaldata.html" title="Accessing External Data"><span class="none"></span>Accessing External Data</a></li>
55 <li><a href="feeds.html" title="Data Ingestion with Feeds"><span class="none"></span>Data Ingestion with Feeds</a></li>
56 <li><a href="udf.html" title="User Defined Functions"><span class="none"></span>User Defined Functions</a></li>
57 <li><a href="sqlpp/filters.html" title="Filter-Based LSM Index Acceleration"><span class="none"></span>Filter-Based LSM Index Acceleration</a></li>
58 <li><a href="sqlpp/fulltext.html" title="Support of Full-text Queries"><span class="none"></span>Support of Full-text Queries</a></li>
59 <li><a href="sqlpp/similarity.html" title="Support of Similarity Queries"><span class="none"></span>Support of Similarity Queries</a></li>
60 <li><a href="interval_join.html" title="Support of Interval Joins"><span class="none"></span>Support of Interval Joins</a></li>
61 <li class="nav-header">Deprecated</li>
62 <li><a href="aql/primer.html" title="AsterixDB Primer: Using AQL"><span class="none"></span>AsterixDB Primer: Using AQL</a></li>
63 <li><a href="aql/manual.html" title="Queries: The Asterix Query Language (AQL)"><span class="none"></span>Queries: The Asterix Query Language (AQL)</a></li>
64 <li><a href="aql/builtins.html" title="Queries: Builtin Functions (AQL)"><span class="none"></span>Queries: Builtin Functions (AQL)</a></li>
65</ul>
66 <hr />
67 <div id="poweredBy">
68 <div class="clear"></div>
69 <div class="clear"></div>
70 <div class="clear"></div>
71 <div class="clear"></div>
72<a href="./" title="AsterixDB" class="builtBy"><img class="builtBy" alt="AsterixDB" src="images/asterixlogo.png" /></a>
73 </div>
74 </div>
75 </div>
76 <div id="bodyColumn" class="span10" >
77<!--
78 ! Licensed to the Apache Software Foundation (ASF) under one
79 ! or more contributor license agreements. See the NOTICE file
80 ! distributed with this work for additional information
81 ! regarding copyright ownership. The ASF licenses this file
82 ! to you under the Apache License, Version 2.0 (the
83 ! "License"); you may not use this file except in compliance
84 ! with the License. You may obtain a copy of the License at
85 !
86 ! http://www.apache.org/licenses/LICENSE-2.0
87 !
88 ! Unless required by applicable law or agreed to in writing,
89 ! software distributed under the License is distributed on an
90 ! "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
91 ! KIND, either express or implied. See the License for the
92 ! specific language governing permissions and limitations
93 ! under the License.
94 !-->
95<h1>Installation using Ansible</h1>
96<div class="section">
97<h2><a name="Table_of_Contents"></a><a name="atoc" id="#toc">Table of Contents</a></h2>
98<ul>
99
100<li><a href="#Introduction">Introduction</a></li>
101<li><a href="#Prerequisites">Prerequisites</a></li>
102<li><a href="#config">Cluster Configuration</a></li>
103<li><a href="#lifecycle">Cluster Lifecycle Management</a></li>
104</ul><!--
105 ! Licensed to the Apache Software Foundation (ASF) under one
106 ! or more contributor license agreements. See the NOTICE file
107 ! distributed with this work for additional information
108 ! regarding copyright ownership. The ASF licenses this file
109 ! to you under the Apache License, Version 2.0 (the
110 ! "License"); you may not use this file except in compliance
111 ! with the License. You may obtain a copy of the License at
112 !
113 ! http://www.apache.org/licenses/LICENSE-2.0
114 !
115 ! Unless required by applicable law or agreed to in writing,
116 ! software distributed under the License is distributed on an
117 ! "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
118 ! KIND, either express or implied. See the License for the
119 ! specific language governing permissions and limitations
120 ! under the License.
121 !-->
122</div>
123<div class="section">
124<h2><a name="Introduction" id="Introduction">Introduction</a></h2>
125<p>This installation option provides several wrapped <a class="externalLink" href="https://www.ansible.com/">Ansible</a>-based scripts to deploy, start, stop, and erase an AsterixDB instance on a multi-node cluster without requiring users to interact with each individual node in the cluster.</p></div>
126<div class="section">
127<h2><a name="Prerequisites" id="Prerequisites">Prerequisites</a></h2>
128<ul>
129
130<li>
131
132<p>Supported operating systems: <b>Linux</b> and <b>MacOS</b></p>
133</li>
134<li>
135
136<p>Install pip on your client machine:</p>
137<p>CentOS</p>
138
139<div>
140<div>
141<pre class="source"> $ sudo yum install python-pip
142</pre></div></div>
143
144<p>Ubuntu</p>
145
146<div>
147<div>
148<pre class="source"> $ sudo apt-get install python-pip
149</pre></div></div>
150
151<p>macOS</p>
152
153<div>
154<div>
155<pre class="source"> $ brew install pip
156</pre></div></div>
157</li>
158<li>
159
160<p>Install Ansible, boto, and boto3 on your client machine:</p>
161
162<div>
163<div>
164<pre class="source"> $ pip install ansible
165 $ pip install boto
166 $ pip install boto3
167</pre></div></div>
168
169<p>Note that you might need <tt>sudo</tt> depending on your system configuration.</p>
170<p><b>Make sure that the version of Ansible is no less than 2.2.1.0</b>:</p>
171
172<div>
173<div>
174<pre class="source"> $ ansible --version
175 ansible 2.2.1.0
176</pre></div></div>
177</li>
178<li>
179
180<p>Download the AsterixDB distribution package, unzip it, and navigate to <tt>opt/ansible/</tt></p>
181
182<div>
183<div>
184<pre class="source"> $ cd opt/ansible
185</pre></div></div>
186
187<p>The following files and directories are in the directory <tt>opt/ansible</tt>:</p>
188
189<div>
190<div>
191<pre class="source"> README bin conf yaml
192</pre></div></div>
193
194<p><tt>bin</tt> contains scripts that deploy, start, stop and erase a multi-node AsterixDB cluster, according to the configuration specified in files under <tt>conf</tt>, and <tt>yaml</tt> contains internal Ansible scripts that the shell scripts in <tt>bin</tt> use.</p>
195</li>
196</ul></div>
197<div class="section">
198<h2><a name="Cluster_Configuration"></a><a name="config" id="config">Cluster Configuration</a></h2>
199<ul>
200
201<li>
202
203<p><b>Nodes and account</b>. Edit the inventory file <tt>conf/inventory</tt> when necessary. You mostly only need to specify the node DNS names (or IPs) for the cluster controller, i.e., the master node, in the <b>[cc]</b> section, and node controllers, i.e., slave nodes, in the <b>[ncs]</b> section. The following example configures a cluster with two slave nodes (172.0.1.11 and 172.0.1.12) and one master node (172.0.1.10).</p>
204
205<div>
206<div>
207<pre class="source"> [cc]
208 172.0.1.10
209
210 [ncs]
211 172.0.1.11
212 172.0.1.12
213</pre></div></div>
214
215<p><b>Configure passwordless ssh from your current client that runs the scripts to all nodes listed in <tt>conf/inventory</tt> as well as <tt>localhost</tt>.</b> If the ssh user account for target machines is different from your current username, please uncomment and edit the following two lines:</p>
216
217<div>
218<div>
219<pre class="source"> ;[all:vars]
220 ;ansible_ssh_user=&lt;fill with your ssh account username&gt;
221</pre></div></div>
222
223<p>If you want to specify advanced Ansible builtin variables, please refer to the <a class="externalLink" href="http://docs.ansible.com/ansible/intro_inventory.html">Ansible documentation</a>.</p>
224</li>
225<li>
226
227<p><b>Remote working directories</b>. Edit <tt>conf/instance_settings.yml</tt> to change the remote binary directory (the variable &#x201c;binarydir&#x201d;) when necessary. By default, the binary directory will be under the home directory (as the value of Ansible builtin variable ansible_env.HOME) of the ssh user account on each node.</p>
228</li>
229</ul></div>
230<div class="section">
231<h2><a name="Cluster_Lifecycle_Management"></a><a name="lifecycle" id="lifecycle">Cluster Lifecycle Management</a></h2>
232<ul>
233
234<li>
235
236<p>Deploy the binary to all nodes:</p>
237
238<div>
239<div>
240<pre class="source"> $ bin/deploy.sh
241</pre></div></div>
242</li>
243<li>
244
245<p>Every time before starting the AsterixDB cluster, you can edit the instance configuration file <tt>conf/instance/cc.conf</tt>, except that IP addresses/DNS names are generated and cannot be changed. All available parameters and their usage can be found <a href="ncservice.html#Parameters">here</a>.</p>
246</li>
247<li>
248
249<p>Launch your AsterixDB cluster:</p>
250
251<div>
252<div>
253<pre class="source"> $ bin/start.sh
254</pre></div></div>
255
256<p>Now you can use the multi-node AsterixDB cluster by opening the master node listed in <tt>conf/inventory</tt> at port <tt>19001</tt> (which can be customized in <tt>conf/instance/cc.conf</tt>) in your browser.</p>
257</li>
258<li>
259
260<p>If you want to stop the the multi-node AsterixDB cluster, run the following script:</p>
261
262<div>
263<div>
264<pre class="source"> $ bin/stop.sh
265</pre></div></div>
266</li>
267<li>
268
269<p>If you want to remove the binary on all nodes, run the following script:</p>
270
271<div>
272<div>
273<pre class="source"> $ bin/erase.sh
274</pre></div></div>
275</li>
276</ul></div>
277 </div>
278 </div>
279 </div>
280 <hr/>
281 <footer>
282 <div class="container-fluid">
283 <div class="row-fluid">
284<div class="row-fluid">Apache AsterixDB, AsterixDB, Apache, the Apache
285 feather logo, and the Apache AsterixDB project logo are either
286 registered trademarks or trademarks of The Apache Software
287 Foundation in the United States and other countries.
288 All other marks mentioned may be trademarks or registered
289 trademarks of their respective owners.
290 </div>
291 </div>
292 </div>
293 </footer>
294 </body>
295</html>