Antons Kranga
DevOps:Cloud Automation
October 11, 2013

Organizers

Top Media Partner

Media Partner

Supporter
Presenter
- Technology Architect at Accenture



- 10+ years experience in Enterprise Development

- Projects:
- Accenture Foundation Platform for Java
- Accenture Cloud Platform
- ALPJ 
- Monsoon
Ask questions online

www.sli.do/openslava
Cloud

Copyright © 2013 Accenture All rights reserved.
This is cloud
Definition of Cloud Computing

Copyright © 2013 Accenture All rights reserved.
Cloud Computing

Copyright © 2013 Accenture All rights reserved.
Accenture Cloud Platform
Testing as Service
Monsoon
ALPJ
etc

Cloud Broker API

Copyright © 2013 Accenture All rights reserved.
Challenges of Cloud (What IaaS Offers)
Web Tier

Application Tier

Database

Copyright © 2012 Accenture All rights reserved.
Challenges of Cloud (What Users Want)
Web Tier

Application Tier

Database

Copyright © 2012 Accenture All rights reserved.
Infrastructure services
and patterns
example
OS Type: RedHat

OS Version: 6.2

Tomcat Home: /etc/tomcat

Tomcat Port: 8080
MySQL IP: 10.10.0.1
MySQL Root Password: password

include_recipe “java“



package "tomcat6“



artifact_deploy "tomcat6“ do
version "latest“
artifact_location "foo.war"
deploy_to node[:tomcat][:work_dir]
end



service "tomcat6" do
action [:enable, :start]
end

Attributes
Recipe





OS Specific Instructions
Chef Workstation

Copyright © 2012 Accenture All rights reserved.

Virtualized Infrastructure
Virtualized Infrastructure

Chef Workstation

Chef Server
REST

CMDB

Cookbooks
Roles
...

Copyright © 2012 Accenture All rights reserved.
Virtualized Infrastructure

Chef Workstation

Chef Server
REST

CMDB

Cookbooks
Roles
...

Copyright © 2012 Accenture All rights reserved.
Virtualized Infrastructure

Chef Workstation
knife

Uses SSH to

bootstraps Chef
client

Chef Server
REST

CMDB

Cookbooks
Roles
...

Copyright © 2012 Accenture All rights reserved.
Virtualized Infrastructure

Chef Workstation
knife

Chef Server

e
ch

t
en
li
fc
at6
c

tom

REST

CMDB

Cookbooks
Roles
...

Copyright © 2012 Accenture All rights reserved.
Virtualized Infrastructure

Chef Workstation
knife

Chef Server

e
ch

t
en
li
fc
at6
c

tom

REST
HTTP call signed
with certificate

CMDB

Cookbooks
Roles
...
Virtualized Infrastructure

Chef Workstation
knife

Chef Server

e
ch

t
en
li
fc
at6
c

tom

REST

CMDB

Cookbooks
Roles
...
Virtualized Infrastructure

Chef Workstation
knife

Chef Server

e
ch

t
en
li
fc
at6
c

tom

REST

CMDB

Cookbooks



t6
ca 

m a
to jav les
ab
pt
i

Cookbooks
Roles
...

Copyright © 2012 Accenture All rights reserved.
Virtualized Infrastructure

Chef Workstation
knife

ohai

acts
oad f
upl

Chef Server

e
ch

t
en
li
fc
at6
c

tom

REST

CMDB

Cookbooks



t6
ca 

m a
to jav les
ab
pt
i

Cookbooks
Roles
...

Copyright © 2012 Accenture All rights reserved.
Service discovery
Node 1

Node 2

Node 3

Node N
Node 1

Node 2

Register

Node 3

Register

Register

Database

Node N

Register
Node 1

Node 2

Register

Node 3

Register

Register

Discover nodes

Database

Node N

Register
Node 1

Node 2

Register

Node 3

Register

Register

Discover nodes

Database

Node N

Register
Load balancing
LB

Node 1

Node 2

Node 3

Node N
Single point of
failure

LB

Node 1

Node 2

Node 3

Node N
LB

Node 1

Node 2

Heartbeat

Node 3

LB2

Node N
Shared virtual IP

LB

Node 1

Node 2

Heartbeat

Node 3

LB2

Node N
Dealing with sticky sessions
Shared virtual IP

LB

Tomcat 1

Tomcat 2

Heartbeat

Tomcat 3

LB2

Tomcat N
Shared virtual IP

LB

Tomcat 1

Tomcat 2

Heartbeat

Tomcat 3

LB2

