Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ansible/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.zip
*.tar.gz
playbook.retry
22 changes: 22 additions & 0 deletions ansible/asterix.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[nc/nc1]
address=nc1

[nc/nc2]
address=nc2

[nc/nc3]
address=nc3

[nc/nc4]
address=nc4

[nc]
txnlogdir=/home/couchbase/txnlog
coredumpdir=/home/couchbase/coredump
iodevices=/home/couchbase/io/1,/home/couchbase/io/2,/home/couchbase/io/3,/home/couchbase/io/4
storagedir=storage
command=asterixnc
app.class=org.apache.asterix.hyracks.bootstrap.NCApplicationEntryPoint

[cc]
cluster.address = nc1
12 changes: 12 additions & 0 deletions ansible/inventory
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[ncs]
nc1
nc2
nc3
nc4

[cc]
nc1

[all:vars]
ansible_user=couchbase

36 changes: 36 additions & 0 deletions ansible/playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
- hosts: all

tasks:
- name: Create Asterix installation directory
file:
path: /home/couchbase/asterix
state: directory

- name: Download and unpack Asterix
unarchive:
src: /home/couchbase/asterix-server-binary-assembly.zip
dest: /home/couchbase/asterix
owner: couchbase
group: couchbase
creates: /home/couchbase/asterix/bin/asterixncservice

- hosts: ncs

tasks:
- name: Start NC Service
shell: >
nohup /home/couchbase/asterix/bin/asterixncservice < /dev/null > /home/couchbase/ncservice.log 2>&1 &

- hosts: cc

tasks:
- name: Copy cluster config to CC
copy:
src: asterix.conf
dest: /home/couchbase

- name: Start CC
shell: >
nohup /home/couchbase/asterix/bin/asterixcc -config-file /home/couchbase/asterix.conf < /dev/null > /home/couchbase/cc.log 2>&1 &

7 changes: 7 additions & 0 deletions app/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ services:
networks:
- asterix

ansible:
container_name: ansible
image: ceejatec/asterix-ansible
volumes:
- "../ansible:/home/couchbase/ansible"
networks:
- asterix

networks:
asterix:
Expand Down
11 changes: 11 additions & 0 deletions docker/ansible/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM ceejatec/asterix-centos7

# GCC and python-devel (necessary for pip)
RUN yum install -y gcc python-devel libffi-devel openssl-devel

# Install pip and ansible
RUN curl "https://bootstrap.pypa.io/get-pip.py" -o "/tmp/get-pip.py" && \
python /tmp/get-pip.py && \
pip install ansible && \
rm /tmp/get-pip.py

4 changes: 4 additions & 0 deletions docker/ansible/go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

docker build -t ceejatec/asterix-ansible:latest .

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
71 changes: 0 additions & 71 deletions scripts/docker-cluster.xml

This file was deleted.

11 changes: 4 additions & 7 deletions scripts/install-asterix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
# This script assumes the 4-node Docker cluster is up, and has not
# previously had Asterix installed on it
scriptdir=`dirname $0`
rm -rf /home/couchbase/shared/*
cp ${scriptdir}/docker-cluster.xml $* /home/couchbase/shared
docker exec -u couchbase app_nc1_1 mkdir /home/couchbase/managix
docker exec -u couchbase app_nc1_1 unzip -d /home/couchbase/managix /home/couchbase/shared/\*.zip
docker exec -u couchbase app_nc1_1 /home/couchbase/managix/bin/managix configure
docker exec -u couchbase app_nc1_1 /home/couchbase/managix/bin/managix validate
docker exec -u couchbase app_nc1_1 /home/couchbase/managix/bin/managix create -n docker-cluster -c /home/couchbase/shared/docker-cluster.xml

docker-compose -f /home/couchbase/docker/app/docker-compose.yml up -d --force-recreate ansible
docker cp $* ansible:/home/couchbase/asterix-server-binary-assembly.zip
docker exec -u couchbase ansible ansible-playbook /home/couchbase/ansible/playbook.yml -i /home/couchbase/ansible/inventory
echo $?