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