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