├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTE.md ├── LICENSE ├── README.md ├── defaults ├── CentOS.yml ├── Debian.yml ├── RedHat.yml ├── Ubuntu.yml ├── main.yml └── tuning.yml ├── examples ├── README_VAGRANT.md ├── Vagrantfile ├── bin │ └── preinstall.sh ├── cluster_backup.yml ├── cluster_collect_info.yml ├── cluster_init.yml ├── cluster_install.yml ├── create_bucket.yml ├── example_hosts ├── failover_node.yml ├── load_bucket.yml ├── retreive_ssl_cert.yml ├── site.yml └── vagrant_hosts ├── files ├── debian-iptables ├── etc_default_couchbase-server_ulimit ├── etc_security_limits.d_couchbase-server.conf └── rc.local ├── handlers └── main.yml ├── meta └── main.yml ├── tasks ├── CentOS.yml ├── CentOS_firewall.yml ├── Debian.yml ├── Debian_firewall.yml ├── RedHat.yml ├── RedHat_firewall.yml ├── Ubuntu.yml ├── Ubuntu_firewall.yml └── main.yml ├── templates ├── etc_sysconfig_iptables.j2 ├── etc_sysctl.d_couchbase-server.conf.j2 └── profile_couchbase-server.sh.j2 └── version.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .vagrant 3 | meta/.galaxy_install_info 4 | examples/hosts 5 | examples/labmachines 6 | examples/cluster_uninstall.yml 7 | files/*.rpm 8 | files/*.deb 9 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## v0.1.0 2 | 3 | - Initial effort 4 | 5 | ## v0.1.1 6 | 7 | - Basic installation 8 | - README updates 9 | 10 | ## v0.1.2 11 | 12 | - Renamed module to couchbase_server 13 | - Update email address 14 | 15 | ## v0.1.3 16 | 17 | - Add symlinks / plumbing to examples dir for convenience 18 | 19 | ## v0.1.4 20 | 21 | - Remove the unnecessary library symlink as role pulls in the module now 22 | 23 | ## v0.1.5 24 | 25 | - Note about linking role for examples 26 | 27 | ## v0.1.6 28 | 29 | - Update example playbooks to use role 30 | 31 | ## v0.1.7 32 | 33 | - Add an example_hosts inventory to the examples dir 34 | 35 | ## v0.1.8 36 | 37 | - Remove the Couchbase Server module 38 | - Add a site playbook to the examples 39 | - Update example create_bucket playbook to use shell module 40 | 41 | ## v0.1.9 42 | 43 | - Added Vagrant example for Mac OS X development clusters 44 | 45 | ## v0.2.0 46 | 47 | - Corrected bad references to old role 48 | 49 | ## v0.2.1 50 | 51 | - More Vagrant improvements 52 | - Documentation updates 53 | - Fixed variable names for packages 54 | 55 | ## v0.2.2 56 | 57 | - Update defaults and variables 58 | - Inline docs updates 59 | 60 | ## v0.2.3 61 | 62 | - Fix broken RedHat tasks 63 | 64 | ## v0.2.4 65 | 66 | - Revert previous defaults/variables changes 67 | - Update include path in bucket creation playbook 68 | 69 | ## v0.2.5 70 | 71 | - Add disable THP 72 | - comment out experimental sysctls 73 | 74 | ## v0.2.6 75 | 76 | - Immediate disabling of THP 77 | 78 | ## v0.2.7 79 | 80 | - Update tasks 81 | 82 | ## v0.2.8 83 | 84 | - Correct OS family variables 85 | 86 | ## v0.2.9 87 | 88 | - Update rebalance options for cluster_init playbook 89 | 90 | ## v0.2.10 91 | 92 | - Added wait for nodes to come up before initializing the cluster 93 | 94 | ## v0.2.20 95 | 96 | - Added a cluster_install.yml to example playbooks for installation only 97 | 98 | ## v0.2.21 99 | 100 | - Moved Ubuntu files to Debian 101 | 102 | ## v0.2.22 103 | 104 | - Fixed server RAM quota issue for Vagrant on Mac OS X 105 | 106 | ## v0.3.0 107 | 108 | - Switched Vagrant box source for Ubuntu 12.04 109 | - Updated Ubuntu deb SHA256 sum for refreshed 2.5.1 build 110 | 111 | ## v0.4.0 112 | 113 | - Cleanup tasks for Couchbase Server packages 114 | - Switch to apt module for Ubuntu package installation 115 | 116 | ## v0.5.0 117 | 118 | - Streamlined create_bucket example playbook 119 | - Added a load_bucket example playbook 120 | 121 | ## v0.6.0 122 | 123 | - More documentation updates 124 | 125 | ## v0.7.0 126 | 127 | - Updated to Couchbase Server version 3.0.0 128 | 129 | ## v0.7.1 130 | 131 | - Updated Vagrant box URL 132 | 133 | ## v0.8.0 134 | 135 | - Couchbase Server version 3.0.1 136 | 137 | ## v0.8.1 138 | 139 | - Comment out older version 140 | 141 | ## v0.8.2 142 | 143 | - Update tested versions 144 | - Update private key locations in inventory for Vagrant version 1.7.0 145 | 146 | ## v0.9.0 147 | 148 | - Couchbase Server version 3.0.2 149 | - Couchbase Server version 2.52 150 | - Updated variables 151 | 152 | ## v0.9.1 153 | 154 | - Fix bad package URL 155 | 156 | ## v1.0.0 157 | 158 | - Ansible 1.8 support 159 | - Increased timeout in get_url tasks 160 | - Updated docs 161 | 162 | ## v1.0.1 163 | 164 | - Correct package versions 165 | 166 | ## v1.0.2 167 | 168 | - Update versions 169 | 170 | ## v1.0.3 171 | 172 | - Update docs 173 | - Update versions 174 | 175 | ## v1.0.4 176 | 177 | - Fix package names in CentOS 178 | - Update versions 179 | 180 | ## v1.0.5 181 | 182 | - Added Couchbase Server Community Edition 183 | - Conditionally install Community or Enterprise editions based on 184 | couchbase_server_edition variable setting 185 | - Update software versions 186 | - Update documentation 187 | 188 | ## v1.0.6 189 | 190 | - Increase timeout for package downloads to handle extremely slow internet 191 | 192 | ## v1.0.7 193 | 194 | - Specific distribution support for CentOS, Debian, RHEL, and Ubuntu 195 | - Update version support 196 | - Update documentation 197 | 198 | ## v1.0.8 199 | 200 | - Include Debian and Red Hat hosts 201 | 202 | ## v1.0.9 203 | 204 | - Couchbase Server Enterprise Edition version 3.0.3 205 | - Update README 206 | 207 | ## v1.0.10 208 | 209 | - Specification of hostnames during node-init for >= 3.0.x clusters 210 | - Updated version references 211 | - Corrected meta versions 212 | - Updated .gitignore 213 | - Updated supported versions 214 | - Updated documentation 215 | 216 | ## v1.0.11 217 | 218 | - Updated supported versions 219 | - Updated documentation 220 | 221 | ## v1.0.12 222 | 223 | - Updated supported versions 224 | - Updated documentation 225 | 226 | ## v1.0.13 227 | 228 | - Corrected meta versions 229 | - Updated documentation 230 | 231 | ## v1.0.14 232 | 233 | - Corrected package/SHA 234 | 235 | ## v1.0.15 236 | 237 | - Update timeout for cluster_init 238 | - Use ansible_os_distribution throughout 239 | - Do not attempt to disable THP on Ubuntu 12.04 240 | - Rename couchbase_server_tune_disks to couchbase_server_tune_os 241 | - Add template tags to templates/etc_sysctl.d_couchbase-server.conf.j2 242 | - Rename default bucket to "default" in create_bucket playbook 243 | - Update documentation 244 | 245 | ## v1.0.16 246 | 247 | - create_bucket playbook now creates bucket named default on correct port 248 | - Updated documentation 249 | 250 | ## v1.0.17 251 | 252 | - Wait for all nodes to be listening on 8091 before clustering operations 253 | 254 | ## v1.0.18 255 | 256 | - Update documentation regarding ansible-galaxy, roles path, etc. 257 | 258 | ## v1.0.19 259 | 260 | - Removed rc.local task 261 | - Updated variables 262 | - Updated documentation 263 | 264 | ## v1.0.20 265 | 266 | - Added cluster_collect_info playbook 267 | - Updated cluster_install playbook 268 | - Updated documentation 269 | 270 | ## v1.0.21 271 | 272 | - Added cluster_backup playbook 273 | - Corrected load_bucket playbook 274 | - Updated documentation 275 | 276 | ## v1.0.22 277 | 278 | - Remove cleanup tasks (it's in the tmp dir after all) 279 | - Update playbooks 280 | - One wait instance for REST port only 281 | 282 | ## v1.0.23 283 | 284 | - Perform cluster operations serially 285 | - Add node_failover playbook 286 | - Add cleanup tasks back to post installation 287 | - Add /etc/profile.d/couchbase-server.sh template 288 | - Vagrant hosts convenience script updates 289 | - Updated Vagrantfile 290 | - Updated documentation 291 | 292 | ## v1.0.24 293 | 294 | - Update versions 295 | - Update documentation 296 | - Add retrieve_ssl_cert playbook 297 | - Reduce server RAM quota for Vagrants 298 | 299 | ## v1.0.25 300 | 301 | - Namespace node_role variable 302 | - More granularity in clustering operations in advance of 4.0.0 and 303 | per node service types 304 | - Update Vagrantfile with ANSIBLE_PLAYBOOK environment variable support 305 | - Add couchbase_server_services variable 306 | - Remove unnecessary OS-specific host inventory examples 307 | - Update documentation 308 | 309 | ## v1.0.26 310 | 311 | - Update Vagrantfile 312 | - Update cluster_init playbook 313 | - Add vagrant_hosts example inventory 314 | 315 | ## v1.0.27 316 | 317 | - Update Vagrantfile with additional vars examples 318 | - Update versions 319 | - Update documentation 320 | 321 | ## v1.0.28 322 | 323 | - Update documentation 324 | 325 | ## v1.0.29 326 | 327 | - Update THP task 328 | - Update supported Ansible version to 1.9.2 329 | - Update documentation 330 | 331 | ## v1.0.30 332 | 333 | - Update Vagrantfile 334 | - Update vagrant_hosts 335 | - Update convenience script 336 | 337 | ## v1.0.31 338 | 339 | - Fix Vagrant SSH key path issue 340 | - Prepare firewall rules for use 341 | - Update documentation 342 | 343 | ## v1.0.32 344 | 345 | - Fixed default variables issue 346 | 347 | ## v1.0.33 348 | 349 | - Fix firewall includes 350 | - Fix default varible issue 351 | - Update versions 352 | - Update README_VAGRANT 353 | 354 | ## v1.0.34 355 | 356 | - Include tuning variables 357 | 358 | ## v1.0.35 359 | 360 | - Update preinstall script 361 | - Updated Vagrantfile 362 | - Update Vagrant documentation 363 | - Update cluster init playbook 364 | 365 | ## v1.0.36 366 | 367 | - Updated documentation 368 | 369 | ## v1.0.37 370 | 371 | - Merge PR from Jordan Moore to prefer ansible_fqdn in cluster init steps 372 | - Updated all playbooks to use ansible_fqdn where applicable 373 | - Updated default variables 374 | - Updated playbooks to use new variables 375 | - Added node health verification in create bucket playbook 376 | - Added bucket warmup verification in load bucket playbook 377 | - Added bucket warmup verification in cluster backup playbook 378 | - Fixed variable issue in cluster backup playbook 379 | - Updated documentation 380 | 381 | ## v1.1.0 382 | 383 | - New local package copy option 384 | - Improved cluster init playbook 385 | - Use file module instead of shell module for cleanup tasks 386 | - Updated documentation 387 | - Added troubleshooting section 388 | - Updated supported OS versions in meta 389 | 390 | ## v1.2.0 391 | 392 | - Updated for Couchbase Server version 3.1.0 393 | - Updated documentation 394 | 395 | ## v1.2.1 396 | 397 | - Removed CentOS 2.5.1 package 398 | - Added comments in cluster initialization playbook 399 | - Fixed conditionals in cluster initialization playbook 400 | - Removed serial: 1 from tasks in cluster initialization playbook 401 | - Added failures for node warmup and health to bucket create 402 | and bucket load playbooks 403 | 404 | ## v1.2.2 405 | 406 | - Updated playbooks to reduce some wait times 407 | - Fixed version checking in cluster initialization commands 408 | - Updated documentation 409 | 410 | ## v1.3.0 411 | 412 | - Couchbase Server 4.0.0 413 | - Support for MDS / services 414 | - Maximum supported OS versions (e.g. RHEL 7, Ubuntu 14.04) by default 415 | - Removed all vars/* files and placed their content in defaults/* files 416 | - Updated documentation 417 | 418 | ## v1.3.1 419 | 420 | - Remove unicode from README so role will reimport into Galaxy again 421 | 422 | ## v1.3.2 423 | 424 | - Updated iptables rules; thank you, @Hughjmp 425 | - Moved MDS example host inventory into example_hosts file 426 | - Removed vagrant_hosts_mds file 427 | - Updated documentation 428 | 429 | ## v1.3.3 430 | 431 | - Updated iptables playbooks 432 | - Updated iptables ports 433 | 434 | ## v1.3.4 435 | 436 | - Added .sh extension to preinstall script 437 | - Updated documentation 438 | 439 | ## v1.3.5 440 | 441 | - Updated supported versions 442 | - Updated documentation 443 | 444 | ## v1.3.6 445 | 446 | - Fix short host names 447 | 448 | ## v1.3.7 449 | 450 | - Add Community Edition version 4.0.0 to defaults 451 | - Add version 3.1.1 to defaults 452 | - Remove version 3.0.0 453 | - Remove version 2.5.2 454 | - Update documentation 455 | 456 | ## v1.4.0 457 | 458 | - Couchbase Server version 3.1.2 459 | 460 | ## v1.4.1 461 | 462 | - Install CE 4.0.0 for Ubuntu 14.04 (thanks @SomeoneWeird) 463 | 464 | ## v1.4.2 465 | 466 | - Fixed and renamed node_failover.yml 467 | - Updated versions 468 | 469 | ## v1.5.0 470 | 471 | - Add Couchbase Server Enterprise Edition version 4.1.0 472 | - Add Couchbase Server Developer Preview version 4.1.0 (for community) 473 | 474 | ## v1.5.1 475 | 476 | - Added version 3.1.3 477 | 478 | ## v1.5.2 479 | 480 | - Updated versions 481 | 482 | ## v1.5.3 483 | 484 | - Documentation fixes (thanks @zabullet) 485 | - Update Vagrant documentation 486 | - Add contributors to README 487 | 488 | ## v1.6.0 489 | 490 | - Package file is now downloaded once to local / Ansible host and then 491 | copied to each node to speed up role and avoid excessive bandwidth usage 492 | - Update Vagrantfile 493 | - Update tasks 494 | - Update variables 495 | - Update docs 496 | 497 | ## v1.6.1 498 | 499 | - Corrected tasks variables 500 | 501 | ## v1.6.2 502 | 503 | - Consistent variable names in cluster_init 504 | 505 | ## v1.6.3 506 | 507 | - Corrected Ubuntu tasks variables 508 | 509 | ## v1.6.4 510 | 511 | - cluster_init now ensures data and index paths are present and have correct 512 | permissions (thanks @zabullet) 513 | 514 | ## v1.6.5 515 | 516 | - Update playbooks 517 | - Update main tasks 518 | - Update supported software versions 519 | - Update docs 520 | 521 | ## v1.6.6 522 | 523 | - Include rc.local with THP disable 524 | - Fix disable THP task 525 | 526 | ## v1.6.7 527 | 528 | - Use file module for removal in playbooks 529 | 530 | ## v1.6.8 531 | 532 | - Correct Galaxy meta 533 | 534 | ## v1.6.9 535 | 536 | - Rename role to match GitHub repository name 537 | - Update documentation 538 | 539 | ## v1.7.0 540 | 541 | - Khanify dependencies, YAML, etc. 542 | 543 | ## v1.7.1 544 | 545 | - YAML... how it does it? 546 | 547 | ## v1.7.2 548 | 549 | - Use role_path to help with inclusion of role into other roles 550 | (thanks @franklefebvre) 551 | 552 | ## v1.7.3 553 | 554 | - Use become instead of sudo 555 | - Update minimum Ansible version in meta 556 | - Update supported versions 557 | 558 | ## v1.7.4 559 | 560 | - Ensure MDS services are set via host inventory 561 | - Update Vagrant nodes to 2GB RAM 562 | - Update playbook notes 563 | - Update documentation 564 | 565 | ## v1.7.5 566 | 567 | - Added Couchbase Server Enterprise Edition 3.1.4 568 | - Updated documentation 569 | 570 | ## v1.7.6 571 | 572 | - Added Couchbase Server Enterprise Edition 4.1.1 573 | 574 | ## v1.7.7 575 | 576 | - Fix incorrect SHA sum on Ubuntu version (thanks @gsempe) 577 | - Update contributors 578 | -------------------------------------------------------------------------------- /CONTRIBUTE.md: -------------------------------------------------------------------------------- 1 | ## Contribution 2 | 3 | Issues and pull requests are welcome for this project. Please read and 4 | abide by the [Couchbase Code of Conduct](http://www.couchbase.com/code-of-conduct). 5 | 6 | The preferred repository for issues and pull requests is: 7 | 8 | https://github.com/couchbaselabs/ansible-couchbase-server 9 | 10 | This role was specifically created for use with 11 | [Ansible Galaxy](https://galaxy.ansible.com/), but it also functions 12 | as a standalone role. 13 | 14 | Check out the [Ansible](http://www.ansible.com) and 15 | [Ansible Galaxy](https://galaxy.ansible.com/) websites to learn more and 16 | get `ansible`. 17 | 18 | Once you're ready to go, install this role with: 19 | 20 | ``` 21 | ansible-galaxy install couchbaselabs.couchbase-server 22 | ``` 23 | 24 | There is more information available on using Ansible roles in the 25 | [roles documentation](http://docs.ansible.com/playbooks_roles.html#roles). 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 Couchbase 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Couchbase Server 2 | 3 | .CCCCC CCCCC. 4 | .CCCCCC CCCCCC. 5 | .CCCCCC CCCCCC. 6 | .CCCCCC CCCCCC. 7 | .CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC. 8 | .CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC. 9 | .CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC. 10 | .CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC. 11 | 12 | > **NOTE: This role is experimental and not intended for production use**. 13 | > Feel free to use the role for evaluation, development, or testing, and 14 | > borrow the ideas contained within for your own production role or playbooks. 15 | > As with other Couchbase Labs projects, this is primarily for experimentation. 16 | 17 | [Couchbase Server](http://www.couchbase.com/couchbase-server/overview) is a 18 | high performance NoSQL document database available in Community and 19 | Enterprise editions supported for common operating systems. 20 | 21 | you can use this Ansible role to install Couchbase Server on cluster nodes, 22 | initialize working clusters, create buckets, and load buckets with test 23 | documents with the playbooks included in the `examples` directory. 24 | 25 | ## 3-Node Development Cluster Quick Start with Vagrant 26 | 27 | Follow these steps to deploy a CentOS based, simple 3 node development or 28 | evaluation cluster on a physical host with >= 8GB RAM, using VirtualBox and Vagrant. 29 | 30 | ### If You Have Previously Used Ansible Galaxy 31 | 32 | 1. `ansible-galaxy install couchbaselabs.couchbase-server` 33 | 2. `cd /examples` 34 | 3. `./bin/preinstall.sh` 35 | 4. `vagrant up` 36 | 37 | ### If You Have Not Previously Used Ansible Galaxy 38 | 39 | 1. `mkdir $HOME/ansible_roles` 40 | 2. `echo -e "[defaults]\n\nroles_path = $HOME/ansible_roles" > $HOME/.ansible.cfg` 41 | 2. `ansible-galaxy install couchbaselabs.couchbase-server` 42 | 3. `cd $HOME/ansible_roles/couchbaselabs.couchbase-server/examples` 43 | 4. `./bin/preinstall.sh` 44 | 5. `vagrant up` 45 | 46 | Note that `$ANSIBLE_ROLES_PATH` defaults to `/etc/ansible/roles` or the path 47 | you've specified in `~/.ansible.cfg` for *roles_path*. 48 | 49 | This will install three (3) CentOS 6.5 nodes with 2GB RAM each and cluster 50 | them together. The nodes will be available at 10.1.42.10, 10.1.42.20, and 51 | 10.1.42.30 as defined in the `Vagrantfile`. 52 | 53 | To install Debian based nodes, change the command in step 4 to: 54 | 55 | ``` 56 | BOX_NAME=chef/debian-7.4 vagrant up 57 | ``` 58 | 59 | To install Ubuntu based nodes, change the command in step 4 to: 60 | 61 | ``` 62 | BOX_NAME=ubuntu/trusty64 vagrant up 63 | ``` 64 | 65 | See `examples/README_VAGRANT.md` for more Vagrant cluster based details. 66 | 67 | ## Requirements 68 | 69 | This role functions with the following software: 70 | 71 | * Couchbase Server (versions 3.0.1-4.1.0) 72 | * Ansible (version 1.9.4) 73 | * CentOS (versions 6-7) 74 | * Debian (version 7) 75 | * Ubuntu (versions 12.04-14.04) 76 | 77 | This role does not function with the following software: 78 | 79 | * CentOS 7.2 — [Bug in CentOS prevents operation of Couchbase Server service](https://bugs.centos.org/view.php?id=9906) 80 | 81 | ## Works with Ansible Galaxy 82 | 83 | You can install this role with the `ansible-galaxy` command, and can run it 84 | directly from the git repository. 85 | 86 | You should install it like this: 87 | 88 | ``` 89 | ansible-galaxy install couchbaselabs.couchbase-server 90 | ``` 91 | 92 | Make sure you have write access to `/etc/ansible/roles/` since 93 | that is the default Ansible role installation path, or define your own 94 | Ansible role path by creating a `$HOME/.ansible.cfg` file with these contents: 95 | 96 | ``` 97 | [defaults] 98 | roles_path = 99 | ``` 100 | 101 | Change `` to a directory you have write 102 | access to. 103 | 104 | See the [ansible-galaxy](http://docs.ansible.com/galaxy.html) documentation 105 | for more details. 106 | 107 | ## Role Variables 108 | 109 | In cases where you want simple clusters for development or other 110 | non-production use, the values for Couchbase Server role's default variables 111 | are good as-is. 112 | 113 | Should you need specific performance or otherwise wish to tweak them 114 | for your particular purpose, this section describes all the role variables 115 | for your reference in detail, including their default values. 116 | 117 | ### Default Variables 118 | 119 | | Name | Default | Description | 120 | | ------------------------------------ | ----------------------------------------------------------------------------------------- | --------------------------------------- | 121 | | `couchbase_server_edition` | enterprise | Couchbase Server edition: Community or Enterprise | 122 | | `couchbase_server_admin` | Administrator | Couchbase Server administrator user name | 123 | | `couchbase_server_password` | couchbase |: Couchbase Server administrator user password | 124 | | `couchbase_server_ram` | 3072 | The per server RAM quota specified in megabytes | 125 | | `couchbase_server_admin_port` | 8091 | Administration and web console port | 126 | | `couchbase_server_api_port` | 8092 | Couchbase Server API port | 127 | | `couchbase_server_admin_ssl_port` | 18091 | SSL enabled Couchbase Server REST port | 128 | | `couchbase_server_api_ssl_port` | 18092 | SSL enabled Couchbase Server CAPI port | 129 | | `couchbase_server_internal_ports` | 11209:11211 | Memcached and client ports | 130 | | `couchbase_server_node_data_ports` | 21100:21299 | Distributed Erlang communication ports | 131 | | `couchbase_server_home_path` | /opt/couchbase | Base path to Couchbase Server installation | 132 | | `couchbase_server_bin_path` | /opt/couchbase/bin | Path to Couchbase Server binary utilities | 133 | | `couchbase_server_config_file` | /opt/couchbase/var/lib/couchbase/config/config.dat | Full path to the config.dat file | 134 | | `couchbase_server_filesystem` | EXT4 | Default filesystem for data and index volumes | 135 | | `couchbase_server_mountpoint` | / | Logical volume mountpoint | 136 | | `couchbase_server_partition` | /dev/mapper/VolGroup-lv_root | Logical volume partition | 137 | | `couchbase_server_mount_options` | 'noatime,barrier=0,errors=remount-ro' | Additional mount options | 138 | | `couchbase_server_data_path` | /opt/couchbase/var/lib/couchbase/data | Path to data files | 139 | | `couchbase_server_index_path` | /opt/couchbase/var/lib/couchbase/data | Path to index files | 140 | | `couchbase_server_log_path` | /opt/couchbase/var/lib/couchbase/logs | Path to log files | 141 | | `couchbase_server_cbbackup_path` | /tmp | Path to output of cbbackup on node | 142 | | `couchbase_server_cbcollect_path` | /tmp | Path to cbcollect_info output on node | 143 | | `couchbase_server_tmpdir` | /tmp | System wide TMPDIR for cbcollect_info | 144 | | `couchbase_server_tune_os` | false | Whether to tune OS with optimized settings | 145 | | `couchbase_server_firewall` | false | Whether to use strict firewall rules | 146 | 147 | #### Variable Notes 148 | 149 | * Other Couchbase Server versions: You can comment out the topmost / current 150 | version in the `defaults/*.yml` file for your OS and uncomment a previous 151 | version to have that version installed by default instead. This is also 152 | possible with specific arguments in the `Vagrantfile` as well. 153 | * couchbase_server_local_package: Place the Couchbase Server package you 154 | wish to install into the `files` directory and set this to true to skip 155 | package download. This can greatly speed up the playbook for large clusters 156 | and is useful for cluster nodes without necessary access to directlyy 157 | download the package. 158 | 159 | ### Special Variables 160 | 161 | *Configure the following variables with caution* as they have potential 162 | negative performance implications; you should not use them without knowledge 163 | of the changes they make to the operating system configuration: 164 | 165 | | Name | Default | Description | 166 | | ------------------------------------ | -------- | ---------------------------------------------- | 167 | | `couchbase_server_tune_os` | false | Whether to tune OS with optimized settings | 168 | 169 | ## Multi Dimensional Scaling and New Service Types 170 | 171 | This `examples/cluster_init.yml` playbook now has basic support for 172 | Couchbase Server version 4.x and its new service types. Specifically, you can 173 | now tag a cluster node as providing the following services: 174 | 175 | * data : the standard document data service 176 | * index : the global secondary index (GSI) service 177 | * query : the N1QL query service 178 | 179 | To specify which services a node should be responsible for, add them 180 | to the `couchbase_server_node_services` variable as part of your cluster node 181 | host inventory definition. 182 | 183 | Reference the *cluster_nodes_mds* section of `examples/example_hosts` for 184 | an example of service specification. 185 | 186 | See [Services architecture and multidimensional scaling](http://developer.couchbase.com/documentation/server/4.0/architecture/services-archi-multi-dimensional-scaling.html) for more information about service types. 187 | 188 | ## Examples 189 | 190 | The `examples` directory contains some basic playbooks, host inventory 191 | examples, and Vagrant bits (primarily for development use) 192 | as follows: 193 | 194 | * `cluster_backup.yml` full backup of cluster and retrieval of backup tarball 195 | * `cluster_collect_info.yml` gathers cluster logs with `cbcollect_info` 196 | * `cluster_init.yml` installs Couchbase Server and initializes the cluster 197 | * `cluster_install.yml` prepares OS and installs Couchbase Server 198 | * `create_bucket.yml` creates an example bucket 199 | * `load_bucket.yml` loads sample JSON data into a bucket 200 | * `node_failover.yml` manual failover of cluster node 201 | * `retreive_ssl_cert.yml` retrieve and store node's SSL certificate 202 | * `site.yml` basic role inclusion example 203 | * `example_hosts` example hosts inventory in format required by this project 204 | * `Vagrantfile` example Vagrant development cluster definition 205 | * `vagrant_hosts` default Vagrant hosts inventory file 206 | * `vagrant_hosts_mds` example Vagrant hosts inventory file with MDS 207 | 208 | ### Create Buckets 209 | 210 | The example playbook `create_bucket.yml` for bucket creation works as follows: 211 | 212 | Upon first execution without specifying variable arguments via the `ansible-playbook` extra vars ('-e') option, the playbook will generate a 213 | bucket with the following properties: 214 | 215 | * Bucket name: *default* 216 | * Bucket type: *couchbase* 217 | * Bucket port: *11211* 218 | * Bucket RAM size: 256MB 219 | * Bucket replica number: 1 220 | 221 | If you'd like to create your own buckets, then use the `ansible-playbook` 222 | extra vars ('-e') option and specify values for the 223 | *couchbase_server_bucket_name*, *couchbase_server_bucket_type*, *couchbase_server_bucket_port*, *couchbase_server_bucket_ram*, and *couchbase_server_bucket_replica* variables like so: 224 | 225 | ``` 226 | ansible-playbook -i vagrant_hosts create_bucket.yml \ 227 | -e "couchbase_server_bucket_name=danika couchbase_server_bucket_type=couchbase couchbase_server_bucket_port=11223 couchbase_server_bucket_ram=256 couchbase_server_bucket_replica=2" 228 | ``` 229 | 230 | or perhaps you'd like to make a memcached based bucket? No problem: 231 | 232 | ``` 233 | ansible-playbook -i vagrant_hosts create_bucket.yml \ 234 | -e "b_name=breandon couchbase_server_bucket_type=memcached couchbase_server_bucket_port=11224 couchbase_server_bucket_ram=512 couchbase_server_bucket_replica=0" 235 | ``` 236 | 237 | ## Dependencies 238 | 239 | None 240 | 241 | ## License 242 | 243 | Apache 244 | 245 | ## Author Information 246 | 247 | - Brian Shumate (brian at couchbase.com) 248 | 249 | ## Contributors 250 | 251 | Thanks to these people who have contributed to the role: 252 | 253 | * [ahamidi](https://github.com/ahamidi) 254 | * [cricket007](https://github.com/cricket007) 255 | * [Jonnymcc](https://github.com/Jonnymcc) 256 | * [Hughjmp](https://github.com/Hughjmp) 257 | * [SomeoneWeird](https://github.com/SomeoneWeird) 258 | * [zabullet](https://github.com/zabullet) 259 | * [gsempe](https://github.com/gsempe) 260 | -------------------------------------------------------------------------------- /defaults/CentOS.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: defaults/CentOS.yml - CentOS ansible-couchbase-server defaults 3 | 4 | # This file contains variables used for installing Couchbase software, 5 | # including the following: 6 | # 7 | # * Couchbase Server Enterprise Edition 8 | # * Couchbase Server Community Edition 9 | 10 | ############################################################################# 11 | # 12 | # COUCHBASE SERVER ENTERPRISE EDITION 13 | # 14 | # A listing of available Couchbase Server Enterprise Edition packages and 15 | # their metadata for CentOS and RHEL 16 | # 17 | # Current default installed version is: 18 | # Couchbase Server Enterprise Edition version 4.1.0 19 | # 20 | # Comment out the 4 variables below and uncoment variables for any older 21 | # version that you wish to install or pass them in as --extra-vars to the 22 | # ansible-playbook command. 23 | # 24 | ############################################################################# 25 | 26 | #### CentOS 7 now by default 27 | 28 | couchbase_server_centos_ee_version: 4.1.1 29 | couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos7.x86_64.rpm 30 | couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 31 | couchbase_server_centos_ee_sha256: 057636313e7087adc040b8f0bc2425dfdcae5a0cb2a598b50ce5bdfc67d9325d 32 | 33 | # couchbase_server_centos_ee_version: 4.1.0 34 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos7.x86_64.rpm 35 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 36 | # couchbase_server_centos_ee_sha256: abafebf0821825b470dbbe9b18703646e0a9c64e2df6b118e08d7cc077e4c37e 37 | 38 | # couchbase_server_centos_ee_version: 4.0.0 39 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos7.x86_64.rpm 40 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 41 | # couchbase_server_centos_ee_sha256: 063eb23c6f796fadb0af9b03ea527ad910d3a9e03d9ef4ba6aa100db318f6f5b 42 | 43 | # couchbase_server_centos_ee_version: 3.1.4 44 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos6.x86_64.rpm 45 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 46 | # couchbase_server_centos_ee_sha256: 5126a4319c156884913c75914d100e53e6e08eec0914d5cf69fae3c2e9dc874d 47 | 48 | # couchbase_server_centos_ee_version: 3.1.3 49 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos6.x86_64.rpm 50 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 51 | # couchbase_server_centos_ee_sha256: 53dde4e0fc35d251be4c5006508dd679b77cd8eb685d9ffa992a53d71ab66d94 52 | 53 | # couchbase_server_centos_ee_version: 3.1.2 54 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos6.x86_64.rpm 55 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 56 | # couchbase_server_centos_ee_sha256: 96539a19f9f7cfc7418b01ae9ececf94b09af5d9f925fa531c28f41004f1bcb4 57 | 58 | # couchbase_server_centos_ee_version: 3.1.1 59 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos6.x86_64.rpm 60 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 61 | # couchbase_server_centos_ee_sha256: 46acc5fa9eaa9be733b693c023afb3016f39b36c234b0412e0e3b984ba168baf 62 | 63 | # couchbase_server_centos_ee_version: 3.1.0 64 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos6.x86_64.rpm 65 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 66 | # couchbase_server_centos_ee_sha256: a15b743e891e317b869700f48f61762c917ffa3fabd8b8f389c84ec6dd011fbd 67 | 68 | # couchbase_server_centos_ee_version: 3.0.3 69 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos6.x86_64.rpm 70 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 71 | # couchbase_server_centos_ee_sha256: 1f21843bf0cc86390bc707d7c93bba6e8678dbc0eaf784bb2dc9a6718b46bd04 72 | 73 | # couchbase_server_centos_ee_version: 3.0.2 74 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos6.x86_64.rpm 75 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 76 | # couchbase_server_centos_ee_sha256: 7c678d4fc9207f04996c2a0a0d33df74171813504348fd3f66acf8dd0dc5b106 77 | 78 | # couchbase_server_centos_ee_version: 3.0.1 79 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos6.x86_64.rpm 80 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 81 | # couchbase_server_centos_ee_sha256: 000667d4f1f075cb94e740d7296841233086ad8f704b656a38f583a334359700 82 | 83 | ############################################################################# 84 | # 85 | # COUCHBASE SERVER COMMUNITY EDITION 86 | # 87 | # A listing of available Couchbase Server Community Edition packages and 88 | # their metadata for CentOS and RHEL 89 | # 90 | # Default installed version is currently set to: 91 | # Couchbase Server Community Edition version 4.0.0 92 | # 93 | # Comment out the 4 variables below and uncoment variables for any older 94 | # version that you wish to install or pass them in as --extra-vars to the 95 | # ansible-playbook command. 96 | # 97 | ############################################################################# 98 | 99 | # 4.1.0 Developer Preview 100 | # couchbase_server_centos_ce_version: 4.1.0 101 | # couchbase_server_centos_ce_package: couchbase-server-{{ couchbase_server_centos_ce_version }}-dp-centos7.x86_64.rpm 102 | # couchbase_server_centos_ce_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ce_version }}/{{ couchbase_server_centos_ce_package }} 103 | # couchbase_server_centos_ce_sha256: 97ecbc367af59a67f9ee3a449683c9c1a52fdc3d9576efe2da88e01ea3f67ae6 104 | 105 | couchbase_server_centos_ce_version: 4.0.0 106 | couchbase_server_centos_ce_package: couchbase-server-community-{{ couchbase_server_centos_ce_version }}-centos6.x86_64.rpm 107 | couchbase_server_centos_ce_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ce_version }}/{{ couchbase_server_centos_ce_package }} 108 | couchbase_server_centos_ce_sha256: 73f048e49617095e6a0cb9a82f74578d48b1054e8142fb712eab71395d7b9ce0 109 | 110 | # couchbase_server_centos_ce_version: 3.0.1 111 | # couchbase_server_centos_ce_package: couchbase-server-community-{{ couchbase_server_centos_ce_version }}-centos6.x86_64.rpm 112 | # couchbase_server_centos_ce_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ce_version }}/{{ couchbase_server_centos_ce_package }} 113 | # couchbase_server_centos_ce_sha256: 65fabf18adfbe5136dd700866c479e99f33ba839b6de9973e7878e685102bb28 114 | -------------------------------------------------------------------------------- /defaults/Debian.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: defaults/Debian.yml - Debian ansible-couchbase-server defaults 3 | 4 | # This file contains variables used for installing Couchbase software, 5 | # including the following: 6 | # 7 | # * Couchbase Server Enterprise Edition 8 | # * Couchbase Server Community Edition 9 | 10 | ############################################################################# 11 | # 12 | # COUCHBASE SERVER ENTERPRISE EDITION 13 | # 14 | # A listing of available Couchbase Server Enterprise Edition packages and 15 | # their metadata for Debian 16 | # 17 | # Current default installed version is: 18 | # Couchbase Server Enterprise Edition version 4.1.0 19 | # 20 | # Comment out the 4 variables below and uncoment variables for any older 21 | # version that you wish to install or pass them in as --extra-vars to the 22 | # ansible-playbook command. 23 | # 24 | ############################################################################# 25 | 26 | couchbase_server_debian_ee_version: 4.1.1 27 | couchbase_server_debian_ee_package: couchbase-server-enterprise_{{ couchbase_server_debian_ee_version }}-debian7_amd64.deb 28 | couchbase_server_debian_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_debian_ee_version }}/{{ couchbase_server_debian_ee_package }} 29 | couchbase_server_debian_ee_sha256: 1d084294ae257e2a3592268afedd27d0d31c51b5e5957c178ba571f3e43734ad 30 | 31 | # couchbase_server_debian_ee_version: 4.1.0 32 | # couchbase_server_debian_ee_package: couchbase-server-enterprise_{{ couchbase_server_debian_ee_version }}-debian7_amd64.deb 33 | # couchbase_server_debian_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_debian_ee_version }}/{{ couchbase_server_debian_ee_package }} 34 | # couchbase_server_debian_ee_sha256: 5cd0aa79739ee303bed79b5caa971b9ff71eca7603bbe81ccc4bdd5310ad2035 35 | 36 | # couchbase_server_debian_ee_version: 4.0.0 37 | # couchbase_server_debian_ee_package: couchbase-server-enterprise_{{ couchbase_server_debian_ee_version }}-debian7_amd64.deb 38 | # couchbase_server_debian_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_debian_ee_version }}/{{ couchbase_server_debian_ee_package }} 39 | # couchbase_server_debian_ee_sha256: 7663881917182712d9d5ed64698e2e568148e5a5ca986af36babed7b6d55725e 40 | 41 | # couchbase_server_debian_ee_version: 3.1.4 42 | # couchbase_server_debian_ee_package: couchbase-server-enterprise_{{ couchbase_server_debian_ee_version }}-debian7_amd64.deb 43 | # couchbase_server_debian_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_debian_ee_version }}/{{ couchbase_server_debian_ee_package }} 44 | # couchbase_server_debian_ee_sha256: 8faf7aa829c63e6dd87d5385d0a1007f3dcc1e9107cf1065a3e97eea9fe1fdab 45 | 46 | # couchbase_server_debian_ee_version: 3.1.3 47 | # couchbase_server_debian_ee_package: couchbase-server-enterprise_{{ couchbase_server_debian_ee_version }}-debian7_amd64.deb 48 | # couchbase_server_debian_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_debian_ee_version }}/{{ couchbase_server_debian_ee_package }} 49 | # couchbase_server_debian_ee_sha256: 2d01922f087c26c1613ccc38b8a7929599c1d007983f47429f3fd643815975d2 50 | 51 | # couchbase_server_debian_ee_version: 3.1.2 52 | # couchbase_server_debian_ee_package: couchbase-server-enterprise_{{ couchbase_server_debian_ee_version }}-debian7_amd64.deb 53 | # couchbase_server_debian_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_debian_ee_version }}/{{ couchbase_server_debian_ee_package }} 54 | # couchbase_server_debian_ee_sha256: 1f5061ad443fd612c563afb2cbb3a871513307f74b16045427d9857479c81775 55 | 56 | # couchbase_server_debian_ee_version: 3.1.1 57 | # couchbase_server_debian_ee_package: couchbase-server-enterprise_{{ couchbase_server_debian_ee_version }}-debian7_amd64.deb 58 | # couchbase_server_debian_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_debian_ee_version }}/{{ couchbase_server_debian_ee_package }} 59 | # couchbase_server_debian_ee_sha256: 7258b2c81b6a668679ed8ae1397b712e7a09bf32a087f80aa0041a6c9c76bd6c 60 | 61 | # couchbase_server_debian_ee_version: 3.1.0 62 | # couchbase_server_debian_ee_package: couchbase-server-enterprise_{{ couchbase_server_debian_ee_version }}-debian7_amd64.deb 63 | # couchbase_server_debian_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_debian_ee_version }}/{{ couchbase_server_debian_ee_package }} 64 | # couchbase_server_debian_ee_sha256: 0b53d3f396108f295eb9d66f41e59f740d6c6e8d6e41aed305558eb4f042673f 65 | 66 | # couchbase_server_debian_ee_version: 3.0.3 67 | # couchbase_server_debian_ee_package: couchbase-server-enterprise_{{ couchbase_server_debian_ee_version }}-debian7_amd64.deb 68 | # couchbase_server_debian_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_debian_ee_version }}/{{ couchbase_server_debian_ee_package }} 69 | # couchbase_server_debian_ee_sha256: ac1e4553afeea9004ba2dfba7daec65e576938fb72f549035c3c45525185ec50 70 | 71 | # couchbase_server_debian_ee_version: 3.0.2 72 | # couchbase_server_debian_ee_package: couchbase-server-enterprise_{{ couchbase_server_debian_ee_version }}-debian7_amd64.deb 73 | # couchbase_server_debian_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_debian_ee_version }}/{{ couchbase_server_debian_ee_package }} 74 | # couchbase_server_debian_ee_sha256: e1e23385104d7237b9038b89d610b1a347a643b9d649fcae6158f6ebee915bea 75 | 76 | # couchbase_server_debian_ee_version: 3.0.1 77 | # couchbase_server_debian_ee_package: couchbase-server-enterprise_{{ couchbase_server_debian_ee_version }}-debian7_amd64.deb 78 | # couchbase_server_debian_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_debian_ee_version }}/{{ couchbase_server_debian_ee_package }} 79 | # couchbase_server_debian_ee_sha256: d51d12558bfcff4d95f93337a2b3104b1431dbbcc82a9dfe9ad2bbfda39d2598 80 | 81 | ############################################################################# 82 | # 83 | # COUCHBASE SERVER COMMUNITY EDITION 84 | # 85 | # A listing of available Couchbase Server Community Edition packages and 86 | # their metadata for Ubuntu 87 | # 88 | # Default installed version is currently set to: 89 | # Couchbase Server Community Edition version 4.0.0 90 | # 91 | # Comment out the 4 variables below and uncoment variables for any older 92 | # version that you wish to install or pass them in as --extra-vars to the 93 | # ansible-playbook command. 94 | # 95 | ############################################################################# 96 | 97 | # 4.1.0 Developer Preview 98 | # couchbase_server_debian_ce_version: 4.1.0 99 | # couchbase_server_debian_ce_package: couchbase-server_{{ couchbase_server_debian_ce_version }}-dp-debian7_amd64.deb 100 | # couchbase_server_debian_ce_url: http://packages.couchbase.com/releases/{{ couchbase_server_debian_ce_version }}/{{ couchbase_server_debian_ce_package }} 101 | # couchbase_server_debian_ce_sha256: be371bdfc27820f4f52f26908c8ad69de89a2d181328770bcbb3378537839c3c 102 | 103 | couchbase_server_debian_ce_version: 4.0.0 104 | couchbase_server_debian_ce_package: couchbase-server-community_{{ couchbase_server_debian_ce_version }}-debian7_amd64.deb 105 | couchbase_server_debian_ce_url: http://packages.couchbase.com/releases/{{ couchbase_server_debian_ce_version }}/{{ couchbase_server_debian_ce_package }} 106 | couchbase_server_debian_ce_sha256: 1fb8961e54b0e4a9d1fc2efc925b82054281abf3c520294311d874e66d78cf6e 107 | 108 | # couchbase_server_debian_ce_version: 3.0.1 109 | # couchbase_server_debian_ce_package: couchbase-server-community_{{ couchbase_server_debian_ce_version }}-debian7_amd64.deb 110 | # couchbase_server_debian_ce_url: http://packages.couchbase.com/releases/{{ couchbase_server_debian_ce_version }}/{{ couchbase_server_debian_ce_package }} 111 | # couchbase_server_debian_ce_sha256: 5ee5c017c2292c71ff22620d0bbfcc8939dbbf99db7b7a6f63e5874a1903a470 112 | 113 | -------------------------------------------------------------------------------- /defaults/RedHat.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: defaults/RedHat.yml - RHEL ansible-couchbase-server defaults 3 | 4 | # This file contains variables used for installing Couchbase software, 5 | # including the following: 6 | # 7 | # * Couchbase Server Enterprise Edition 8 | # * Couchbase Server Community Edition 9 | 10 | ############################################################################# 11 | # 12 | # COUCHBASE SERVER ENTERPRISE EDITION 13 | # 14 | # A listing of available Couchbase Server Enterprise Edition packages and 15 | # their metadata for RHEL 16 | # 17 | # Current default installed version is: 18 | # Couchbase Server Enterprise Edition version 4.1.0 19 | # 20 | # Comment out the 4 variables below and uncoment variables for any older 21 | # version that you wish to install or pass them in as --extra-vars to the 22 | # ansible-playbook command. 23 | # 24 | ############################################################################# 25 | 26 | #### RHEL 7 now by default 27 | 28 | couchbase_server_centos_ee_version: 4.1.1 29 | couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos7.x86_64.rpm 30 | couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 31 | couchbase_server_centos_ee_sha256: 057636313e7087adc040b8f0bc2425dfdcae5a0cb2a598b50ce5bdfc67d9325d 32 | 33 | # couchbase_server_centos_ee_version: 4.1.0 34 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos7.x86_64.rpm 35 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 36 | # couchbase_server_centos_ee_sha256: abafebf0821825b470dbbe9b18703646e0a9c64e2df6b118e08d7cc077e4c37e 37 | 38 | # couchbase_server_centos_ee_version: 4.0.0 39 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos7.x86_64.rpm 40 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 41 | # couchbase_server_centos_ee_sha256: 063eb23c6f796fadb0af9b03ea527ad910d3a9e03d9ef4ba6aa100db318f6f5b 42 | 43 | # couchbase_server_centos_ee_version: 3.1.4 44 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos6.x86_64.rpm 45 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 46 | # couchbase_server_centos_ee_sha256: 5126a4319c156884913c75914d100e53e6e08eec0914d5cf69fae3c2e9dc874d 47 | 48 | # couchbase_server_centos_ee_version: 3.1.3 49 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos6.x86_64.rpm 50 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 51 | # couchbase_server_centos_ee_sha256: 53dde4e0fc35d251be4c5006508dd679b77cd8eb685d9ffa992a53d71ab66d94 52 | 53 | # couchbase_server_centos_ee_version: 3.1.2 54 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos6.x86_64.rpm 55 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 56 | # couchbase_server_centos_ee_sha256: 96539a19f9f7cfc7418b01ae9ececf94b09af5d9f925fa531c28f41004f1bcb4 57 | 58 | # couchbase_server_centos_ee_version: 3.1.1 59 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos6.x86_64.rpm 60 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 61 | # couchbase_server_centos_ee_sha256: 46acc5fa9eaa9be733b693c023afb3016f39b36c234b0412e0e3b984ba168baf 62 | 63 | # couchbase_server_centos_ee_version: 3.1.0 64 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos6.x86_64.rpm 65 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 66 | # couchbase_server_centos_ee_sha256: a15b743e891e317b869700f48f61762c917ffa3fabd8b8f389c84ec6dd011fbd 67 | 68 | # couchbase_server_centos_ee_version: 3.0.3 69 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos6.x86_64.rpm 70 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 71 | # couchbase_server_centos_ee_sha256: 1f21843bf0cc86390bc707d7c93bba6e8678dbc0eaf784bb2dc9a6718b46bd04 72 | 73 | # couchbase_server_centos_ee_version: 3.0.2 74 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos6.x86_64.rpm 75 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 76 | # couchbase_server_centos_ee_sha256: 7c678d4fc9207f04996c2a0a0d33df74171813504348fd3f66acf8dd0dc5b106 77 | 78 | # couchbase_server_centos_ee_version: 3.0.1 79 | # couchbase_server_centos_ee_package: couchbase-server-enterprise-{{ couchbase_server_centos_ee_version }}-centos6.x86_64.rpm 80 | # couchbase_server_centos_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ee_version }}/{{ couchbase_server_centos_ee_package }} 81 | # couchbase_server_centos_ee_sha256: 000667d4f1f075cb94e740d7296841233086ad8f704b656a38f583a334359700 82 | 83 | ############################################################################# 84 | # 85 | # COUCHBASE SERVER COMMUNITY EDITION 86 | # 87 | # A listing of available Couchbase Server Community Edition packages and 88 | # their metadata for CentOS and RHEL 89 | # 90 | # Default installed version is currently set to: 91 | # Couchbase Server Community Edition version 4.0.0 92 | # 93 | # Comment out the 4 variables below and uncoment variables for any older 94 | # version that you wish to install or pass them in as --extra-vars to the 95 | # ansible-playbook command. 96 | # 97 | ############################################################################# 98 | 99 | # 4.1.0 Developer Preview 100 | # couchbase_server_centos_ce_version: 4.1.0 101 | # couchbase_server_centos_ce_package: couchbase-server-{{ couchbase_server_centos_ce_version }}-dp-centos7.x86_64.rpm 102 | # couchbase_server_centos_ce_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ce_version }}/{{ couchbase_server_centos_ce_package }} 103 | # couchbase_server_centos_ce_sha256: 97ecbc367af59a67f9ee3a449683c9c1a52fdc3d9576efe2da88e01ea3f67ae6 104 | 105 | couchbase_server_centos_ce_version: 4.0.0 106 | couchbase_server_centos_ce_package: couchbase-server-community-{{ couchbase_server_centos_ce_version }}-centos6.x86_64.rpm 107 | couchbase_server_centos_ce_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ce_version }}/{{ couchbase_server_centos_ce_package }} 108 | couchbase_server_centos_ce_sha256: 73f048e49617095e6a0cb9a82f74578d48b1054e8142fb712eab71395d7b9ce0 109 | 110 | # couchbase_server_centos_ce_version: 3.0.1 111 | # couchbase_server_centos_ce_package: couchbase-server-community-{{ couchbase_server_centos_ce_version }}-centos6.x86_64.rpm 112 | # couchbase_server_centos_ce_url: http://packages.couchbase.com/releases/{{ couchbase_server_centos_ce_version }}/{{ couchbase_server_centos_ce_package }} 113 | # couchbase_server_centos_ce_sha256: 65fabf18adfbe5136dd700866c479e99f33ba839b6de9973e7878e685102bb28 114 | -------------------------------------------------------------------------------- /defaults/Ubuntu.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: defaults/Ubuntu.yml - Ubuntu ansible-couchbase-server defaults 3 | 4 | # This file contains variables used for installing Couchbase software, 5 | # including Couchbase Server and Sync Gateway 6 | 7 | ############################################################################# 8 | # 9 | # COUCHBASE SERVER ENTERPRISE EDITION 10 | # 11 | # A listing of available Couchbase Server Enterprise Edition packages and 12 | # their metadata for Ubuntu 13 | # 14 | # Current default installed version is: 15 | # Couchbase Server Enterprise Edition version 4.1.0 16 | # 17 | # Comment out the 4 variables below and uncoment variables for any older 18 | # version that you wish to install or pass them in as --extra-vars to the 19 | # ansible-playbook command. 20 | # 21 | ############################################################################# 22 | 23 | couchbase_server_ubuntu_ee_version: 4.1.1 24 | couchbase_server_ubuntu_ee_package: couchbase-server-enterprise_{{ couchbase_server_ubuntu_ee_version }}-ubuntu14.04_amd64.deb 25 | couchbase_server_ubuntu_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_ubuntu_ee_version }}/{{ couchbase_server_ubuntu_ee_package }} 26 | couchbase_server_ubuntu_ee_sha256: 65c0ee37f0e6d816257b32a36207ec9b8e81c84112beb657c851f9aacb9b4382 27 | 28 | # couchbase_server_ubuntu_ee_version: 4.1.0 29 | # couchbase_server_ubuntu_ee_package: couchbase-server-enterprise_{{ couchbase_server_ubuntu_ee_version }}-ubuntu14.04_amd64.deb 30 | # couchbase_server_ubuntu_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_ubuntu_ee_version }}/{{ couchbase_server_ubuntu_ee_package }} 31 | # couchbase_server_ubuntu_ee_sha256: beb4ee31b5fea2bfa47c51132d3b29a12e6e2c537b7e5e8dca5d0d50558e4c53 32 | 33 | # couchbase_server_ubuntu_ee_version: 4.0.0 34 | # couchbase_server_ubuntu_ee_package: couchbase-server-enterprise_{{ couchbase_server_ubuntu_ee_version }}-ubuntu14.04_amd64.deb 35 | # couchbase_server_ubuntu_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_ubuntu_ee_version }}/{{ couchbase_server_ubuntu_ee_package }} 36 | # couchbase_server_ubuntu_ee_sha256: c4fad00fe6006a31a82aa4879e7ae502cb9d397339e6d28f352312a0a5be9edd 37 | 38 | # couchbase_server_ubuntu_ee_version: 3.1.4 39 | # couchbase_server_ubuntu_ee_package: couchbase-server-enterprise_{{ couchbase_server_ubuntu_ee_version }}-ubuntu12.04_amd64.deb 40 | # couchbase_server_ubuntu_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_ubuntu_ee_version }}/{{ couchbase_server_ubuntu_ee_package }} 41 | # couchbase_server_ubuntu_ee_sha256: 6461e70f86821ba750e1753ede4299fbb8179c3cb575098b3aba29681d4bddba 42 | 43 | # couchbase_server_ubuntu_ee_version: 3.1.3 44 | # couchbase_server_ubuntu_ee_package: couchbase-server-enterprise_{{ couchbase_server_ubuntu_ee_version }}-ubuntu12.04_amd64.deb 45 | # couchbase_server_ubuntu_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_ubuntu_ee_version }}/{{ couchbase_server_ubuntu_ee_package }} 46 | # couchbase_server_ubuntu_ee_sha256: 3c48f279c8ac1634a881fa75def771b6a7362ed811e5b44e3cc4b6f9597376c2 47 | 48 | # couchbase_server_ubuntu_ee_version: 3.1.2 49 | # couchbase_server_ubuntu_ee_package: couchbase-server-enterprise_{{ couchbase_server_ubuntu_ee_version }}-ubuntu12.04_amd64.deb 50 | # couchbase_server_ubuntu_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_ubuntu_ee_version }}/{{ couchbase_server_ubuntu_ee_package }} 51 | # couchbase_server_ubuntu_ee_sha256: c22bfac46e5288b568e3af0863c1aa86e425354064a1dbcc4d3bf10e82aa4393 52 | 53 | # couchbase_server_ubuntu_ee_version: 3.1.1 54 | # couchbase_server_ubuntu_ee_package: couchbase-server-enterprise_{{ couchbase_server_ubuntu_ee_version }}-ubuntu12.04_amd64.deb 55 | # couchbase_server_ubuntu_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_ubuntu_ee_version }}/{{ couchbase_server_ubuntu_ee_package }} 56 | # couchbase_server_ubuntu_ee_sha256: 7c9d040107efa114a4a8c81de9f22ff3e5f33f7a8a2565a88c89887ca957c329 57 | 58 | # couchbase_server_ubuntu_ee_version: 3.1.0 59 | # couchbase_server_ubuntu_ee_package: couchbase-server-enterprise_{{ couchbase_server_ubuntu_ee_version }}-ubuntu12.04_amd64.deb 60 | # couchbase_server_ubuntu_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_ubuntu_ee_version }}/{{ couchbase_server_ubuntu_ee_package }} 61 | # couchbase_server_ubuntu_ee_sha256: 8eed4c768816ac22f6627d05516fa8a6975571b32b354c4f16185d8654f5bc1c 62 | 63 | # couchbase_server_ubuntu_ee_version: 3.0.3 64 | # couchbase_server_ubuntu_ee_package: couchbase-server-enterprise_{{ couchbase_server_ubuntu_ee_version }}-ubuntu12.04_amd64.deb 65 | # couchbase_server_ubuntu_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_ubuntu_ee_version }}/{{ couchbase_server_ubuntu_ee_package }} 66 | # couchbase_server_ubuntu_ee_sha256: 13e925fa8b806aecd09751bdb7be1f8cfa188ad894e266108e8c44785c08e474 67 | 68 | # couchbase_server_ubuntu_ee_version: 3.0.2 69 | # couchbase_server_ubuntu_ee_package: couchbase-server-enterprise_{{ couchbase_server_ubuntu_ee_version }}-ubuntu12.04_amd64.deb 70 | # couchbase_server_ubuntu_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_ubuntu_ee_version }}/{{ couchbase_server_ubuntu_ee_package }} 71 | # couchbase_server_ubuntu_ee_sha256: 29490c49f4ba5e25fe68db9abe7a78f884a0ea47c7825813b50fd5b9c2bf691c 72 | 73 | # couchbase_server_ubuntu_ee_version: 3.0.1 74 | # couchbase_server_ubuntu_ee_package: couchbase-server-enterprise_{{ couchbase_server_ubuntu_ee_version }}-ubuntu12.04_amd64.deb 75 | # couchbase_server_ubuntu_ee_url: http://packages.couchbase.com/releases/{{ couchbase_server_ubuntu_ee_version }}/{{ couchbase_server_ubuntu_ee_package }} 76 | # couchbase_server_ubuntu_ee_sha256: 6914fb71d7e2fca314b7767f64a49cb45112f487f0d577239459f890a0a69b16 77 | 78 | ############################################################################# 79 | # 80 | # COUCHBASE SERVER COMMUNITY EDITION 81 | # 82 | # A listing of available Couchbase Server Community Edition packages and 83 | # their metadata for Ubuntu 84 | # 85 | # Default installed version is currently set to: 86 | # Couchbase Server Community Edition version 4.0.0 87 | # 88 | # Comment out the 4 variables below and uncoment variables for any older 89 | # version that you wish to install or pass them in as --extra-vars to the 90 | # ansible-playbook command. 91 | # 92 | ############################################################################# 93 | 94 | # 4.1.0 Developer Preview 95 | # couchbase_server_ubuntu_ce_version: 4.1.0 96 | # couchbase_server_ubuntu_ce_package: couchbase-server_{{ couchbase_server_ubuntu_ce_version }}-dp-ubuntu14.04_amd64.deb 97 | # couchbase_server_ubuntu_ce_url: http://packages.couchbase.com/releases/{{ couchbase_server_ubuntu_ce_version }}/{{ couchbase_server_ubuntu_ce_package }} 98 | # couchbase_server_ubuntu_ce_sha256: 6ed9557f1d81d70e4a5559d8235b9cb63e00b156e3173ef0a9b08aa66179ea0f 99 | 100 | couchbase_server_ubuntu_ce_version: 4.0.0 101 | couchbase_server_ubuntu_ce_package: couchbase-server-community_{{ couchbase_server_ubuntu_ce_version }}-ubuntu14.04_amd64.deb 102 | couchbase_server_ubuntu_ce_url: http://packages.couchbase.com/releases/{{ couchbase_server_ubuntu_ce_version }}/{{ couchbase_server_ubuntu_ce_package }} 103 | couchbase_server_ubuntu_ce_sha256: e275717da0c22efb846b397a1ffeaf63a21ec91e4e481efe3b59de0a0d530982 104 | 105 | # couchbase_server_ubuntu_ce_version: 3.0.1 106 | # couchbase_server_ubuntu_ce_package: couchbase-server-community_{{ couchbase_server_ubuntu_ce_version }}-ubuntu12.04_amd64.deb 107 | # couchbase_server_ubuntu_ce_url: http://packages.couchbase.com/releases/{{ couchbase_server_ubuntu_ce_version }}/{{ couchbase_server_ubuntu_ce_package }} 108 | # couchbase_server_ubuntu_ce_sha256: 59efbd8924969f71c9a6b438afea94d974db51607464c55d7a2d527368026150 109 | -------------------------------------------------------------------------------- /defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: defaults/main.yml - Default ansible-couchbase-server variables 3 | 4 | ############################################################################# 5 | # Couchbase Server default variables 6 | # 7 | # couchbase_server_edition: Couchbase Server edition: Community or Enterprise 8 | # couchbase_server_admin: Couchbase Server administrator user name 9 | # couchbase_server_password: Couchbase Server administrator user password 10 | # couchbase_server_ram: The per server RAM quota specified in megabytes 11 | # couchbase_server_admin_port: Administration and web console port 12 | # couchbase_server_epmd_port: Erlang Port Mapper Daemon (EPMD) port 13 | # couchbase_server_api_port: Couchbase Server API port 14 | # couchbase_server_admin_ssl_port: SSL enabled Couchbase Server REST port 15 | # couchbase_server_api_ssl_port: SSL enabled Couchbase Server CAPI port 16 | # couchbase_server_default_bucket The default bucket name 17 | # couchbase_server_internal_ports: Memcached and client ports 18 | # couchbase_server_node_data_ports: Distributed Erlang communication ports 19 | # couchbase_server_sshd_port: Default SSH port 20 | # couchbase_server_home_path: Base path to Couchbase Server installation 21 | # couchbase_server_bin_path: Path to Couchbase Server binary utilities 22 | # couchbase_server_config_file: Full path to the config.dat file 23 | # couchbase_server_filesystem: Default filesystem for data and index volumes 24 | # couchbase_server_mountpoint: Logical volume mountpoint 25 | # couchbase_server_partition: Logical volume partition 26 | # couchbase_server_mount_options: Additional mount options 27 | # couchbase_server_data_path: Path to data files 28 | # couchbase_server_index_path: Path to index files 29 | # couchbase_server_log_path: Path to log files 30 | # couchbase_server_cbbackup_path: Path to store output of cbbackup 31 | # couchbase_server_cbcollect_path: Path to cbcollect_info output 32 | # couchbase_server_tmpdir: System wide TMPDIR for cbcollect_info 33 | # couchbase_server_tune_os: Whether to tune OS with optimized settings 34 | # couchbase_server_firewall: Whether to use strict firewall rules 35 | # 36 | ############################################################################# 37 | 38 | couchbase_server_edition: "enterprise" 39 | couchbase_server_admin: "Administrator" 40 | couchbase_server_password: "couchbase" 41 | couchbase_server_ram: 3072 42 | couchbase_server_admin_port: 8091 43 | couchbase_server_epmd_port: 4369 44 | couchbase_server_admin_ssl_port: 18091 45 | couchbase_server_api_port: 8092 46 | couchbase_server_api_ssl_port: 18092 47 | couchbase_server_default_bucket: default 48 | couchbase_server_internal_ports: "11207:11215" 49 | couchbase_server_node_data_ports: "21100:21299" 50 | couchbase_server_sshd_port: 22 51 | couchbase_server_home_path: "/opt/couchbase" 52 | couchbase_server_bin_path: "{{ couchbase_server_home_path }}/bin" 53 | couchbase_server_config_file: "{{ couchbase_server_home_path }}/var/lib/couchbase/config/config.dat" 54 | couchbase_server_filesystem: "ext4" 55 | couchbase_server_mountpoint: "/" 56 | couchbase_server_partition: "/dev/mapper/VolGroup-lv_root" 57 | couchbase_server_mount_options: "noatime,barrier=0,errors=remount-ro" 58 | couchbase_server_data_path: "{{ couchbase_server_home_path }}/var/lib/couchbase/data" 59 | couchbase_server_index_path: "{{ couchbase_server_home_path }}/var/lib/couchbase/data" 60 | couchbase_server_log_path: "{{ couchbase_server_home_path }}/var/lib/couchbase/logs" 61 | couchbase_server_cbbackup_path: "/opt/couchbase_backups" 62 | couchbase_server_cbcollect_path: "/tmp" 63 | couchbase_server_tmpdir: "/tmp" 64 | couchbase_server_tune_os: false 65 | couchbase_server_firewall: false 66 | couchbase_server_local_package: false 67 | -------------------------------------------------------------------------------- /defaults/tuning.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: defaults/tuning.yml - OS Tuning ansible-couchbase-server variables 3 | 4 | # NB: Change these only when you know what you are doing 5 | 6 | couchbase_server_swappiness: 0 7 | couchbase_server_tcp_rfc1337: 1 8 | couchbase_server_tcp_workaround_signed_windows: 1 9 | couchbase_server_tcp_sack: 1 10 | couchbase_server_tcp_fack: 1 11 | couchbase_server_mtu_probing: 1 12 | couchbase_server_file_max: 524288 13 | couchbase_server_netdev_max_backlog: 300000 14 | couchbase_server_tcp_moderate_rcvbuf: 1 15 | couchbase_server_tcp_congestion_control: htcp 16 | couchbase_server_somaxconn: 40000 17 | couchbase_server_tcp_max_syn_backlog: 40000 18 | couchbase_server_tcp_window_scaling: 1 19 | couchbase_server_tcp_fin_timeout: 15 20 | couchbase_server_tcp_keepalive_intvl: 30 21 | couchbase_server_dirty_bytes: 209715200 22 | couchbase_server_dirty_background_bytes: 104857600 23 | couchbase_server_disk_scheduler: noop 24 | -------------------------------------------------------------------------------- /examples/README_VAGRANT.md: -------------------------------------------------------------------------------- 1 | # Couchbase Server with Ansible 2 | 3 | 4 | .CCCCC CCCCC. 5 | .CCCCCC CCCCCC. 6 | .CCCCCC CCCCCC. 7 | .CCCCCC CCCCCC. 8 | .CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC. 9 | .CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC. 10 | .CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC. 11 | .CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC. 12 | 13 | > **NOTE: This role is experimental and not intended for production use**. 14 | > Feel free to use the role for evaluation, development, or testing, and 15 | > definitely borrow the ideas contained within for your own production role 16 | > or playbooks. As with other Couchbase Labs projects, this is primarily 17 | > for experimentation. 18 | 19 | [Couchbase Server](http://www.couchbase.com/couchbase-server/overview) is a 20 | high performance NoSQL document database available in Community and 21 | Enterprise editions supported for common operating systems. 22 | 23 | This project provides documentation and a collection of scripts to help you 24 | automate the deployment of Couchbase Server Enterprise Edition using 25 | [Ansible](http://www.ansibleworks.com/). These are the instructions for 26 | deploying a development cluster with Vagrant and VirtualBox. 27 | 28 | ## Vagrant Development Cluster 29 | 30 | In some situations deploying a small virtualized cluster on your local 31 | development machine can be handy. This document describes such a deployment 32 | with the following software: 33 | 34 | * [Couchbase Server](http://www.couchbase.com/couchbase-server/overview) 35 | * [VirtualBox](https://www.virtualbox.org/) 36 | * [Vagrant](http://www.vagrantup.com/) with Ansible provisioner and 37 | supporting plugin 38 | * [Ansible](http://www.ansibleworks.com/) 39 | 40 | Each of the 3 virtual machines defined in the included `Vagrantfile` are 41 | configured with 1.5GB RAM, 2 CPU cores, and 2 network interfaces. The first 42 | interface uses NAT and has connection via the host to the outside world. 43 | 44 | The second interface is a private network and is for intra-cluster 45 | communication and to access from the host machine to Couchbase Server's 46 | administration and API ports. 47 | 48 | The Ansible playbooks can then further refine OS configuration, perform 49 | Couchbase Server package download (or copy from host) and installation, 50 | and initialization of the 3 nodes into a ready to use cluster. 51 | 52 | ## Works with Ansible Galaxy 53 | 54 | You can install this role with the `ansible-galaxy` command, and can run it 55 | directly from the git repository. 56 | 57 | You should install it like this: 58 | 59 | ``` 60 | ansible-galaxy install couchbaselabs.couchbase-server 61 | ``` 62 | 63 | Make sure you have write access to `/etc/ansible/roles/` since 64 | that is the default Ansible role installation path, or define your own 65 | Ansible role path by creating a `$HOME/.ansible.cfg` file with these contents: 66 | 67 | ``` 68 | [defaults] 69 | roles_path = PATH_TO_ROLES 70 | ``` 71 | 72 | Change `PATH_TO_ROLES` to a directory that you 73 | have write access to. 74 | 75 | ## Quick Start 76 | 77 | Begin from the top level directory of this project and use the following 78 | 5 steps to get up and running: 79 | 80 | 1. Install [VirtualBox](https://www.virtualbox.org/wiki/Downloads), 81 | [Vagrant](http://downloads.vagrantup.com/), 82 | [vagrant-hosts](https://github.com/adrienthebo/vagrant-hosts), 83 | and [Ansible](http://www.ansibleworks.com/docs/intro_installation.html#latest-releases-via-pip). 84 | 2. Edit `/etc/hosts` or use the included `bin/preinstall.sh` script to add 85 | the following entries to your development system's `/etc/hosts` file: 86 | * 10.1.42.10 cb1.local cb1 87 | * 10.1.42.20 cb2.local cb2 88 | * 10.1.42.30 cb3.local cb3 89 | 3. `cd $PATH_TO_ROLES/couchbaselabs.couchbase-server/examples` 90 | 4. `vagrant up` 91 | 5. Access the cluster at http://cb1:8091 with username **Administrator** 92 | and password **couchbase**. 93 | 94 | This project will install CentOS 7 based cluster nodes by default. If you 95 | prefer, it can also install Ubuntu 14.04 based nodes by changing the command 96 | in step 4 to the following: 97 | 98 | ``` 99 | BOX_NAME="ubuntu/trusty64" vagrant up 100 | ``` 101 | 102 | If you'd like to follow a more detailed installation process with more 103 | explanation of the steps and technologies, see the following sections of 104 | this guide. 105 | 106 | ## Prerequisites 107 | 108 | Before you begin with the steps in this guide, please ensure that you have 109 | the following prerequisites configured and installed. 110 | 111 | ### Networking 112 | 113 | Ensure that your host machine can access the internet so that the required 114 | software downloads as needed. This includes both downloading the prerequisite 115 | software, the VirtualBox operating system image, and Couchbase Server itself. 116 | 117 | You'll also need to resolve the node VM host names to their default IP 118 | addresses. One way to do so is by adding the following lines to the 119 | `/etc/hosts` file on the host machine: 120 | 121 | ``` 122 | 10.1.42.10 cb1.local cb1 123 | 10.1.42.20 cb2.local cb2 124 | 10.1.42.30 cb3.local cb3 125 | ``` 126 | 127 | A convenience script, `bin/preinstall` automates this step and some other 128 | steps for you. 129 | 130 | ### VirtualBox 131 | 132 | VirtualBox is a freely available virtualization product that supports various 133 | operating system guests running in virtual machines on Mac OS X. Download and 134 | install the latest version from the [VirtualBox website](https://www.virtualbox.org/wiki/Downloads) before proceeding with 135 | the rest of the steps in this section. 136 | 137 | ### Vagrant and Plugins 138 | 139 | Vagrant helps automate building complete development environments on Mac OS X 140 | with the notion of *providers* for different deployment targets like 141 | VirtualBox and *provisioners* like Ansible for handling the actual deployment 142 | and provisioning of the virtual machines. 143 | 144 | This guide uses Vagrant along with a supporting plugin to automate the 145 | creation of the VirtualBox machines which we will be using for the 146 | Couchbase Server nodes. 147 | 148 | The plugin used in this project is 149 | [Vagrant hosts](https://github.com/adrienthebo/vagrant-hosts), which adds 150 | hostname information to the `/etc/hosts` file on each virtual machine. This 151 | should happen before the execution of Ansible playbooks so that Ansible will 152 | function properly over SSH. 153 | 154 | Visit the Vagrant [downloads page](http://downloads.vagrantup.com/) to get the 155 | appropriate version, and proceed with installation of the package. After you 156 | have installed Vagrant, open a terminal and execute the following shell 157 | commands to install the supporting plugins: 158 | 159 | ``` 160 | vagrant plugin install vagrant-hosts 161 | ``` 162 | 163 | These commands should return success messages; if the commands are successful, 164 | you can continue with the rest of the steps in this guide. 165 | 166 | ### Ansible 167 | 168 | Install Ansible for Mac OS X using `pip` based on the 169 | [installation documentation](http://www.ansibleworks.com/docs/intro_installation.html#latest-releases-via-pip). The steps are simple: 170 | 171 | ``` 172 | sudo easy_install pip 173 | sudo pip install ansible 174 | ``` 175 | 176 | ## Bootstrap the Cluster 177 | 178 | Now it's time for bootstrapping the Couchbase Server cluster. 179 | 180 | There are some environment variables which you set to alter basic details 181 | about the Vagrant based setup; the defaults are in parentheses: 182 | 183 | * ANSIBLE_PLAYBOOK (cluster_init.yml) playbook executed by Ansible provisioner 184 | * BOX_MEM (1536) specifies virtual machine RAM in megabytes 185 | * BOX_NAME (ubuntu/trusty64) specifies name of the Vagrant box to use 186 | * CLUSTER_HOSTS (vagrant_hosts) specifies Ansible hosts inventory file 187 | 188 | Open a terminal, change into the *examples* subdirectory of this role's 189 | root directory and execute the Ansible playbook: 190 | 191 | ``` 192 | cd $ROLESPATH/couchbaselabs.couchbase-server/examples 193 | vagrant up 194 | ``` 195 | 196 | Yep, that's all there is to it. 197 | 198 | One command and a bit of patience while Vagrant and Ansible work their magic. 199 | 200 | If bootstrapping a cluster for the first time, you will be prompted to accept 201 | the host key information for each node VM by ssh; be sure to answer **yes** 202 | to these prompts. 203 | 204 | ### Debian 205 | 206 | This project will install CentOS 7 based cluster nodes by default. If you 207 | prefer, you can install Debian 7 based nodes by changing the 208 | `vagrant up` command to the following: 209 | 210 | ``` 211 | BOX_NAME="debian/wheezy64" vagrant up 212 | ``` 213 | 214 | ### Ubuntu 215 | 216 | By default, this project will install CentOS 7 based cluster nodes. If you 217 | prefer, you can install Ubuntu 14.04 based nodes by changing the 218 | `vagrant up` command to the following: 219 | 220 | ``` 221 | BOX_NAME="ubuntu/trusty64" vagrant up 222 | ``` 223 | 224 | ## Give it a Try 225 | 226 | Once the Ansible playbooks complete without error, you can open a browser and 227 | access the primary Couchbase Server cluster node at the following URL: 228 | 229 | ``` 230 | http://cb1:8091 231 | ``` 232 | 233 | The administrator username and password as configured by this project 234 | are: 235 | 236 | * Username: **Administrator** 237 | * Password: **couchbase** 238 | 239 | Once you've logged in and verified that the cluster is available, you're now 240 | ready to create buckets and begin using your new Couchbase Server development 241 | cluster. 242 | 243 | ### Other Operations 244 | 245 | While the basic instructions for getting started do a fair bit of work, you 246 | can run the `cluster_init.yml` playbook to perform full cluster initialization. 247 | 248 | You can also run a subset of the tasks independently through Ansible's tag 249 | support; here is a list of available tags by role: 250 | 251 | **bootstrap** 252 | 253 | * *network* : Network hostname 254 | * *system_packages* : Install any required system packages 255 | * *system_tuning* : Set disk scheduler specified in `defaults/tuning.yml` 256 | for the data and index volumes, disable Transparent Huge Pages (THP), and 257 | other system tuning 258 | 259 | **couchbase-server** 260 | 261 | * *installation* : Download and install the Couchbase Server package 262 | * *network* : Couchbase Server specific firewall settings 263 | * *service* : Ensure that the starting of Couchbase Server service 264 | 265 | Here are some examples of tag usage: 266 | 267 | Install required system packages, such as *libselinux-python* on CentOS: 268 | 269 | ``` 270 | ansible-playbook -i vagrant_hosts cluster_install.yml --tags "system_packages" 271 | ``` 272 | 273 | Set the disk scheduler specified in `linux/group_vars/all` for the data 274 | and index volumes, disable THP, and perform other system tuning: 275 | 276 | ``` 277 | ansible-playbook -i vagrant_hosts cluster_install.yml --tags "system_tuning" 278 | ``` 279 | 280 | Download and install the version of Couchbase Server specified in either 281 | `defaults/main.yml` or `vars/main.yml` for the Linux distribution in use: 282 | 283 | ``` 284 | ansible-playbook -i vagrant_hosts cluster_install.yml --tags "installation" 285 | ``` 286 | 287 | You can also combine tags, as in the following example, which will perform 288 | the system tuning and installation tasks: 289 | 290 | ``` 291 | ansible-playbook -i vagrant_hosts cluster_install.yml \ 292 | --tags "system_tuning, installation" 293 | ``` 294 | ## Examples 295 | 296 | The `examples` directory contains some basic playbooks, host inventory 297 | examples, and Vagrant bits as follows: 298 | 299 | * `cluster_backup.yml` full backup of cluster and retrieval of backup tarball 300 | * `cluster_collect_info.yml` gathers cluster logs with `cbcollect_info` 301 | * `cluster_init.yml` installs Couchbase Server and initializes the cluster 302 | * `cluster_install.yml` prepares OS and installs Couchbase Server 303 | * `create_bucket.yml` creates an example bucket 304 | * `example_hosts` an example hosts inventory file 305 | * `failover_node.yml` manual failover of cluster node 306 | * `load_bucket.yml` loads sample JSON data into a bucket 307 | * `retreive_ssl_cert.yml` retrieve and store node's SSL certificate 308 | * `site.yml` basic role inclusion example 309 | * `vagrant_hosts` default Vagrant hosts inventory file 310 | * `Vagrantfile` example Vagrant development cluster definition 311 | 312 | ### Create Bucket 313 | 314 | The example playbook `create_bucket.yml` for bucket creation works as follows: 315 | 316 | Upon first execution without specifying variable arguments via the 317 | `ansible-playbook` extra vars ('-e') option, the playbook will generate a 318 | bucket with the following properties: 319 | 320 | * Bucket name: *default* 321 | * Bucket type: *couchbase* 322 | * Bucket port: *11211* 323 | * Bucket RAM size: 256MB 324 | * Bucket replica number: 1 325 | 326 | If you'd like to create your own buckets, then use the `ansible-playbook` 327 | extra vars ('-e') option and specify values for the 328 | *couchbase_server_bucket_name*, *couchbase_server_bucket_type_type*, *couchbase_server_bucket_port*, *couchbase_server_bucket_ram*, and *couchbase_server_bucket_replica* variables like so: 329 | 330 | ``` 331 | ansible-playbook -i vagrant_hosts create_bucket.yml \ 332 | -e "couchbase_server_bucket_name=danika couchbase_server_bucket_type_type=couchbase couchbase_server_bucket_port=11223 couchbase_server_bucket_ram=256 couchbase_server_bucket_replica=2" 333 | ``` 334 | 335 | or perhaps you'd like to make a memcached based bucket? No problem: 336 | 337 | ``` 338 | ansible-playbook -i vagrant_hosts create_bucket.yml \ 339 | -e "couchbase_server_bucket_name=breandon couchbase_server_bucket_type_type=memcached couchbase_server_bucket_port=11224 couchbase_server_bucket_ram=512 couchbase_server_bucket_replica=0" 340 | ``` 341 | 342 | ## Notes 343 | 344 | 0. This project functions with the following software versions: 345 | * Ansible version 2.0.0.1 346 | * VirtualBox version 5.0.10 347 | * Vagrant version 1.8.1 348 | * Vagrant Hosts version 2.6.1 349 | 1. This project uses CentOS 7 and Ubuntu 14.04 by default as these are 350 | among the supported major versions of platforms which listed on the 351 | Couchbase Server package downloads page 352 | 2. The `bin/preinstall` shell script performs the following actions for you: 353 | * Adds each node's host information to the host machine's `/etc/hosts` 354 | * Ensures the correct permissions on Vagrant SSH private key 355 | * Optionally installs the Vagrant hosts plugin 356 | 3. Review possible operating system tuning settings in the following files: 357 | * `roles/couchbase-server/templates/etc_sysctl.d_couchbase-server.conf.j2` 358 | * `roles/couchbase-server/templates/iptables.j2` 359 | 360 | ## Variable Notes 361 | 362 | * couchbase_server_local_package: Place the Couchbase Server package you 363 | wish to install into the `files` directory and set this to true to skip 364 | package download. This can greatly speed up the playbook for large clusters 365 | and is useful for cluster nodes without necessary access to directlyy 366 | download the package. Add this variable to `ansible.extra_vars` in your 367 | `Vagrantfile` to enforce it. 368 | 369 | ## Troubleshooting 370 | 371 | ### SSH Error: Host key verification failed. 372 | 373 | You could experience an error like the following, when executing playbooks 374 | against an already deployed cluster: 375 | 376 | ``` 377 | PLAY [primary] **************************************************************** 378 | 379 | GATHERING FACTS *************************************************************** 380 | fatal: [cb1.local] => SSH Error: Host key verification failed. 381 | while connecting to 10.1.42.10:22 382 | It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue. 383 | ``` 384 | 385 | This is often the result of installing new Vagrant VMs but persisting the 386 | previous VMs host fingerprint in `.ssh/known_hosts`. You can edit the file 387 | and remove the offending entry (`cb1.local` in this case) from the file, and 388 | execute the playbook again. 389 | 390 | ## References 391 | 392 | 1. http://www.couchbase.com/couchbase-server/overview 393 | 2. http://www.ansibleworks.com/ 394 | 3. http://www.vagrantup.com/ 395 | 4. https://www.virtualbox.org/ 396 | 5. https://github.com/adrienthebo/vagrant-hosts 397 | -------------------------------------------------------------------------------- /examples/Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | # Vagrantfile for bootstrapping a development Couchbase Server cluster with 5 | # VirtualBox provider and Ansible provisioner 6 | 7 | ANSIBLE_PLAYBOOK = ENV['ANSIBLE_PLAYBOOK'] || "cluster_init.yml" 8 | VAGRANTFILE_API_VERSION = "2" 9 | BOX_MEM = ENV['BOX_MEM'] || "2048" 10 | BOX_NAME = ENV['BOX_NAME'] || "centos/7" 11 | CLUSTER_HOSTS = ENV['CLUSTER_HOSTS'] || "vagrant_hosts" 12 | 13 | Vagrant.require_version ">= 1.5.0" 14 | 15 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 16 | 17 | # Configure 3 Couchbase Server nodes 18 | config.vm.define :cb1 do |cb1_config| 19 | cb1_config.vm.box = BOX_NAME 20 | cb1_config.vm.network :private_network, ip: "10.1.42.10" 21 | cb1_config.vm.hostname = "cb1.local" 22 | cb1_config.ssh.forward_agent = true 23 | cb1_config.vm.provider "virtualbox" do |v| 24 | v.name = "couchbase-server-cb1" 25 | v.customize ["modifyvm", :id, "--memory", BOX_MEM] 26 | v.customize ["modifyvm", :id, "--ioapic", "on"] 27 | v.customize ["modifyvm", :id, "--cpus", "2"] 28 | v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] 29 | v.customize ["modifyvm", :id, "--natdnsproxy1", "on"] 30 | end 31 | cb1_config.vm.provision :hosts do |provisioner| 32 | provisioner.add_host '10.1.42.10', ['cb1.local'] 33 | provisioner.add_host '10.1.42.20', ['cb2.local'] 34 | provisioner.add_host '10.1.42.30', ['cb3.local'] 35 | end 36 | end 37 | config.vm.define :cb2 do |cb2_config| 38 | cb2_config.vm.box = BOX_NAME 39 | cb2_config.vm.network :private_network, ip: "10.1.42.20" 40 | cb2_config.vm.hostname = "cb2.local" 41 | cb2_config.ssh.forward_agent = true 42 | cb2_config.vm.provider "virtualbox" do |v| 43 | v.name = "couchbase-server-cb2" 44 | v.customize ["modifyvm", :id, "--memory", BOX_MEM] 45 | v.customize ["modifyvm", :id, "--ioapic", "on"] 46 | v.customize ["modifyvm", :id, "--cpus", "2"] 47 | v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] 48 | v.customize ["modifyvm", :id, "--natdnsproxy1", "on"] 49 | end 50 | cb2_config.vm.provision :hosts do |provisioner| 51 | provisioner.add_host '10.1.42.10', ['cb1.local'] 52 | provisioner.add_host '10.1.42.20', ['cb2.local'] 53 | provisioner.add_host '10.1.42.30', ['cb3.local'] 54 | end 55 | end 56 | config.vm.define :cb3 do |cb3_config| 57 | cb3_config.vm.box = BOX_NAME 58 | cb3_config.vm.network :private_network, ip: "10.1.42.30" 59 | cb3_config.vm.hostname = "cb3.local" 60 | cb3_config.ssh.forward_agent = true 61 | cb3_config.vm.provider "virtualbox" do |v| 62 | v.name = "couchbase-server-cb3" 63 | v.customize ["modifyvm", :id, "--memory", BOX_MEM] 64 | v.customize ["modifyvm", :id, "--ioapic", "on"] 65 | v.customize ["modifyvm", :id, "--cpus", "2"] 66 | v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] 67 | v.customize ["modifyvm", :id, "--natdnsproxy1", "on"] 68 | end 69 | cb3_config.vm.provision :hosts do |provisioner| 70 | provisioner.add_host '10.1.42.10', ['cb1.local'] 71 | provisioner.add_host '10.1.42.20', ['cb2.local'] 72 | provisioner.add_host '10.1.42.30', ['cb3.local'] 73 | end 74 | # Bit of a hack since VirtualBox does not support parallel provisioning 75 | cb3_config.vm.provision :ansible do |ansible| 76 | ansible.inventory_path = CLUSTER_HOSTS 77 | # Extra Ansible variables can be defined here 78 | ansible.extra_vars = { 79 | couchbase_server_ram: "1190", 80 | # Example variable overrides which will get passed in the same as 81 | # `ansible-playbook --extra-vars` 82 | # couchbase_server_local_package: true, 83 | # couchbase_server_debian_ee_version: "", 84 | # couchbase_server_debian_ee_package: "", 85 | # couchbase_server_debian_ee_url: "", 86 | # couchbase_server_debian_ee_sha256: "", 87 | } 88 | ansible.playbook = ANSIBLE_PLAYBOOK 89 | ansible.limit = "all" 90 | end 91 | end 92 | end 93 | -------------------------------------------------------------------------------- /examples/bin/preinstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # File: examples/bin/preinstall.sh - convenience script to add 4 | # Couchbase Server VM node host information to /etc/hosts for Vagrant 5 | 6 | cb1="10\.1\.42\.10" 7 | txtblk='\e[0;30m' # Black - Regular 8 | txtred='\e[0;31m' # Red 9 | txtgrn='\e[0;32m' # Green 10 | txtylw='\e[0;33m' # Yellow 11 | txtblu='\e[0;34m' # Blue 12 | txtpur='\e[0;35m' # Purple 13 | txtcyn='\e[0;36m' # Cyan 14 | txtwht='\e[0;37m' # White 15 | bldblk='\e[1;30m' # Black - Bold 16 | bldred='\e[1;31m' # Red 17 | bldgrn='\e[1;32m' # Green 18 | bldylw='\e[1;33m' # Yellow 19 | bldblu='\e[1;34m' # Blue 20 | bldpur='\e[1;35m' # Purple 21 | bldcyn='\e[1;36m' # Cyan 22 | bldwht='\e[1;37m' # White 23 | unkblk='\e[4;30m' # Black - Underline 24 | undred='\e[4;31m' # Red 25 | undgrn='\e[4;32m' # Green 26 | undylw='\e[4;33m' # Yellow 27 | undblu='\e[4;34m' # Blue 28 | undpur='\e[4;35m' # Purple 29 | undcyn='\e[4;36m' # Cyan 30 | undwht='\e[4;37m' # White 31 | bakblk='\e[40m' # Black - Background 32 | bakred='\e[41m' # Red 33 | bakgrn='\e[42m' # Green 34 | bakylw='\e[43m' # Yellow 35 | bakblu='\e[44m' # Blue 36 | bakpur='\e[45m' # Purple 37 | bakcyn='\e[46m' # Cyan 38 | bakwht='\e[47m' # White 39 | txtrst='\e[0m' # Text Reset 40 | 41 | # Log stuff 42 | function logmsg { 43 | msgtype="$1" 44 | msgtxt="$2" 45 | case "${msgtype}" in 46 | greeting) 47 | printf "🌞 ${txtylw}${msgtxt}\n" 48 | ;; 49 | info) 50 | printf "💬 ${txtwht}${msgtxt}\n" 51 | ;; 52 | success) 53 | printf "✅ ${txtgrn}${msgtxt}\n" 54 | ;; 55 | notice) 56 | printf "🚩 ${txtylw}${msgtxt}\n" 57 | ;; 58 | alert) 59 | printf "⛔️ ${txtred}${msgtxt}\n" >&2 60 | ;; 61 | *) 62 | printf "⁉️ ${txtwht}${msgtxt}\n" >&2 63 | ;; 64 | esac 65 | } 66 | 67 | # Check if sudo will need password 68 | function sudocheck { 69 | logmsg info "Enter your user account password for sudo if prompted." 70 | sudo true 71 | } 72 | 73 | # Add hosts entries if necessary 74 | function add_hosts { 75 | if grep $cb1 /etc/hosts > /dev/null 2>&1; then 76 | logmsg success "Couchbase Server VM node information present in /etc/hosts" 77 | else 78 | sudocheck 79 | sudo sh -c "echo '# Couchbase Server Vagrant virtual machine hosts 80 | 10.1.42.10 cb1.local cb1 81 | 10.1.42.20 cb2.local cb2 82 | 10.1.42.30 cb3.local cb3 83 | ' >> /etc/hosts" 84 | logmsg success "Couchbase Server node host information added to /etc/hosts" 85 | fi 86 | } 87 | 88 | # Install Vagrant Hosts plugin if necessary 89 | function vagrant_hosts_plugin { 90 | if vagrant plugin list | grep vagrant-hosts > /dev/null 2>&1; then 91 | logmsg success "Vagrant Hosts plugin is installed" 92 | else 93 | vagrant plugin install vagrant-hosts > /dev/null 2>&1 94 | logmsg success "Installed Vagrant Hosts plugin" 95 | fi 96 | } 97 | 98 | add_hosts 99 | vagrant_hosts_plugin 100 | -------------------------------------------------------------------------------- /examples/cluster_backup.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: cluster_backup.yml 3 | # Ansible playbook to grab a full cluster backup from the specified 4 | # Couchbase Server cluster with cbbackup and save as a tarball in 5 | # $PWD/var/couchbase_backups/ 6 | 7 | - hosts: cluster_nodes 8 | become: yes 9 | become_user: root 10 | vars: 11 | couchbase_server_primary_node: "{{hostvars[groups['primary'][0]]['inventory_hostname']}}" 12 | vars_files: 13 | - ../defaults/main.yml 14 | tasks: 15 | - name: Create cluster grouping 16 | group_by: key={{ couchbase_server_node_role }} 17 | 18 | - hosts: primary 19 | gather_facts: False 20 | become: yes 21 | become_user: root 22 | vars: 23 | couchbase_server_primary_node: "{{hostvars[groups['primary'][0]]['inventory_hostname']}}" 24 | vars_files: 25 | - ../defaults/main.yml 26 | tasks: 27 | 28 | - name: Ensure backup target exists 29 | file: "path={{ couchbase_server_cbbackup_path }} state=directory" 30 | 31 | - name: Verify bucket warmup 32 | shell: "{{ couchbase_server_bin_path }}/cbstats localhost:11210 warmup | awk '/ep_warmup_state:/ {print $2}'" 33 | register: couchbase_server_warmup 34 | 35 | - name: Execute cbbackup 36 | shell: "{{ couchbase_server_bin_path }}/cbbackup -m full http://{{ ansible_fqdn }}:{{ couchbase_server_admin_port }} {{ couchbase_server_cbbackup_path }}/{{ ansible_hostname }}" 37 | when: couchbase_server_warmup['stdout'] == "done" 38 | 39 | - name: Create backup archive 40 | shell: "tar zcf {{ couchbase_server_cbbackup_path }}/{{ ansible_hostname }}.tgz {{ couchbase_server_cbbackup_path }}/{{ ansible_hostname }}" 41 | 42 | - name: Retrieve backup archive 43 | fetch: "src={{ couchbase_server_cbbackup_path }}/{{ ansible_hostname }}.tgz dest=var/couchbase_backups/{{ ansible_hostname }}.tgz flat=yes fail_on_missing=yes validate_checksum=yes" 44 | 45 | - name: Cleanup 46 | file: "path={{ couchbase_server_cbbackup_path }}/{{ ansible_hostname }} state=absent" 47 | -------------------------------------------------------------------------------- /examples/cluster_collect_info.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: cluster_collect_info.yml 3 | # Ansible playbook to grab diagnostic & logging information from 4 | # the specified Couchbase Server cluster nodes with cbcollect_info 5 | 6 | - hosts: cluster_nodes 7 | become: yes 8 | become_user: root 9 | vars_files: 10 | - ../defaults/main.yml 11 | 12 | tasks: 13 | 14 | - name: Execute cbcollect_info 15 | shell: "TMPDIR={{ couchbase_server_tmpdir }} {{ couchbase_server_bin_path }}/cbcollect_info {{ couchbase_server_cbcollect_path }}/{{ ansible_hostname }}.zip" 16 | 17 | - name: Gather logs 18 | fetch: "src={{ couchbase_server_cbcollect_path }}/{{ ansible_hostname }}.zip dest=var/cbcollect_info/{{ ansible_hostname }}.zip flat=yes" 19 | 20 | - name: Cleanup 21 | file: "path={{ couchbase_server_cbcollect_path }}/{{ ansible_hostname }}.zip state=absent" 22 | -------------------------------------------------------------------------------- /examples/cluster_init.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: cluster_init.yml 3 | # Example Ansible playbook to initialize a new Couchbase Server cluster 4 | 5 | - hosts: cluster_nodes 6 | become: yes 7 | become_user: root 8 | tasks: 9 | 10 | - name: Create cluster grouping 11 | group_by: key={{ couchbase_server_node_role }} 12 | 13 | - hosts: cluster_nodes 14 | become: yes 15 | become_user: root 16 | roles: 17 | - couchbaselabs.couchbase-server 18 | tasks: 19 | 20 | - name: Make sure index directory exists 21 | file: path={{ couchbase_server_index_path }} state=directory owner=couchbase group=couchbase mode=0770 22 | 23 | - name: Make sure data directory exists 24 | file: path={{ couchbase_server_data_path }} state=directory owner=couchbase group=couchbase mode=0770 25 | 26 | - name: Couchbase Server Service 27 | service: name=couchbase-server state=started 28 | 29 | ############################################################################# 30 | #### Initialize primary cluster node #### 31 | ############################################################################# 32 | 33 | - hosts: primary 34 | become: yes 35 | become_user: root 36 | gather_facts: False 37 | vars_files: 38 | - ../defaults/main.yml 39 | vars: 40 | couchbase_server_primary_node: "{{hostvars[groups['primary'][0]]['ansible_fqdn']}}" 41 | tasks: 42 | 43 | - name: Get major version 44 | shell: cat /opt/couchbase/VERSION.txt | cut -d '.' -f1 45 | register: cb_major_version 46 | 47 | - name: Wait for Admin 48 | wait_for: "port={{ couchbase_server_admin_port }} delay=2" 49 | 50 | - name: Initialize primary node 51 | shell: "{{ couchbase_server_bin_path }}/couchbase-cli node-init -c {{ couchbase_server_primary_node }}:{{ couchbase_server_admin_port }} --user={{ couchbase_server_admin }} --password={{ couchbase_server_password }} --cluster-init-username={{ couchbase_server_admin }} --node-init-hostname={{ ansible_fqdn }} --node-init-data-path={{ couchbase_server_data_path }} --node-init-index-path={{ couchbase_server_index_path }}" 52 | when: cb_major_version['stdout'] != "2" 53 | 54 | - name: Wait for Admin 55 | wait_for: "port={{ couchbase_server_admin_port }} delay=2" 56 | 57 | - name: Configure cluster settings 58 | shell: "{{ couchbase_server_bin_path }}/couchbase-cli cluster-init -c {{ couchbase_server_primary_node }}:{{ couchbase_server_admin_port }} --user={{ couchbase_server_admin }} --password={{ couchbase_server_password }} --cluster-init-username={{ couchbase_server_admin }} --cluster-init-password={{ couchbase_server_password }} --cluster-init-port={{couchbase_server_admin_port}} --cluster-init-ramsize={{ couchbase_server_ram }}" 59 | when: cb_major_version['stdout'] != "4" 60 | 61 | - name: Configure cluster settings 62 | shell: "{{ couchbase_server_bin_path }}/couchbase-cli cluster-init -c {{ couchbase_server_primary_node }}:{{ couchbase_server_admin_port }} --user={{ couchbase_server_admin }} --password={{ couchbase_server_password }} --cluster-init-username={{ couchbase_server_admin }} --cluster-init-password={{ couchbase_server_password }} --cluster-init-port={{couchbase_server_admin_port}} --cluster-init-ramsize={{ couchbase_server_ram }} --services={{ couchbase_server_node_services }}" 63 | when: cb_major_version['stdout'] == "4" 64 | 65 | ############################################################################# 66 | #### Initialize additional cluster nodes #### 67 | ############################################################################# 68 | 69 | - hosts: additional 70 | become: yes 71 | become_user: root 72 | gather_facts: False 73 | vars_files: 74 | - ../defaults/main.yml 75 | tasks: 76 | 77 | # - name: Get major version 78 | # shell: cat /opt/couchbase/VERSION.txt | cut -d '.' -f1 79 | # register: cb_major_version 80 | 81 | - name: Wait for Admin 82 | wait_for: "port={{ couchbase_server_admin_port }} delay=2" 83 | 84 | - name: Get major version 85 | shell: cat /opt/couchbase/VERSION.txt | cut -d '.' -f1 86 | register: cb_major_version 87 | 88 | - name: Initialize additional node 89 | shell: "{{ couchbase_server_bin_path }}/couchbase-cli node-init -c {{ ansible_fqdn }}:{{ couchbase_server_admin_port }} --user={{ couchbase_server_admin }} --password={{ couchbase_server_password }} --cluster-init-username={{ couchbase_server_admin }} --node-init-hostname={{ ansible_fqdn }} --node-init-data-path={{ couchbase_server_data_path }} --node-init-index-path={{ couchbase_server_index_path }}" 90 | when: cb_major_version['stdout'] != "2" 91 | 92 | ############################################################################# 93 | #### Join additional nodes to the cluster and rebalance #### 94 | ############################################################################# 95 | 96 | - hosts: primary 97 | become: yes 98 | become_user: root 99 | vars_files: 100 | - ../defaults/main.yml 101 | vars: 102 | couchbase_server_primary_node: "{{hostvars[groups['primary'][0]]['ansible_fqdn']}}" 103 | tasks: 104 | 105 | - name: Create cluster grouping 106 | group_by: key={{ couchbase_server_node_role }} 107 | 108 | - name: Get major version 109 | shell: cat /opt/couchbase/VERSION.txt | cut -d '.' -f1 110 | register: cb_major_version 111 | 112 | - name: Join additional cluster nodes 113 | shell: "{{ couchbase_server_bin_path }}/couchbase-cli server-add -c {{ couchbase_server_primary_node }}:{{ couchbase_server_admin_port }} --user={{ couchbase_server_admin }} --password={{ couchbase_server_password }} --server-add={{hostvars[[item][0]]['inventory_hostname']}}:{{ couchbase_server_admin_port }} --server-add-username={{ couchbase_server_admin }} --server-add-password={{ couchbase_server_password }}" 114 | with_items: groups['additional'] 115 | when: cb_major_version['stdout'] != "4" 116 | 117 | - name: Join additional cluster nodes 118 | shell: "{{ couchbase_server_bin_path }}/couchbase-cli server-add -c {{ couchbase_server_primary_node }}:{{ couchbase_server_admin_port }} --user={{ couchbase_server_admin }} --password={{ couchbase_server_password }} --server-add={{hostvars[[item][0]]['inventory_hostname']}}:{{ couchbase_server_admin_port }} --server-add-username={{ couchbase_server_admin }} --server-add-password={{ couchbase_server_password }} --services={{hostvars[[item][0]]['couchbase_server_node_services']}}" 119 | with_items: groups['additional'] 120 | when: cb_major_version['stdout'] >= "4" 121 | 122 | - name: Rebalance cluster 123 | shell: "{{ couchbase_server_bin_path }}/couchbase-cli rebalance -c {{ couchbase_server_primary_node }}:{{ couchbase_server_admin_port }} --user={{ couchbase_server_admin }} --password={{ couchbase_server_password }}" 124 | -------------------------------------------------------------------------------- /examples/cluster_install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: cluster_install.yml 3 | # Example Ansible playbook to install Couchbase Server on cluster nodes 4 | # 5 | # NB: This installs the Couchbase Server software, but does not 6 | # actually initialize a cluster, see cluster_init.yml for that 7 | 8 | - hosts: cluster_nodes 9 | become: yes 10 | become_user: root 11 | roles: 12 | - couchbaselabs.couchbase-server 13 | tasks: 14 | - name: Couchbase Server Service 15 | service: name=couchbase-server state=started 16 | -------------------------------------------------------------------------------- /examples/create_bucket.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: create_bucket.yml 3 | # Example Ansible playbook to create a new Couchbase Server bucket 4 | 5 | - hosts: cluster_nodes 6 | gather_facts: False 7 | tasks: 8 | - name: Create cluster grouping 9 | group_by: key={{ couchbase_server_node_role }} 10 | 11 | - hosts: primary 12 | become: no 13 | vars_files: 14 | - ../defaults/main.yml 15 | vars: 16 | couchbase_server_primary_node: "{{hostvars[groups['primary'][0]]['inventory_hostname']}}" 17 | couchbase_server_bucket_name: default 18 | couchbase_server_bucket_type: couchbase 19 | couchbase_server_bucket_ram: 256 20 | couchbase_server_bucket_port: 11211 21 | couchbase_server_bucket_replica: 1 22 | tasks: 23 | 24 | - name: Verify node health 25 | shell: "{{ couchbase_server_bin_path }}/couchbase-cli server-list -c {{ couchbase_server_primary_node }}:{{ couchbase_server_admin_port }} --user={{ couchbase_server_admin }} --password={{ couchbase_server_password }} | awk '/{{ couchbase_server_primary_node }}:{{ couchbase_server_admin_port }}/ {print $3}'" 26 | register: couchbase_server_health 27 | failed_when: couchbase_server_health['stdout'] != "healthy" 28 | 29 | - name: Create new bucket 30 | shell: "{{ couchbase_server_bin_path }}/couchbase-cli bucket-create -c {{ ansible_fqdn }}:{{ couchbase_server_admin_port }} --user={{ couchbase_server_admin }} --password={{ couchbase_server_password }} --bucket={{ couchbase_server_bucket_name }} --bucket-type={{ couchbase_server_bucket_type }} --bucket-port={{ couchbase_server_bucket_port }} --bucket-ramsize={{ couchbase_server_bucket_ram }} --bucket-replica={{ couchbase_server_bucket_replica }}" 31 | when: couchbase_server_health['stdout'] == "healthy" 32 | -------------------------------------------------------------------------------- /examples/example_hosts: -------------------------------------------------------------------------------- 1 | # File: example_hosts 2 | # Example Couchbase Server hosts inventory for cluster nodes 3 | # 4 | # Edit this and change cb1.local ... cb3.local to match your actual node 5 | # hostnames. Use 'couchbase_server_node_role=primary' variable to specify a 6 | # primary node and 'couchbase_server_node_role=additional' to specify all 7 | # additional nodes which will join the primary node to form a cluster 8 | # 9 | # Specify Multi Dimensional Scaling (MDS) services such as 'index' and 'query' 10 | # as a comma separated list in the 'couchbase_server_node_services' variable 11 | 12 | [cluster_nodes] 13 | couchbase-server1.local couchbase_server_node_role=primary 14 | couchbase-server2.local couchbase_server_node_role=additional 15 | couchbase-server3.local couchbase_server_node_role=additional 16 | 17 | [cluster_nodes_mds] 18 | cb1.local couchbase_server_node_role=primary couchbase_server_node_services="data" ansible_ssh_user=vagrant ansible_ssh_private_key_file=./.vagrant/machines/cb1/virtualbox/private_key 19 | cb2.local couchbase_server_node_role=additional couchbase_server_node_services="data,index" ansible_ssh_user=vagrant ansible_ssh_private_key_file=./.vagrant/machines/cb2/virtualbox/private_key 20 | cb3.local couchbase_server_node_role=additional couchbase_server_node_services="data,query" ansible_ssh_user=vagrant ansible_ssh_private_key_file=./.vagrant/machines/cb3/virtualbox/private_key 21 | -------------------------------------------------------------------------------- /examples/failover_node.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: node_failover.yml 3 | # Ansible playbook to perform manual failover on a target cluster node 4 | 5 | - hosts: cluster_nodes 6 | gather_facts: False 7 | tasks: 8 | - name: Create cluster grouping 9 | group_by: key={{ couchbase_server_node_role }} 10 | 11 | - hosts: primary 12 | gather_facts: False 13 | vars_files: 14 | - ../defaults/main.yml 15 | vars: 16 | couchbase_server_primary_node: "{{hostvars[groups['primary'][0]]['inventory_hostname']}}" 17 | couchbase_server_failover_node: 18 | tasks: 19 | 20 | - name: Failover node 21 | shell: "{{ couchbase_server_bin_path }}/couchbase-cli failover -u {{ couchbase_server_admin }} -p {{ couchbase_server_password }} -c {{ couchbase_server_primary_node }} --server-failover={{ couchbase_server_failover_node }}" 22 | register: result 23 | ignore_errors: True 24 | 25 | - debug: msg="You must specify a failover target node name to '--extra-vars couchbase_server_failover_node='" 26 | when: result|failed 27 | -------------------------------------------------------------------------------- /examples/load_bucket.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: load_bucket.yml 3 | # Example Ansible playbook to load Couchbase Server bucket with example items 4 | 5 | - hosts: cluster_nodes 6 | gather_facts: False 7 | tasks: 8 | - name: Create cluster grouping 9 | group_by: key={{ couchbase_server_node_role }} 10 | 11 | - hosts: primary 12 | gather_facts: False 13 | vars_files: 14 | - ../defaults/main.yml 15 | vars: 16 | couchbase_server_primary_node: "{{hostvars[groups['primary'][0]]['inventory_hostname']}}" 17 | couchbase_server_bucket_name: default 18 | couchbase_server_bucket_item_count: 9001 19 | couchbase_server_bucket_item_size: 256 20 | 21 | tasks: 22 | 23 | - name: Verify bucket warmup 24 | shell: "{{ couchbase_server_bin_path }}/cbstats localhost:11210 warmup | awk '/ep_warmup_state:/ {print $2}'" 25 | register: couchbase_server_warmup 26 | failed_when: couchbase_server_warmup['stdout'] != "done" 27 | 28 | - name: Load bucket with sample JSON items 29 | shell: "{{ couchbase_server_bin_path }}/cbworkloadgen -n {{ couchbase_server_primary_node }}:{{ couchbase_server_admin_port }} -i {{ couchbase_server_bucket_item_count }} -s {{ couchbase_server_bucket_item_size }} -j -b {{ couchbase_server_bucket_name }} -u {{ couchbase_server_admin }} -p {{ couchbase_server_password }}" 30 | when: couchbase_server_warmup['stdout'] == "done" 31 | -------------------------------------------------------------------------------- /examples/retreive_ssl_cert.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: retreive_ssl_cert.yml 3 | # Ansible playbook to grab SSL certificates from all cluster nodes 4 | 5 | - hosts: cluster_nodes 6 | tasks: 7 | - name: Create cluster grouping 8 | group_by: key={{ couchbase_server_node_role }} 9 | 10 | - hosts: primary 11 | gather_facts: False 12 | become: yes 13 | become_user: root 14 | vars: 15 | couchbase_server_primary_node: "{{hostvars[groups['primary'][0]]['inventory_hostname']}}" 16 | vars_files: 17 | - ../defaults/main.yml 18 | 19 | tasks: 20 | 21 | - name: Remove previous local data 22 | become: no 23 | local_action: file name=var/ssl_certs/*.pem state=absent 24 | 25 | - name: Ensure local data dir exists 26 | become: no 27 | local_action: file name=var/ssl_certs state=directory 28 | 29 | - name: Store SSL certificate 30 | shell: "{{ couchbase_server_bin_path }}/couchbase-cli ssl-manage --retrieve-cert=/tmp/{{ couchbase_server_primary_node }}.pem -c {{ couchbase_server_primary_node }}:{{ couchbase_server_admin_port }} -u {{ couchbase_server_admin }} -p {{ couchbase_server_password }}" 31 | 32 | - name: Gather SSL certificate 33 | fetch: "src=/tmp/{{ couchbase_server_primary_node }}.pem dest=var/ssl_certs/{{ ansible_hostname }}.pem flat=yes" 34 | 35 | - name: Cleanup 36 | file: "path=/tmp/{{ couchbase_server_primary_node }}.pem state=absent" 37 | -------------------------------------------------------------------------------- /examples/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: site.yml - Example Couchbase Server site playbook 3 | 4 | - name: Couchbase Server 5 | hosts: cluster_nodes 6 | become: yes 7 | become_user: root 8 | roles: 9 | - { role: couchbaselabs.couchbase-server } 10 | -------------------------------------------------------------------------------- /examples/vagrant_hosts: -------------------------------------------------------------------------------- 1 | # File: vagrant_hosts 2 | # Example Couchbase Server hosts inventory for Vagrant based cluster nodes 3 | # 4 | # Edit this and change cb1.local ... cb3.local to match your actual node 5 | # hostnames. Use 'couchbase_server_node_role=primary' variable to specify a 6 | # primary node and 'couchbase_server_node_role=additional' to specify all 7 | # additional nodes which will join the primary node to form a cluster 8 | # 9 | # Specify Multi Dimensional Scaling (MDS) services such as 'index' and 'query' 10 | # as a comma separated list in the 'couchbase_server_node_services' variable 11 | 12 | [cluster_nodes] 13 | cb1.local couchbase_server_node_role=primary couchbase_server_node_services="data" ansible_ssh_user=vagrant ansible_ssh_private_key_file=./.vagrant/machines/cb1/virtualbox/private_key 14 | cb2.local couchbase_server_node_role=additional couchbase_server_node_services="data" ansible_ssh_user=vagrant ansible_ssh_private_key_file=./.vagrant/machines/cb2/virtualbox/private_key 15 | cb3.local couchbase_server_node_role=additional couchbase_server_node_services="data" ansible_ssh_user=vagrant ansible_ssh_private_key_file=./.vagrant/machines/cb3/virtualbox/private_key 16 | -------------------------------------------------------------------------------- /files/debian-iptables: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | /sbin/iptables-restore < /etc/iptables.up.rules 3 | -------------------------------------------------------------------------------- /files/etc_default_couchbase-server_ulimit: -------------------------------------------------------------------------------- 1 | ulimit -n 10240 2 | -------------------------------------------------------------------------------- /files/etc_security_limits.d_couchbase-server.conf: -------------------------------------------------------------------------------- 1 | # Couchbase Server limits set by ansible-couchbase-server 2 | # 3 | couchbase soft nofile 10240 4 | couchbase hard nofile 10240 5 | -------------------------------------------------------------------------------- /files/rc.local: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | # 3 | # rc.local 4 | # 5 | # This script is executed at the end of each multiuser runlevel. 6 | # Make sure that the script will "exit 0" on success or any other 7 | # value on error. 8 | # 9 | # In order to enable or disable this script just change the execution 10 | # bits. 11 | # 12 | # By default this script does nothing. 13 | 14 | for i in /sys/kernel/mm/*transparent_hugepage/enabled; do echo never > $i; done 15 | for i in /sys/kernel/mm/*transparent_hugepage/defrag; do echo never > $i; done 16 | -------------------------------------------------------------------------------- /handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: handlers/main.yml 3 | # Main handlers for the common features of the ansible-couchbase-server role 4 | 5 | - name: Update kernel settings 6 | command: sysctl -e -p /etc/sysctl.d/couchbase-server.conf 7 | 8 | - name: Source local settings 9 | command: /bin/bash /etc/rc.local 10 | 11 | - name: Restart Couchbase Server 12 | service: name=couchbase-server state=restarted 13 | -------------------------------------------------------------------------------- /meta/main.yml: -------------------------------------------------------------------------------- 1 | galaxy_info: 2 | author: Brian Shumate 3 | description: Installs and initializes Couchbase Server clusters 4 | company: Couchbase 5 | 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | 10 | # Some suggested licenses: 11 | # - BSD (default) 12 | # - MIT 13 | # - GPLv2 14 | # - GPLv3 15 | # - Apache 16 | # - CC-BY 17 | license: Apache 18 | 19 | min_ansible_version: 1.9 20 | 21 | # Optionally specify the branch Galaxy will use when accessing the GitHub 22 | # repo for this role. During role install, if no tags are available, 23 | # Galaxy will use this branch. During import Galaxy will access files on 24 | # this branch. If travis integration is cofigured, only notification for this 25 | # branch will be accepted. Otherwise, in all cases, the repo's default branch 26 | # (usually master) will be used. 27 | #github_branch: 28 | 29 | # 30 | # Below are all platforms currently available. Just uncomment 31 | # the ones that apply to your role. If you don't see your 32 | # platform on this list, let us know and we'll get it added! 33 | # 34 | platforms: 35 | - name: EL 36 | versions: 37 | # - all 38 | # - 5 39 | - 6 40 | - 7 41 | #- name: GenericUNIX 42 | # versions: 43 | # - all 44 | # - any 45 | #- name: Solaris 46 | # versions: 47 | # - all 48 | # - 10 49 | # - 11.0 50 | # - 11.1 51 | # - 11.2 52 | # - 11.3 53 | #- name: Fedora 54 | # versions: 55 | # - all 56 | # - 16 57 | # - 17 58 | # - 18 59 | # - 19 60 | # - 20 61 | # - 21 62 | # - 22 63 | #- name: Windows 64 | # versions: 65 | # - all 66 | # - 2012R2 67 | #- name: SmartOS 68 | # versions: 69 | # - all 70 | # - any 71 | #- name: opensuse 72 | # versions: 73 | # - all 74 | # - 12.1 75 | # - 12.2 76 | # - 12.3 77 | # - 13.1 78 | # - 13.2 79 | - name: Amazon 80 | versions: 81 | - all 82 | # - 2013.03 83 | # - 2013.09 84 | #- name: GenericBSD 85 | # versions: 86 | # - all 87 | # - any 88 | #- name: FreeBSD 89 | # versions: 90 | # - all 91 | # - 8.0 92 | # - 8.1 93 | # - 8.2 94 | # - 8.3 95 | # - 8.4 96 | # - 9.0 97 | # - 9.1 98 | # - 9.1 99 | # - 9.2 100 | - name: Ubuntu 101 | versions: 102 | # - all 103 | # - lucid 104 | # - maverick 105 | # - natty 106 | # - oneiric 107 | - precise 108 | # - quantal 109 | # - raring 110 | # - saucy 111 | - trusty 112 | # - utopic 113 | # - vivid 114 | #- name: SLES 115 | # versions: 116 | # - all 117 | # - 10SP3 118 | # - 10SP4 119 | # - 11 120 | # - 11SP1 121 | # - 11SP2 122 | # - 11SP3 123 | #- name: GenericLinux 124 | # versions: 125 | # - all 126 | # - any 127 | - name: Debian 128 | versions: 129 | # - all 130 | # - etch 131 | - jessie 132 | # - lenny 133 | # - squeeze 134 | - wheezy 135 | 136 | galaxy_tags: 137 | - cluster 138 | - database 139 | - NoSQL 140 | # List tags for your role here, one per line. A tag is 141 | # a keyword that describes and categorizes the role. 142 | # Users find roles by searching for tags. Be sure to 143 | # remove the '[]' above if you add tags to this list. 144 | # 145 | # NOTE: A tag is limited to a single word comprised of 146 | # alphanumeric characters. Maximum 20 tags per role. 147 | 148 | dependencies: [] 149 | # List your role dependencies here, one per line. 150 | # Be sure to remove the '[]' above if you add dependencies 151 | # to this list. -------------------------------------------------------------------------------- /tasks/CentOS.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: tasks/CentOS.yml - CentOS tasks for ansible-couchbase-server 3 | 4 | # Download and install SELinux Python module (required by Ansible) 5 | 6 | - name: SELinux Python Module 7 | yum: "name=libselinux-python state=present" 8 | tags: installation 9 | 10 | ## Couchbase Server Enterprise Edition 11 | 12 | - name: Download package locally 13 | become: no 14 | connection: local 15 | get_url: "url={{ couchbase_server_centos_ee_url }} dest={{ role_path }}/files/{{ couchbase_server_centos_ee_package }} sha256sum={{ couchbase_server_centos_ee_sha256 }} timeout=240" 16 | run_once: true 17 | when: couchbase_server_edition == "enterprise" and couchbase_server_local_package != true 18 | tags: installation 19 | 20 | - name: Copy package 21 | copy: "src={{ couchbase_server_centos_ee_package }} dest=/tmp/{{ couchbase_server_centos_ee_package }}" 22 | when: couchbase_server_edition == "enterprise" and couchbase_server_local_package != true 23 | tags: installation 24 | 25 | - name: Install package 26 | become: yes 27 | become_user: root 28 | yum: "name=/tmp/{{ couchbase_server_centos_ee_package }} state=present" 29 | when: couchbase_server_edition == "enterprise" 30 | tags: installation 31 | 32 | - name: Package file cleanup 33 | become: yes 34 | become_user: root 35 | file: "dest=/tmp/{{ couchbase_server_centos_ee_package }} state=absent" 36 | when: couchbase_server_edition == "enterprise" 37 | tags: installation 38 | 39 | 40 | ## Couchbase Server Community Edition 41 | 42 | - name: Download package locally 43 | become: no 44 | connection: local 45 | get_url: "url={{ couchbase_server_centos_ce_url }} dest={{ role_path }}/files/{{ couchbase_server_centos_ce_package }} sha256sum={{ couchbase_server_centos_ce_sha256 }} timeout=240" 46 | run_once: true 47 | when: couchbase_server_edition == "community" and couchbase_server_local_package != true 48 | tags: installation 49 | 50 | - name: Copy package 51 | copy: "src={{ couchbase_server_centos_ce_package }} dest=/tmp/{{ couchbase_server_centos_ce_package }}" 52 | when: couchbase_server_edition == "community" and couchbase_server_local_package != true 53 | tags: installation 54 | 55 | - name: Install package 56 | become: yes 57 | become_user: root 58 | yum: "name=/tmp/{{ couchbase_server_centos_ce_package }} state=present" 59 | when: couchbase_server_edition == "community" 60 | tags: installation 61 | 62 | - name: Package file cleanup 63 | become: yes 64 | become_user: root 65 | file: "dest=/tmp/{{ couchbase_server_centos_ce_package }} state=absent" 66 | when: couchbase_server_edition == "community" 67 | tags: installation 68 | 69 | # Firewall (optional) 70 | - name: Firewall limitations 71 | include: CentOS_firewall.yml 72 | when: couchbase_server_firewall == true 73 | -------------------------------------------------------------------------------- /tasks/CentOS_firewall.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: tasks/CentOS_firewall.yml - CentOS firewall tasks for 3 | # ansible-couchbase-server 4 | 5 | ## Static firewall rules using iptables instead of firewalld 6 | 7 | - name: Stop firewalld 8 | become: yes 9 | become_user: root 10 | service: "name=firewalld state=stopped" 11 | when: ansible_distribution_major_version >= 7 12 | tags: firewall 13 | 14 | - name: Install iptables rules 15 | become: yes 16 | become_user: root 17 | yum: "name=iptables-services state=present" 18 | tags: firewall 19 | 20 | - name: Mask firewalld 21 | become: yes 22 | become_user: root 23 | shell: "systemctl mask firewalld.service" 24 | when: ansible_distribution_major_version >= 7 25 | tags: firewall 26 | 27 | - name: Enable iptables 28 | become: yes 29 | become_user: root 30 | shell: "systemctl enable iptables.service" 31 | tags: firewall 32 | 33 | - name: Stop services 34 | become: yes 35 | become_user: root 36 | service: "name=firewalld state=stopped" 37 | when: ansible_distribution_major_version >= 7 38 | tags: firewall 39 | 40 | - name: Start services 41 | become: yes 42 | become_user: root 43 | service: "name=iptables state=started" 44 | tags: firewall 45 | 46 | - name: Install iptables rules 47 | become: yes 48 | become_user: root 49 | template: "src=etc_sysconfig_iptables.j2 dest=/etc/sysconfig/iptables.couchbase-server owner=couchbase group=couchbase" 50 | tags: firewall 51 | 52 | - name: Import iptables rules 53 | become: yes 54 | become_user: root 55 | shell: "/sbin/iptables-restore < /etc/sysconfig/iptables.couchbase-server" 56 | tags: firewall 57 | -------------------------------------------------------------------------------- /tasks/Debian.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: tasks/Debian.yml - Debian tasks for ansible-couchbase-server 3 | 4 | ## Couchbase Server Enterprise Edition 5 | 6 | - name: Download package locally 7 | become: no 8 | connection: local 9 | get_url: "url={{ couchbase_server_debian_ee_url }} dest={{ role_path }}/files/{{ couchbase_server_debian_ee_package }} sha256sum={{ couchbase_server_debian_ee_sha256 }} timeout=240" 10 | run_once: true 11 | when: couchbase_server_edition == "enterprise" and couchbase_server_local_package != true 12 | tags: installation 13 | 14 | - name: Copy package 15 | copy: "src={{ couchbase_server_debian_ee_package }} dest=/tmp/{{ couchbase_server_debian_ee_package }}" 16 | when: couchbase_server_edition == "enterprise" and couchbase_server_local_package != true 17 | tags: installation 18 | 19 | - name: Install package 20 | become: yes 21 | become_user: root 22 | apt: "deb=/tmp/{{ couchbase_server_debian_ee_package }} state=present" 23 | when: couchbase_server_edition == "enterprise" 24 | tags: installation 25 | 26 | - name: Package file cleanup 27 | become: yes 28 | become_user: root 29 | file: "dest=/tmp/{{ couchbase_server_debian_ee_package }} state=absent" 30 | when: couchbase_server_edition == "enterprise" 31 | tags: installation 32 | 33 | ## Couchbase Server Community Edition 34 | 35 | - name: Download package locally 36 | become: no 37 | connection: local 38 | get_url: "url={{ couchbase_server_debian_ce_url }} dest={{ role_path }}/files/{{ couchbase_server_debian_ce_package }} sha256sum={{ couchbase_server_debian_ce_sha256 }} timeout=240" 39 | run_once: true 40 | when: couchbase_server_edition == "community" and couchbase_server_local_package != true 41 | tags: installation 42 | 43 | - name: Copy package 44 | copy: "src={{ couchbase_server_debian_ce_package }} dest=/tmp/{{ couchbase_server_debian_ce_package }}" 45 | when: couchbase_server_edition == "community" and couchbase_server_local_package != true 46 | tags: installation 47 | 48 | - name: Install package 49 | become: yes 50 | become_user: root 51 | apt: "deb=/tmp/{{ couchbase_server_debian_ce_package }} state=present" 52 | when: couchbase_server_edition == "community" 53 | tags: installation 54 | 55 | - name: Package file cleanup 56 | become: yes 57 | become_user: root 58 | file: "dest=/tmp/{{ couchbase_server_debian_ce_package }} state=absent" 59 | when: couchbase_server_edition == "community" 60 | tags: installation 61 | 62 | # Firewall (optional) 63 | - name: Firewall limitations 64 | include: Debian_firewall.yml 65 | when: couchbase_server_firewall == True 66 | -------------------------------------------------------------------------------- /tasks/Debian_firewall.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: tasks/Debian_firewall.yml - Debian firewall tasks for 3 | # ansible-couchbase-server 4 | 5 | ## Static firewall rules using iptables instead of firewalld 6 | 7 | - name: Install iptables rules 8 | become: yes 9 | become_user: root 10 | template: "src=etc_sysconfig_iptables.j2 dest=/etc/iptables.up.rules.couchbase-server owner=couchbase group=couchbase" 11 | tags: firewall 12 | 13 | - name: Import iptables rules 14 | become: yes 15 | become_user: root 16 | shell: "/sbin/iptables-restore < /etc/iptables.up.rules.couchbase-server" 17 | tags: firewall 18 | 19 | - name: Create iptables script 20 | become: yes 21 | become_user: root 22 | copy: src=debian-iptables dest=/etc/network/if-pre-up.d/iptables mode=0755 23 | tags: firewall 24 | -------------------------------------------------------------------------------- /tasks/RedHat.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: tasks/RedHat.yml - RHEL tasks for ansible-couchbase-server 3 | 4 | # Download and install SELinux Python module (required by Ansible) 5 | 6 | - name: SELinux Python Module 7 | yum: name=libselinux-python state=present 8 | tags: installation 9 | 10 | # Couchbase Server Enterprise Edition 11 | 12 | - name: Download package locally 13 | become: no 14 | connection: local 15 | get_url: "url={{ couchbase_server_centos_ee_url }} dest={{ role_path }}/files/{{ couchbase_server_centos_ee_package }} sha256sum={{ couchbase_server_centos_ee_sha256 }} timeout=240" 16 | run_once: true 17 | when: couchbase_server_edition == "enterprise" and couchbase_server_local_package != true 18 | tags: installation 19 | 20 | - name: Copy package 21 | copy: "src={{ couchbase_server_centos_ee_package }} dest=/tmp/{{ couchbase_server_centos_ee_package }}" 22 | when: couchbase_server_edition == "enterprise" and couchbase_server_local_package != true 23 | tags: installation 24 | 25 | - name: Install package 26 | become: yes 27 | become_user: root 28 | yum: "name=/tmp/{{ couchbase_server_centos_ee_package }} state=present" 29 | when: couchbase_server_edition == "enterprise" 30 | tags: installation 31 | 32 | - name: Package file cleanup 33 | become: yes 34 | become_user: root 35 | file: "dest=/tmp/{{ couchbase_server_centos_ee_package }} state=absent" 36 | when: couchbase_server_edition == "enterprise" 37 | tags: installation 38 | 39 | # Couchbase Server Community Edition 40 | 41 | - name: Download package locally 42 | become: yes 43 | become_user: root 44 | connection: local 45 | get_url: "url={{ couchbase_server_centos_ce_url }} dest={{ role_path }}/files/{{ couchbase_server_centos_ce_package }} sha256sum={{ couchbase_server_centos_ce_sha256 }} timeout=240" 46 | run_once: true 47 | when: couchbase_server_edition == "community" and couchbase_server_local_package != true 48 | tags: installation 49 | 50 | - name: Copy package 51 | copy: "src={{ couchbase_server_centos_ce_package }} dest=/tmp/{{ couchbase_server_centos_ce_package }}" 52 | when: couchbase_server_edition == "community" and couchbase_server_local_package != true 53 | tags: installation 54 | 55 | - name: Install package 56 | become: yes 57 | become_user: root 58 | yum: "name=/tmp/{{ couchbase_server_centos_ce_package }} state=present" 59 | when: couchbase_server_edition == "community" 60 | tags: installation 61 | 62 | - name: Package file cleanup 63 | become: yes 64 | become_user: root 65 | file: "dest=/tmp/{{ couchbase_server_centos_ce_package }} state=absent" 66 | when: couchbase_server_edition == "community" 67 | tags: installation 68 | 69 | # Firewall (optional) 70 | - name: Firewall limitations 71 | include: RedHat_firewall.yml 72 | when: couchbase_server_firewall == True 73 | 74 | -------------------------------------------------------------------------------- /tasks/RedHat_firewall.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: tasks/RedHat_firewall.yml - RedHat firewall tasks for 3 | # ansible-couchbase-server 4 | 5 | ## Static firewall rules using iptables instead of firewalld 6 | 7 | - name: Stop firewalld 8 | become: yes 9 | become_user: root 10 | service: "name=firewalld state=stopped" 11 | when: ansible_distribution_major_version >= 7 12 | tags: firewall 13 | 14 | - name: Install iptables rules 15 | become: yes 16 | become_user: root 17 | yum: "name=iptables-services state=present" 18 | tags: firewall 19 | 20 | - name: Mask firewalld 21 | become: yes 22 | become_user: root 23 | shell: "systemctl mask firewalld.service" 24 | when: ansible_distribution_major_version >= 7 25 | tags: firewall 26 | 27 | - name: Enable iptables 28 | become: yes 29 | become_user: root 30 | shell: "systemctl enable iptables.service" 31 | tags: firewall 32 | 33 | - name: Stop services 34 | become: yes 35 | become_user: root 36 | service: "name=firewalld state=stopped" 37 | when: ansible_distribution_major_version >= 7 38 | tags: firewall 39 | 40 | - name: Start services 41 | become: yes 42 | become_user: root 43 | service: "name=iptables state=started" 44 | tags: firewall 45 | 46 | - name: Install iptables rules 47 | become: yes 48 | become_user: root 49 | template: "src=etc_sysconfig_iptables.j2 dest=/etc/sysconfig/iptables.couchbase-server owner=couchbase group=couchbase" 50 | tags: firewall 51 | 52 | - name: Import iptables rules 53 | become: yes 54 | become_user: root 55 | shell: "/sbin/iptables-restore < /etc/sysconfig/iptables.couchbase-server" 56 | tags: firewall 57 | -------------------------------------------------------------------------------- /tasks/Ubuntu.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: tasks/Ubuntu.yml - Ubuntu tasks for ansible-couchbase-server 3 | 4 | ## Couchbase Server Enterprise Edition 5 | 6 | - name: Download package locally 7 | become: no 8 | connection: local 9 | get_url: "url={{ couchbase_server_ubuntu_ee_url }} dest={{ role_path }}/files/{{ couchbase_server_ubuntu_ee_package }} sha256sum={{ couchbase_server_ubuntu_ee_sha256 }} timeout=240" 10 | run_once: true 11 | when: couchbase_server_edition == "enterprise" and couchbase_server_local_package != true 12 | tags: installation 13 | 14 | - name: Copy package 15 | copy: "src={{ couchbase_server_ubuntu_ee_package }} dest=/tmp/{{ couchbase_server_ubuntu_ee_package }}" 16 | when: couchbase_server_edition == "enterprise" and couchbase_server_local_package != true 17 | tags: installation 18 | 19 | - name: Install package 20 | become: yes 21 | become_user: root 22 | apt: "deb=/tmp/{{ couchbase_server_ubuntu_ee_package }} state=present" 23 | when: couchbase_server_edition == "enterprise" 24 | tags: installation 25 | 26 | - name: Package file cleanup 27 | become: yes 28 | become_user: root 29 | file: "dest=/tmp/{{ couchbase_server_ubuntu_ee_package }} state=absent" 30 | when: couchbase_server_edition == "enterprise" 31 | tags: installation 32 | 33 | ## Couchbase Server Community Edition 34 | 35 | - name: Download package locally 36 | become: no 37 | connection: local 38 | get_url: "url={{ couchbase_server_ubuntu_ce_url }} dest={{ role_path }}/files/{{ couchbase_server_ubuntu_ce_package }} sha256sum={{ couchbase_server_ubuntu_ce_sha256 }} timeout=240" 39 | run_once: true 40 | when: couchbase_server_edition == "community" and couchbase_server_local_package != true 41 | tags: installation 42 | 43 | - name: Copy package 44 | copy: "src={{ couchbase_server_ubuntu_ce_package }} dest=/tmp/{{ couchbase_server_ubuntu_ce_package }}" 45 | when: couchbase_server_edition == "community" and couchbase_server_local_package != true 46 | tags: installation 47 | 48 | - name: Install package 49 | become: yes 50 | become_user: root 51 | apt: "deb=/tmp/{{ couchbase_server_ubuntu_ce_package }} state=present" 52 | when: couchbase_server_edition == "community" 53 | tags: installation 54 | 55 | - name: Package file cleanup 56 | become: yes 57 | become_user: root 58 | file: "dest=/tmp/{{ couchbase_server_ubuntu_ce_package }} state=absent" 59 | when: couchbase_server_edition == "community" 60 | tags: installation 61 | 62 | # Firewall (optional) 63 | - name: Firewall limitations 64 | include: Ubuntu_firewall.yml 65 | when: couchbase_server_firewall == True 66 | -------------------------------------------------------------------------------- /tasks/Ubuntu_firewall.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: tasks/Ubuntu_firewall.yml - Ubbuntu firewall tasks for 3 | # ansible-couchbase-server 4 | 5 | ## Static firewall rules using iptables instead of firewalld 6 | 7 | - name: Install iptables rules 8 | become: yes 9 | become_user: root 10 | template: "src=etc_sysconfig_iptables.j2 dest=/etc/iptables.up.rules.couchbase-server owner=couchbase group=couchbase" 11 | tags: firewall 12 | 13 | - name: Import iptables rules 14 | become: yes 15 | become_user: root 16 | shell: "/sbin/iptables-restore < /etc/iptables.up.rules.couchbase-server" 17 | tags: firewall 18 | 19 | - name: Create iptables script 20 | become: yes 21 | become_user: root 22 | copy: src=debian-iptables dest=/etc/network/if-pre-up.d/iptables mode=0755 23 | tags: firewall 24 | -------------------------------------------------------------------------------- /tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # File: tasks/main.yml - Main tasks for ansible-couchbase-server 3 | 4 | - name: Distribution specific variables 5 | include_vars: "../defaults/{{ ansible_distribution }}.yml" 6 | 7 | - name: Tuning variables 8 | include_vars: ../defaults/tuning.yml 9 | 10 | # CentOS tasks 11 | - include: CentOS.yml 12 | when: ansible_distribution == "CentOS" 13 | 14 | # Debian tasks 15 | - include: Debian.yml 16 | when: ansible_distribution == "Debian" 17 | 18 | # Red Hat tasks 19 | - include: RedHat.yml 20 | when: ansible_distribution == "RedHat" 21 | 22 | # Ubuntu tasks 23 | - include: Ubuntu.yml 24 | when: ansible_distribution == "Ubuntu" 25 | 26 | - name: Update user limits 27 | become: yes 28 | become_user: root 29 | copy: src=etc_security_limits.d_couchbase-server.conf dest=/etc/security/limits.d/couchbase-server.conf owner=root group=root mode=0644 30 | 31 | - name: Install profile.d script 32 | become: yes 33 | become_user: root 34 | template: src=profile_couchbase-server.sh.j2 dest=/etc/profile.d/couchbase-server.sh 35 | 36 | - name: Optimized settings for Couchbase Server data and index volumes 37 | become: yes 38 | become_user: root 39 | mount: name={{ couchbase_server_mountpoint }} src={{ couchbase_server_partition }} opts={{ couchbase_server_mount_options }} fstype={{ couchbase_server_filesystem }} state=mounted 40 | when: couchbase_server_tune_os 41 | 42 | - name: Kernel settings dir 43 | become: yes 44 | become_user: root 45 | file: dest=/etc/sysctl.d state=directory 46 | 47 | - name: Kernel settings config 48 | become: yes 49 | become_user: root 50 | template: src=etc_sysctl.d_couchbase-server.conf.j2 dest=/etc/sysctl.d/couchbase-server.conf owner=root group=root mode=0644 51 | notify: Update kernel settings 52 | 53 | - name: Disable THP 54 | become: yes 55 | become_user: root 56 | copy: src=rc.local dest=/etc/rc.local owner=root group=root mode=0644 57 | when: ansible_distribution_version != "12.04" 58 | notify: Source local settings 59 | -------------------------------------------------------------------------------- /templates/etc_sysconfig_iptables.j2: -------------------------------------------------------------------------------- 1 | # File templates/etc_sysconfig_iptables.j2 2 | # Firewall rules set by ansible-couchbase-server Couchbase Server role 3 | # Allows new TCP connections to the following network ports: 4 | # 5 | # * Secure Shell (SSH): TCP/22 6 | # * Erlang Port Mapper Daemon (EPMD): TCP/4369 7 | # * Couchbase Server Admin/REST port: TCP/8091 8 | # * Couchbase Server Admin/REST SSL port: TCP/18091 9 | # * Couchbase Server API port: TCP/8092 10 | # * Couchbase Server API SSL port: TCP/18092 11 | # * Couchbase Server intracluster port range: TCP 11207-11215 12 | # * Couchbase Server intracluster data port range: TCP 21100-21299 13 | 14 | *filter 15 | -A INPUT -p tcp -m state --state NEW -m tcp --dport {{ couchbase_server_sshd_port }} -j ACCEPT 16 | -A INPUT -p tcp -m state --state NEW -m tcp --dport {{ couchbase_server_epmd_port }} -j ACCEPT 17 | -A INPUT -p tcp -m state --state NEW -m tcp --dport {{ couchbase_server_admin_port }} -j ACCEPT 18 | -A INPUT -p tcp -m state --state NEW -m tcp --dport {{ couchbase_server_admin_ssl_port }} -j ACCEPT 19 | -A INPUT -p tcp -m state --state NEW -m tcp --dport {{ couchbase_server_api_port }} -j ACCEPT 20 | -A INPUT -p tcp -m state --state NEW -m tcp --dport {{ couchbase_server_api_ssl_port }} -j ACCEPT 21 | -A INPUT -p tcp -m state --state NEW -m tcp --dport {{ couchbase_server_internal_ports }} -j ACCEPT 22 | -A INPUT -p tcp -m state --state NEW -m tcp --dport {{ couchbase_server_node_data_ports }} -j ACCEPT 23 | COMMIT 24 | -------------------------------------------------------------------------------- /templates/etc_sysctl.d_couchbase-server.conf.j2: -------------------------------------------------------------------------------- 1 | # File: templates/etc_sysctl.d/couchbase-server.conf.j2 2 | # Kernel tunables for Couchbase Server set by Ansbile 3 | 4 | ### 5 | ### STANDARD TUNING 6 | ### 7 | 8 | # Instructs the kernel to swap only as a last resort 9 | vm.swappiness = {{ couchbase_server_swappiness }} 10 | 11 | # Remote buggy TCP workaround / no effect on the local network 12 | # net.ipv4.tcp_workaround_signed_windows = {{ couchbase_server_tcp_workaround_signed_windows }} 13 | 14 | # Increases maximum number of remembered connection requests which 15 | # did not receive an acknowledgment from connecting client 16 | # Must be less than or equal to somaxconn or it will be truncated 17 | net.ipv4.tcp_max_syn_backlog = {{ couchbase_server_tcp_max_syn_backlog }} 18 | 19 | ### 20 | ### ADDITIONAL EXPERIMENTAL TUNING 21 | ### Uncomment to activate 22 | ### 23 | 24 | # RFC 1337 / time-wait assasination hazards fix 25 | # net.ipv4.tcp_rfc1337 = {{ couchbase_server_tcp_rfc1337 }} 26 | 27 | # Reduce retransmit bandwidth with selective ACK 28 | # net.ipv4.tcp_sack = {{ couchbase_server_tcp_sack }} 29 | 30 | # Forward Acknowledgement System works with SACK 31 | # to improve packet loss recovery 32 | # net.ipv4.tcp_fack = {{ couchbase_server_tcp_fack }} 33 | 34 | # Disables MTU probing unless ICMP black hole detected 35 | # net.ipv4.tcp_mtu_probing = {{ couchbase_server_mtu_probing }} 36 | 37 | # Increase OS filesystem limit for open files 38 | # fs.file-max = {{ couchbase_server_file_max }} 39 | 40 | # Increase processor input queue length 41 | # net.core.netdev_max_backlog = {{ couchbase_server_netdev_max_backlog }} 42 | 43 | # Per connection receive buffer and TCP window size auto tuning 44 | # net.ipv4.tcp_moderate_rcvbuf = {{ couchbase_server_tcp_moderate_rcvbuf }} 45 | 46 | # Better performance over high bandwidth networks than [New] Reno 47 | # Also generally regarded as safer than cubic 48 | # net.ipv4.tcp_congestion_control = {{ couchbase_server_tcp_congestion_control }} 49 | 50 | # Increases socket listen backlog to support request bursts 51 | # net.core.somaxconn = {{ couchbase_server_somaxconn }} 52 | 53 | # Reduce bandwidth loss on fast networks by allowing for very large windows 54 | # Larger windows are good for high bandwidth*delay 55 | # net.ipv4.tcp_window_scaling = {{ couchbase_server_tcp_window_scaling }} 56 | 57 | # Decreases amount of time connections remain in FIN-WAIT-2 state 58 | # Cleans up broken connections faster 59 | # net.ipv4.tcp_fin_timeout = {{ couchbase_server_tcp_fin_timeout }} 60 | 61 | # Increase the frequency of keepalive probes 62 | # Helps to quickly identify and time out dead connections 63 | # net.ipv4.tcp_keepalive_intvl = {{ couchbase_server_tcp_keepalive_intvl }} 64 | 65 | # Limits the maximum memory used to 200MB before pdflush 66 | # The default value can overwhelm the storage system once flushed. 67 | # vm.dirty_bytes = {{ couchbase_server_dirty_bytes }} 68 | 69 | # The lower threshold for vm.dirty_bytes 70 | # vm.dirty_background_bytes = {{ couchbase_server_dirty_background_bytes }} 71 | 72 | -------------------------------------------------------------------------------- /templates/profile_couchbase-server.sh.j2: -------------------------------------------------------------------------------- 1 | COUCHBASEDIR={{ couchbase_server_home_path }} 2 | PATH=$COUCHBASEDIR/bin:${PATH} 3 | export PATH 4 | -------------------------------------------------------------------------------- /version.txt: -------------------------------------------------------------------------------- 1 | v1.7.7 2 | --------------------------------------------------------------------------------