Tomcat N

Save session

Save session

Save session

Save session

Memcached 1

Memcached 2

Memcached 3

Memcached N

Same Server

Same Server

Same Server

Same Server
Shared virtual IP

LB

Tomcat 1

Save session

Tomcat 2

Save session

Heartbeat

Tomcat 3

Save session

LB2

Tomcat N

Save session

Memcached 1 Repl Memcached 2 Repl Memcached 3 Repl Memcached N
Same Server

Same Server

Same Server

Same Server
Shared virtual IP

If session repl not
hitting netw capacity

Tomcat 1

Save session

LB

Tomcat 2

Save session

Heartbeat

Tomcat 3

Save session

LB2

Tomcat N

Save session

Memcached 1 Repl Memcached 2 Repl Memcached 3 Repl Memcached N
Same Server

Same Server

Same Server

Same Server
Shared virtual IP

LB

Tomcat 1

Tomcat 2

Heartbeat

Tomcat 3

save session

Memcached
Large RAM VM

LB2

Tomcat N
Elasticity
Shared virtual IP

LB

Tomcat 1

Save session

Tomcat 2

Save session

Heartbeat

Tomcat 3

Save session

LB2

Tomcat N

Save session

Memcached 1 Repl Memcached 2 Repl Memcached 3 Repl Memcached N
Same Server

Same Server

Same Server

Same Server
Shared virtual IP

LB

Tomcat 1

Save session

Tomcat 2

Save session

Heartbeat

Tomcat 3

Save session

LB2

Tomcat N

Save session

Memcached 1 Repl Memcached 2 Repl Memcached 3 Repl Memcached N
Same Server

Same Server

Same Server

Auto scaling group

Same Server
Dealing with sticky sessions
Node 1

Node 2

Register

Node 3

Register

Register

Discover nodes

Database

Node N

Register
Node 1

Node 2

Node 3

Node N

publish facts

publish facts

publish facts

publish facts

Message Broker
Node 1
publish facts
subscribe events

Node 2
publish facts
subscribe events

Node 3
publish facts
subscribe events

Message Broker

Node N
publish facts
subscribe events
Node 1
publish facts
subscribe events

Node 2
publish facts
subscribe events
heartbeat
heartbeat

Node 3
publish facts
subscribe events
heartbeat
heartbeat

Message Broker

Node N
publish facts
subscribe events
Virtualized Infrastructure

Chef Server
Infra Management:
1. Provisioning
2. Service Discovery

CMDB

Message Broker
Operating Scenarios: Operations
Virtualized Infrastructure

Chef Server
Infra Management:
1. Provisioning
2. Patching

CMDB

Server Orchestration:
1. Cluster Orchestration
2. Scalability
3. Deployment Orchestration

mCollective

Multi zone example
Distributed logging
Node 1

Node 2

Node 3

Auto scaling group

Node N
Node 1

Node 2

Node 3

Auto scaling group

Cloud storage

Node N
Node 1

Node 2

Node 3

Log agent

Log agent

Log agent

Auto scaling group

Log collector

Cloud storage

Node N
Log agent
Phoenix Server
Node 1

Node 2

Node 3

Node N
Want to apply
change/patch

Node 1

Node 2

Node 3

Node N
Node 1

Node 2

Node 3

Node N

Node M
All changes
included
Node 1

Node 2

Node 3

Migrate data

Node N

Node M
Node 1

Node 2

Node 3

Shared data
Cloud storage

Node N

Node M
Test and learn
Virtualized Infrastructure

Chef Server

CMDB
Virtualized Infrastructure

Chef Server
Chaos Monkey

CMDB
Cookbook development
Stop forking, really!!!
community
cookbook
wrapper cookbook

wrapper cookbook adds new functionality
to community version of the cookbook
instead of changing it directly
include_recipe “tomcat“


community
cookbook
wrapper cookbook

chef_gem "chef-rewind“



rewind "template[catalina.xml]“ do
# add your custom staff 
end
Cookbook Quality
•

Food Critic: Cookbook style analysis tool

•

URL: http://acrmp.github.com/foodcritic/

•

Integration: Travis CI

•

Cookbook Style Guide: https://github.com/ampledata/cookbook-style-guide

Copyright © 2012 Accenture All rights reserved.
Takeaways
- Accenture Cloud Platform





- Monsoon
- Accenture Lightweight Platform for Java

- Accenture Foundation Platform for Java



- Opscode Chef
Discussion

www.sli.do/openslava

OpenSlava Infrastructure Automation Patterns