blob: 1301c9931abe805761cc2264528757a459e9b4d4 [file] [log] [blame]
Ian Maxon3355d4c2021-12-13 12:38:15 -08001<!DOCTYPE html>
2<!--
3 | Generated by Apache Maven Doxia Site Renderer 1.8.1 from target/generated-site/markdown/ansible.md at 2021-12-13
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="20211213" />
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: 2021-12-13</li>
30 <li id="projectVersion" class="pull-right">Version: 0.9.7.1</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><a href="sqlpp/arrayindex.html" title="Support of Array Indexes"><span class="none"></span>Support of Array Indexes</a></li>
62 <li class="nav-header">Deprecated</li>
63 <li><a href="aql/primer.html" title="AsterixDB Primer: Using AQL"><span class="none"></span>AsterixDB Primer: Using AQL</a></li>
64 <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>
65 <li><a href="aql/builtins.html" title="Queries: Builtin Functions (AQL)"><span class="none"></span>Queries: Builtin Functions (AQL)</a></li>
66</ul>
67 <hr />
68 <div id="poweredBy">
69 <div class="clear"></div>
70 <div class="clear"></div>
71 <div class="clear"></div>
72 <div class="clear"></div>
73<a href="./" title="AsterixDB" class="builtBy"><img class="builtBy" alt="AsterixDB" src="images/asterixlogo.png" /></a>
74 </div>
75 </div>
76 </div>
77 <div id="bodyColumn" class="span10" >
78<!--
79 ! Licensed to the Apache Software Foundation (ASF) under one
80 ! or more contributor license agreements. See the NOTICE file
81 ! distributed with this work for additional information
82 ! regarding copyright ownership. The ASF licenses this file
83 ! to you under the Apache License, Version 2.0 (the
84 ! "License"); you may not use this file except in compliance
85 ! with the License. You may obtain a copy of the License at
86 !
87 ! http://www.apache.org/licenses/LICENSE-2.0
88 !
89 ! Unless required by applicable law or agreed to in writing,
90 ! software distributed under the License is distributed on an
91 ! "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
92 ! KIND, either express or implied. See the License for the
93 ! specific language governing permissions and limitations
94 ! under the License.
95 !-->
96<h1>Installation using Ansible</h1>
97<div class="section">
98<h2><a name="Table_of_Contents"></a><a name="atoc" id="#toc">Table of Contents</a></h2>
99<ul>
100
101<li><a href="#Introduction">Introduction</a></li>
102<li><a href="#Prerequisites">Prerequisites</a></li>
103<li><a href="#config">Cluster Configuration</a></li>
104<li><a href="#lifecycle">Cluster Lifecycle Management</a></li>
105</ul><!--
106 ! Licensed to the Apache Software Foundation (ASF) under one
107 ! or more contributor license agreements. See the NOTICE file
108 ! distributed with this work for additional information
109 ! regarding copyright ownership. The ASF licenses this file
110 ! to you under the Apache License, Version 2.0 (the
111 ! "License"); you may not use this file except in compliance
112 ! with the License. You may obtain a copy of the License at
113 !
114 ! http://www.apache.org/licenses/LICENSE-2.0
115 !
116 ! Unless required by applicable law or agreed to in writing,
117 ! software distributed under the License is distributed on an
118 ! "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
119 ! KIND, either express or implied. See the License for the
120 ! specific language governing permissions and limitations
121 ! under the License.
122 !-->
123</div>
124<div class="section">
125<h2><a name="Introduction" id="Introduction">Introduction</a></h2>
126<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>
127<div class="section">
128<h2><a name="Prerequisites" id="Prerequisites">Prerequisites</a></h2>
129<ul>
130
131<li>
132
133<p>Supported operating systems: <b>Linux</b> and <b>MacOS</b></p>
134</li>
135<li>
136
137<p>Install pip on your client machine:</p>
138<p>CentOS</p>
139
140<div>
141<div>
142<pre class="source"> $ sudo yum install python-pip
143</pre></div></div>
144
145<p>Ubuntu</p>
146
147<div>
148<div>
149<pre class="source"> $ sudo apt-get install python-pip
150</pre></div></div>
151
152<p>macOS</p>
153
154<div>
155<div>
156<pre class="source"> $ brew install pip
157</pre></div></div>
158</li>
159<li>
160
161<p>Install Ansible, boto, and boto3 on your client machine:</p>
162
163<div>
164<div>
165<pre class="source"> $ pip install ansible
166 $ pip install boto
167 $ pip install boto3
168</pre></div></div>
169
170<p>Note that you might need <tt>sudo</tt> depending on your system configuration.</p>
171<p><b>Make sure that the version of Ansible is no less than 2.2.1.0</b>:</p>
172
173<div>
174<div>
175<pre class="source"> $ ansible --version
176 ansible 2.2.1.0
177</pre></div></div>
178</li>
179<li>
180
181<p>Download the AsterixDB distribution package, unzip it, and navigate to <tt>opt/ansible/</tt></p>
182
183<div>
184<div>
185<pre class="source"> $ cd opt/ansible
186</pre></div></div>
187
188<p>The following files and directories are in the directory <tt>opt/ansible</tt>:</p>
189
190<div>
191<div>
192<pre class="source"> README bin conf yaml
193</pre></div></div>
194
195<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>
196</li>
197</ul></div>
198<div class="section">
199<h2><a name="Cluster_Configuration"></a><a name="config" id="config">Cluster Configuration</a></h2>
200<ul>
201
202<li>
203
204<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>
205
206<div>
207<div>
208<pre class="source"> [cc]
209 172.0.1.10
210
211 [ncs]
212 172.0.1.11
213 172.0.1.12
214</pre></div></div>
215
216<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>
217
218<div>
219<div>
220<pre class="source"> ;[all:vars]
221 ;ansible_ssh_user=&lt;fill with your ssh account username&gt;
222</pre></div></div>
223
224<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>
225</li>
226<li>
227
228<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>
229</li>
230</ul></div>
231<div class="section">
232<h2><a name="Cluster_Lifecycle_Management"></a><a name="lifecycle" id="lifecycle">Cluster Lifecycle Management</a></h2>
233<ul>
234
235<li>
236
237<p>Deploy the binary to all nodes:</p>
238
239<div>
240<div>
241<pre class="source"> $ bin/deploy.sh
242</pre></div></div>
243</li>
244<li>
245
246<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>
247</li>
248<li>
249
250<p>Launch your AsterixDB cluster:</p>
251
252<div>
253<div>
254<pre class="source"> $ bin/start.sh
255</pre></div></div>
256
257<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>
258</li>
259<li>
260
261<p>If you want to stop the the multi-node AsterixDB cluster, run the following script:</p>
262
263<div>
264<div>
265<pre class="source"> $ bin/stop.sh
266</pre></div></div>
267</li>
268<li>
269
270<p>If you want to remove the binary on all nodes, run the following script:</p>
271
272<div>
273<div>
274<pre class="source"> $ bin/erase.sh
275</pre></div></div>
276</li>
277</ul></div>
278 </div>
279 </div>
280 </div>
281 <hr/>
282 <footer>
283 <div class="container-fluid">
284 <div class="row-fluid">
285<div class="row-fluid">Apache AsterixDB, AsterixDB, Apache, the Apache
286 feather logo, and the Apache AsterixDB project logo are either
287 registered trademarks or trademarks of The Apache Software
288 Foundation in the United States and other countries.
289 All other marks mentioned may be trademarks or registered
290 trademarks of their respective owners.
291 </div>
292 </div>
293 </div>
294 </footer>
295 </body>
296</html>