You could bring up a 7 node cluster for testing on a single node with a single network card using multicast.
You can use the following script and configure aerospike to use multicast network.
The following only uses docker run
and does not take advantage of all the orchestration tools offered by docker:
Modify aerospike.conf to use multicast hearbeat:
heartbeat {
mode multicast # Send heartbeats using Multicast
address 239.3.9.2 # multicast address
port 9918
interval 150
timeout 10
}
Use something similar to the following script makecluster.sh
to build from repo and generate a 7 node cluster
docker build -t "aerospike/aerospike-server" .
for i in {3..9} ; do
echo $i;
docker stop aerospike${i}
docker rm aerospike${i}
docker run -tid --name aerospike${i} -p ${i}000:3000 -p ${i}001:3001 -p ${i}002:3002 -p ${i}003:3003 aerospike/aerospike-server
done;
| => ./makecluster.sh
Sending build context to Docker daemon 13.82 kB
Step 1 : FROM ubuntu:xenial
---> 2fa927b5cdd3
Step 2 : ENV AEROSPIKE_VERSION 3.9.0.3
---> Using cache
---> e1175083852a
Step 3 : ENV AEROSPIKE_SHA256 49597f4d82da22fe3d6b10a54676a7b0a864279f90cc2f92928f1dbbc76385c8
---> Using cache
---> 8e72fe0bd0ea
Step 4 : RUN apt-get update -y && apt-get install -y wget python logrotate ca-certificates && wget "https://www.aerospike.com/artifacts/aerospike-server-community/${AEROSPIKE_VERSION}/aerospike-server-community-${AEROSPIKE_VERSION}-ubuntu16.04.tgz" -O aerospike-server.tgz && echo "$AEROSPIKE_SHA256 *aerospike-server.tgz" | sha256sum -c - && mkdir aerospike && tar xzf aerospike-server.tgz --strip-components=1 -C aerospike && dpkg -i aerospike/aerospike-server-*.deb && mkdir -p /var/log/aerospike/ && mkdir -p /var/run/aerospike/ && rm -rf aerospike-server.tgz aerospike /var/lib/apt/lists/*
---> Using cache
---> c01ff7090834
Step 5 : COPY aerospike_multicast.conf /etc/aerospike/aerospike.conf
---> b56601bd7eba
Removing intermediate container fad8c3c23338
Step 6 : COPY entrypoint.sh /entrypoint.sh
---> 4369993bb939
Removing intermediate container 5fb4f1860c5b
Step 7 : VOLUME /opt/aerospike/data
---> Running in 4dc02cf018e2
---> 6d6d0c5dc1f8
Removing intermediate container 4dc02cf018e2
Step 8 : EXPOSE 3000 3001 3002 3003
---> Running in 8d91a8046ec9
---> 501ecc11fd83
Removing intermediate container 8d91a8046ec9
Step 9 : ENTRYPOINT /entrypoint.sh
---> Running in 4feb29e4acdc
---> 04f41da16651
Removing intermediate container 4feb29e4acdc
Step 10 : CMD asd
---> Running in ee6d90f75e38
---> f4559215ebf5
Removing intermediate container ee6d90f75e38
Successfully built f4559215ebf5
3
545eda5e2544c55ccafeeb9ba3a4a178f87b0e113505423ab0476549826aa447
4
e05c83e8e8a5c50e17e7970203000377bc104bc248e1f75225dbf4852bad255e
5
47fe5942436edc03e7463c01b0b0e94ab53396fef511301e4b6f500a007c430c
6
50fca8ec246fff2089589431c0f5d203bdf3ff1ae437ef60776045f5cb26415d
7
ba3d3e522e586443bc9d466705f173453aabc2b32344e4073c0680ae294ff320
8
bc10a242f3ae823dc78c7a758da2e6094bd6bb69091add717b21eeebf86ae33b
9
c1d68ce1ada3140377791c7a8ab8f05c0d2528f345fe2e624467bbda839a0a2d
| => docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c1d68ce1ada3 aerospike/aerospike-server "/entrypoint.sh asd" 6 seconds ago Up 5 seconds 0.0.0.0:9000->3000/tcp, 0.0.0.0:9001->3001/tcp, 0.0.0.0:9002->3002/tcp, 0.0.0.0:9003->3003/tcp aerospike9
bc10a242f3ae aerospike/aerospike-server "/entrypoint.sh asd" 7 seconds ago Up 5 seconds 0.0.0.0:8000->3000/tcp, 0.0.0.0:8001->3001/tcp, 0.0.0.0:8002->3002/tcp, 0.0.0.0:8003->3003/tcp aerospike8
ba3d3e522e58 aerospike/aerospike-server "/entrypoint.sh asd" 7 seconds ago Up 6 seconds 0.0.0.0:7000->3000/tcp, 0.0.0.0:7001->3001/tcp, 0.0.0.0:7002->3002/tcp, 0.0.0.0:7003->3003/tcp aerospike7
50fca8ec246f aerospike/aerospike-server "/entrypoint.sh asd" 8 seconds ago Up 6 seconds 0.0.0.0:6000->3000/tcp, 0.0.0.0:6001->3001/tcp, 0.0.0.0:6002->3002/tcp, 0.0.0.0:6003->3003/tcp aerospike6
47fe5942436e aerospike/aerospike-server "/entrypoint.sh asd" 8 seconds ago Up 7 seconds 0.0.0.0:5000->3000/tcp, 0.0.0.0:5001->3001/tcp, 0.0.0.0:5002->3002/tcp, 0.0.0.0:5003->3003/tcp aerospike5
e05c83e8e8a5 aerospike/aerospike-server "/entrypoint.sh asd" 9 seconds ago Up 7 seconds 0.0.0.0:4000->3000/tcp, 0.0.0.0:4001->3001/tcp, 0.0.0.0:4002->3002/tcp, 0.0.0.0:4003->3003/tcp aerospike4
545eda5e2544 aerospike/aerospike-server "/entrypoint.sh asd" 9 seconds ago Up 8 seconds 0.0.0.0:3000-3003->3000-3003/tcp aerospike3
________________________________________________________________________________
| => docker exec -ti aerospike9 bash
root@c1d68ce1ada3:/# tail -f /var/log/aerospike/aerospike.log
Aug 01 2016 18:20:31 GMT: INFO (drv_ssd): (drv_ssd.c:2072) device /opt/aerospike/data/test.dat: used 0, contig-free 4095M (4095 wblocks), swb-free 0, w-q 0 w-tot 0 (0.0/s), defrag-q 0 defrag-tot 0 (0.0/s) defrag-w-tot 0 (0.0/s)
Aug 01 2016 18:20:36 GMT: INFO (info): (ticker.c:164) NODE-ID bb9080011ac4202 CLUSTER-SIZE 7
Aug 01 2016 18:20:36 GMT: INFO (info): (ticker.c:226) system-memory: free-kbytes 1209640 free-pct 59
Aug 01 2016 18:20:36 GMT: INFO (info): (ticker.c:240) in-progress: tsvc-q 0 info-q 0 nsup-delete-q 0 rw-hash 0 proxy-hash 0 rec-refs 0
Aug 01 2016 18:20:36 GMT: INFO (info): (ticker.c:262) fds: proto (0,0,0) heartbeat (0,0,0) fabric (42,42,0)
Aug 01 2016 18:20:36 GMT: INFO (info): (ticker.c:271) heartbeat-received: self 557 foreign 3396
Aug 01 2016 18:20:36 GMT: INFO (info): (ticker.c:328) {test} objects: all 0 master 0 prole 0
Aug 01 2016 18:20:36 GMT: INFO (info): (ticker.c:366) {test} migrations: complete
Aug 01 2016 18:20:36 GMT: INFO (info): (ticker.c:385) {test} memory-usage: total-bytes 0 index-bytes 0 sindex-bytes 0 data-bytes 0 used-pct 0.00
Aug 01 2016 18:20:36 GMT: INFO (info): (ticker.c:415) {test} device-usage: used-bytes 0 avail-pct 99