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