Testing and deploying Couchbase Mobile – Couchbase Connect 2016

28
©2016 Couchbase Inc. Deploy: installing, upgrading and scaling 1

Transcript of Testing and deploying Couchbase Mobile – Couchbase Connect 2016

Page 1: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc.

Deploy: installing, upgrading andscaling

1

Page 2: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc. 2

James NocentiniTechnical Writer

[email protected]

@jamiltz

IMAGE GOES HERE

Page 3: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc. 3

Traun LeydenSoftware Engineer

[email protected]

@tleydn

IMAGE GOES HERE

Page 4: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Agenda

4

• Overall System Overview

• Deploying on Operating Systems / Virtual Machines• Overview

• Demo on VirtualBox cluster

• Deploying on Containers• Overview

• Deploying on PaaS – Platform as a Service• PaaS landscape overview

• Demo on Docker Cloud

Page 5: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Deployed System Overview

5

Page 6: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc. 6

Deploying on Operating Systems / Virtual Machines

Containers

PaaS Providers

Page 7: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc. 7

Supported Backend Platforms

• Operating Systems / Virtual Machines• Linux: RedHat / CentOS / Ubuntu

• Windows

• OSX

Page 8: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Deployment Stages for VMs

8

1. Start Virtual Machines

2. Provisioning Couchbase Server and Sync Gateway

3. Configuration Changes

4. Scaling

Page 9: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc. 9

Demo

Page 10: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Install

10

1. Install Couchbase Server

2. Configure Couchbase Server

3. Install Sync Gateway

4. Configure Sync Gateway (Connect to CBS)

5. Configure Ngninx

Page 11: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Rolling Upgrade

11

1. Remove SG on VM2 from NginxRotation

2. Upgrade SG on VM2

3. Re-add SG on VM2 to Nginxrotation

Page 12: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Rolling Upgrade

12

1. Repeat steps for SG on VM3

Page 13: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Scaling

13

1. Configure SG to connect to Couchbase Server

2. Add new SG to Nginx rotation

Page 14: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Demo Recap

• Install Couchbase Server

• Configure Couchbase Cluster

• Install Sync Gateway

• Configure Sync Gateway

• Configure NGINX

• Rolling Upgrades

• Auto-scaling

• Configuration changes

14

Page 15: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc. 15

Operating Systems / Virtual Machines

Deploying on ContainersPaaS Providers

Page 16: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc. 16

Supported Backend Platforms

• Containers• Docker

Page 17: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc. 17

Containers (Docker)

Advantages

• Quick to start/restart

• Portability

• Isolation

• Resource allocation and scheduling

Challenges

• Data persistence

• Additional networking complexity

• Microservice Overhead

Page 18: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Container Persistent Data challenges

• Container file systems are based on UnionFS and not appropriate for high IO throughput

• Volumes let you mount host directories into container – data persists beyond container instance

• Kubernetes Container Orchestration• By default, will schedule containers on any node and your host directory probably won’t be there

• PetSets were recently introduced to solve this issue

18

Page 19: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Container networking challenges

• Containers communicating across hosts• Workaround: host only networking – container runs directly on host’s network interface

• Right way: Use Overlay Networking

• Set it up yourself with Weave (Hard)

• Use Kubernetes

• Use Docker Swarm

• Couchbase Server sensitive to change in IP address• Problem: restart a container and it gets a new IP address and tries to rejoin, cluster won’t recognize

• Workaround: configure with stable routable DNS names

19

Page 20: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc. 20

Operating Systems / Virtual MachinesContainers

Deploying on PaaS Providers

Page 21: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Couchbase Images on DockerHub – officially supported

21

Page 22: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc. 22

Supported Backend Platforms

• PaaS Providers• AWS

• Azure

• Google Container Engine (GKE)

• Docker Cloud

• OpenStack3 (coming soon)

Page 23: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Deployment Stages for Docker Cloud

23

1. Provisioning Nodes

2. Creating the Services

3. Deploying Containers

4. Scaling Services

Page 24: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Docker Cloud – (Dev Mode) 5 containers striped across 2 nodes

24

Node1 - EC2 Instance

Node2 - EC2 Instance

CouchbaseService

Sync GatewayService

HAProxyService

Sync Gateway1Container

Sync Gateway2Container

Couchbase1Container

Couchbase2Container

HAProxyContainer

Page 25: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Docker Cloud – (Production Mode) Dedicated node per container

25

Node5 - EC2 Instance

Node4 - EC2 Instance

Node3 - EC2 Instance

Node1 - EC2 Instance

Node2 - EC2 Instance

CouchbaseService

Sync GatewayService

HAProxyService

Sync Gateway1Container

Sync Gateway2Container

Couchbase1Container

Couchbase2Container

HAProxyContainer

Page 26: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc. 26

Demo

Page 27: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Docker Cloud Demo Recap

27

1. Start 2 Nodes (pre-demo)2. Start Couchbase Server Service with 2 Containers3. Configure Couchbase Server cluster4. Start Sync Gateway Service with 2 Containers5. Verify Sync Gateway6. Start HAProxy load balancer Service with 1 Container7. Verify Sync Gateway via HAProxy

Setup

1. Start new Node2. Scale Sync Gateway Service to add another container (3 total)3. Send Requests to HAProxy and verify logs in Sync Gateway Container 3

Scale

Page 28: Testing and deploying Couchbase Mobile – Couchbase Connect 2016

©2016 Couchbase Inc.

Thank You!

28