SlideShare uma empresa Scribd logo
1 de 39
Salty OPS – Saltstack Introduction
By Walter Liu 2013/12/24
Before Saltstack
(This section is borrowed slides from slideshare)
Basics
Commands and misc
Basic components
 Salt-master
 Salt-minion
 Salt-syndic: for large deployment or cross data-center.
Basic files of Salt
 Configuration files
 /etc/salt/master
 /etc/salt/minion
 /etc/salt/minion_id (generated when first time start daemon)
 /etc/salt/pki/ (generated when first time start daemon)

 Log: /var/log/salt/
 GITFS cache: /var/cache/salt/master/gitfs/refs/master/
Basic command
 salt
 salt –v "*" test.ping
 salt –v –L “web1,web2” test.ping
 salt –v –E “web[12]” test.ping
 Salt –v –N group1 test.ping

 salt-key –a, salt-key -d
 salt-call
Update to newest state
 salt –v '*' state.highstate
Copy file to minions
 salt „*‟ cp.get_file salt://path/to/file /minion/path/to/file
 salt „*‟ cp.get_dir salt://path/to/dir/ /minion/path/to/dir/
Information commands
 salt '*' sys.doc [module]
 salt '*' grains.items
 salt '*' pillar.items
Package something and
Run command
 salt '*' pkg.install nginx
 salt '*' pkg.remove nginx
 salt '*' cmd.run ifconfig
Batch Size
 Use batch size to rolling web server restart.
 Example:
 salt “websvr*” –batch-size 25% apache.signal restart
 salt “websvr*” –batch-size 10 apache.signal restart
Troubleshooting and
Test your command
 Use salt-call to run locally
 Add test=True to just view what will be done.
 example:
 salt-call -l info state.highstate test=True
 salt '*' state.highstate test=True
 salt „testsvr01‟ state.sls nginx test=True

 Demo: Test failed. only salt-call could see the error.
Let‟s run some examples. 
Installation (CentOS)
 yum install salt-master
 yum install salt-minion
 yum install salt-api
 yum install python-halite

 Other OS
 wget -O - http://bootstrap.saltstack.org | sudo sh
Re-initialize demo environment
 salt "*" pkg.remove nginx
 salt “*” cmd.run “rm /etc/nginx/conf.d/*”
 salt-key -D
Add a new machine to Salt
 Minion: edit /etc/salt/minion
 Minion: hostname change to “www-01.dc1”
 Minion: service salt-minion start
 Master: salt-key -A
Configure installation in Salty way
 Master: edit /etc/salt/master
 Master: Add file top.sls
 Master: Add file nginx.sls
 Minion: salt-call -l debug state.highstate test=True
 Master: salt "*" state.highstate test=True
 Execute on master: salt "*" state.highstate
Add another new machine to salt
 Minion: Add another machine. (hostname)
 Master: salt "*" state.highstate
Add a managed config file
 Master: edit top.sls, add dc1 directives.
 Master: Add dc1/web.sls
 Master: Add conf/dc1/www.conf
 Master: salt "*" state.highstate
Add dc2 managed config file
 Master: edit top.sls, add dc1 directives.
 Master: Add dc2/web.sls
 Master: Add conf/dc2/www.conf
 Master: salt "*" state.highstate
Grains in short
 Key values items of minion hardware/env.
 Only acquire at salt-minion startup.
 May be used in sls/template.
 Let‟s see how to config by domain/hostname.






Master: salt „*‟ grains.items
Master: Add web_general/web.sls
Master: Modify top.sls
Master: Add conf/dc3/www.conf
Master: salt-call „*.dc3‟ highstate test=True
Pillar in short
 Usage
 Highly Sensitive Data
 Minion Configuration
 Variables
 Arbitrary Data

 Example,
 DB username, password
 Configure config file by hostname
GITFS
 /etc/salt/master, change below configuration
 fileserver_backend:
- git
 Gitfs_remotes:
- git@gitlab……..

 salt-run fileserver.update
 Another method: Or only use gitfs to host config files.
Check config before restart
 Application support check config in service reload
(“init.d”).
 Return error code if failed.

 Use cmd.wait:


- name: ”nginx -s reload” # do reload



- onlyif: “nginx -t” # test if config is ok.



- watch:



- file: /etc/nginx/conf.d/my_web.conf
Collaboration
 RD
 Installation sls: “nginx.sls”
 User Config sls: “web_general/web.sls”
 User Config template: “www_redis.conf.template”

 OPS
 top.sls
 pillar/top.sls
Reference for writing SLS
 Salt Formulars on github
 https://github.com/saltstack-formulas

 Salt-states on github
 https://github.com/saltstack/salt-states
Halite
 Demo Web UI
Salty OPS – Saltstack Introduction

Mais conteúdo relacionado

Mais procurados

Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to AnsibleCoreStack
 
Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with AnsibleMartin Etmajer
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction Robert Reiz
 
PostgreSQL continuous backup and PITR with Barman
 PostgreSQL continuous backup and PITR with Barman PostgreSQL continuous backup and PITR with Barman
PostgreSQL continuous backup and PITR with BarmanEDB
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practicesBas Meijer
 
Getting started with Ansible
Getting started with AnsibleGetting started with Ansible
Getting started with AnsibleIvan Serdyuk
 
Configuration management I - Ansible + Packer
Configuration management I - Ansible + PackerConfiguration management I - Ansible + Packer
Configuration management I - Ansible + PackerXavier Serrat Bordas
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricksbcoca
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationKumar Y
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to ChefKnoldus Inc.
 
Comprehensive Terraform Training
Comprehensive Terraform TrainingComprehensive Terraform Training
Comprehensive Terraform TrainingYevgeniy Brikman
 
DevOps Meetup ansible
DevOps Meetup   ansibleDevOps Meetup   ansible
DevOps Meetup ansiblesriram_rajan
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basicsManav Prasad
 

Mais procurados (20)

Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
Ansible
AnsibleAnsible
Ansible
 
Ansible - Introduction
Ansible - IntroductionAnsible - Introduction
Ansible - Introduction
 
Automating with Ansible
Automating with AnsibleAutomating with Ansible
Automating with Ansible
 
Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with Ansible
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
Ansible 101
Ansible 101Ansible 101
Ansible 101
 
PostgreSQL continuous backup and PITR with Barman
 PostgreSQL continuous backup and PITR with Barman PostgreSQL continuous backup and PITR with Barman
PostgreSQL continuous backup and PITR with Barman
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practices
 
Ansible
AnsibleAnsible
Ansible
 
Getting started with Ansible
Getting started with AnsibleGetting started with Ansible
Getting started with Ansible
 
Configuration management I - Ansible + Packer
Configuration management I - Ansible + PackerConfiguration management I - Ansible + Packer
Configuration management I - Ansible + Packer
 
Ansible
AnsibleAnsible
Ansible
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
Comprehensive Terraform Training
Comprehensive Terraform TrainingComprehensive Terraform Training
Comprehensive Terraform Training
 
DevOps Meetup ansible
DevOps Meetup   ansibleDevOps Meetup   ansible
DevOps Meetup ansible
 
MySQL8.0 in COSCUP2017
MySQL8.0 in COSCUP2017MySQL8.0 in COSCUP2017
MySQL8.0 in COSCUP2017
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basics
 

Destaque

Using SaltStack to orchestrate microservices in application containers at Sal...
Using SaltStack to orchestrate microservices in application containers at Sal...Using SaltStack to orchestrate microservices in application containers at Sal...
Using SaltStack to orchestrate microservices in application containers at Sal...Love Nyberg
 
[TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)
[TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)[TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)
[TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)Blazeclan Technologies Private Limited
 
Orchestrate Event-Driven Infrastructure with SaltStack
Orchestrate Event-Driven Infrastructure with SaltStackOrchestrate Event-Driven Infrastructure with SaltStack
Orchestrate Event-Driven Infrastructure with SaltStackLove Nyberg
 
Introduction to Systems Management with SaltStack
Introduction to Systems Management with SaltStackIntroduction to Systems Management with SaltStack
Introduction to Systems Management with SaltStackCraig Sebenik
 
SaltConf 2014: Safety with powertools
SaltConf 2014: Safety with powertoolsSaltConf 2014: Safety with powertools
SaltConf 2014: Safety with powertoolsThomas Jackson
 
Real-time Cloud Management with SaltStack
Real-time Cloud Management with SaltStackReal-time Cloud Management with SaltStack
Real-time Cloud Management with SaltStackSaltStack
 
SaltConf 2015: Salt stack at web scale: Better, Stronger, Faster
SaltConf 2015: Salt stack at web scale: Better, Stronger, FasterSaltConf 2015: Salt stack at web scale: Better, Stronger, Faster
SaltConf 2015: Salt stack at web scale: Better, Stronger, FasterThomas Jackson
 
Test driven infrastructure avec Docker
Test driven infrastructure avec DockerTest driven infrastructure avec Docker
Test driven infrastructure avec DockerSéven Le Mesle
 
Understanding salt modular sub-systems and customization
Understanding salt   modular sub-systems and customizationUnderstanding salt   modular sub-systems and customization
Understanding salt modular sub-systems and customizationjasondenning
 
Saltconf 2016: Salt stack transport and concurrency
Saltconf 2016: Salt stack transport and concurrencySaltconf 2016: Salt stack transport and concurrency
Saltconf 2016: Salt stack transport and concurrencyThomas Jackson
 
Getting started with salt stack
Getting started with salt stackGetting started with salt stack
Getting started with salt stackSuresh Paulraj
 
Bitfusion Saltconf16 - Seamless Docker Orchestration with SaltStack
Bitfusion Saltconf16 - Seamless Docker Orchestration with SaltStackBitfusion Saltconf16 - Seamless Docker Orchestration with SaltStack
Bitfusion Saltconf16 - Seamless Docker Orchestration with SaltStackSubbu Rama
 
The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016effie mouzeli
 
Demystifying CSS & WordPress
Demystifying CSS & WordPressDemystifying CSS & WordPress
Demystifying CSS & WordPressJustin Carmony
 
Automate your development environment with Jira and Saltstack
Automate your development environment with Jira and SaltstackAutomate your development environment with Jira and Saltstack
Automate your development environment with Jira and SaltstackNetworkedAssets
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltStack
 
Deploying Foreman in Enterprise Environments
Deploying Foreman in Enterprise EnvironmentsDeploying Foreman in Enterprise Environments
Deploying Foreman in Enterprise Environmentsinovex GmbH
 

Destaque (20)

Using SaltStack to orchestrate microservices in application containers at Sal...
Using SaltStack to orchestrate microservices in application containers at Sal...Using SaltStack to orchestrate microservices in application containers at Sal...
Using SaltStack to orchestrate microservices in application containers at Sal...
 
[TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)
[TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)[TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)
[TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)
 
Orchestrate Event-Driven Infrastructure with SaltStack
Orchestrate Event-Driven Infrastructure with SaltStackOrchestrate Event-Driven Infrastructure with SaltStack
Orchestrate Event-Driven Infrastructure with SaltStack
 
Introduction to Systems Management with SaltStack
Introduction to Systems Management with SaltStackIntroduction to Systems Management with SaltStack
Introduction to Systems Management with SaltStack
 
SaltConf 2014: Safety with powertools
SaltConf 2014: Safety with powertoolsSaltConf 2014: Safety with powertools
SaltConf 2014: Safety with powertools
 
Real-time Cloud Management with SaltStack
Real-time Cloud Management with SaltStackReal-time Cloud Management with SaltStack
Real-time Cloud Management with SaltStack
 
SaltConf 2015: Salt stack at web scale: Better, Stronger, Faster
SaltConf 2015: Salt stack at web scale: Better, Stronger, FasterSaltConf 2015: Salt stack at web scale: Better, Stronger, Faster
SaltConf 2015: Salt stack at web scale: Better, Stronger, Faster
 
Test driven infrastructure avec Docker
Test driven infrastructure avec DockerTest driven infrastructure avec Docker
Test driven infrastructure avec Docker
 
Understanding salt modular sub-systems and customization
Understanding salt   modular sub-systems and customizationUnderstanding salt   modular sub-systems and customization
Understanding salt modular sub-systems and customization
 
Saltconf 2016: Salt stack transport and concurrency
Saltconf 2016: Salt stack transport and concurrencySaltconf 2016: Salt stack transport and concurrency
Saltconf 2016: Salt stack transport and concurrency
 
Puppet on AWS
Puppet on AWSPuppet on AWS
Puppet on AWS
 
Getting started with salt stack
Getting started with salt stackGetting started with salt stack
Getting started with salt stack
 
Bitfusion Saltconf16 - Seamless Docker Orchestration with SaltStack
Bitfusion Saltconf16 - Seamless Docker Orchestration with SaltStackBitfusion Saltconf16 - Seamless Docker Orchestration with SaltStack
Bitfusion Saltconf16 - Seamless Docker Orchestration with SaltStack
 
The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016
 
Demystifying CSS & WordPress
Demystifying CSS & WordPressDemystifying CSS & WordPress
Demystifying CSS & WordPress
 
Salt stack
Salt stackSalt stack
Salt stack
 
Demystifying kubernetes
Demystifying kubernetesDemystifying kubernetes
Demystifying kubernetes
 
Automate your development environment with Jira and Saltstack
Automate your development environment with Jira and SaltstackAutomate your development environment with Jira and Saltstack
Automate your development environment with Jira and Saltstack
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
 
Deploying Foreman in Enterprise Environments
Deploying Foreman in Enterprise EnvironmentsDeploying Foreman in Enterprise Environments
Deploying Foreman in Enterprise Environments
 

Semelhante a Salty OPS – Saltstack Introduction

Configuration management and orchestration with Salt
Configuration management and orchestration with SaltConfiguration management and orchestration with Salt
Configuration management and orchestration with SaltAnirban Saha
 
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...SaltStack
 
Configuration Management with Saltstack
Configuration Management with SaltstackConfiguration Management with Saltstack
Configuration Management with Saltstackinovex GmbH
 
A user's perspective on SaltStack and other configuration management tools
A user's perspective on SaltStack and other configuration management toolsA user's perspective on SaltStack and other configuration management tools
A user's perspective on SaltStack and other configuration management toolsSaltStack
 
SaltStack Configuration Management
SaltStack Configuration ManagementSaltStack Configuration Management
SaltStack Configuration ManagementNathan Sickler
 
Configuration Management and Salt
Configuration Management and SaltConfiguration Management and Salt
Configuration Management and Salt55020
 
Saltstack for Ansible users
Saltstack for Ansible usersSaltstack for Ansible users
Saltstack for Ansible usersPaul Traylor
 
Testing Salt States (part 1)
Testing Salt States (part 1)Testing Salt States (part 1)
Testing Salt States (part 1)jasondenning
 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginnersbryanbibat
 
Event driven architecture with SaltStack
Event driven architecture with SaltStackEvent driven architecture with SaltStack
Event driven architecture with SaltStackBharatNailwal2
 
Automating deployments from GitHub using SaltStack
Automating deployments from GitHub using SaltStackAutomating deployments from GitHub using SaltStack
Automating deployments from GitHub using SaltStackLINE Corporation
 
OSBConf 2015 | Live demonstration of tying together git, slat and bareos bacu...
OSBConf 2015 | Live demonstration of tying together git, slat and bareos bacu...OSBConf 2015 | Live demonstration of tying together git, slat and bareos bacu...
OSBConf 2015 | Live demonstration of tying together git, slat and bareos bacu...NETWAYS
 
OSCamp #4 on Foreman | Salted Foreman by Bernhard Suttner
OSCamp #4 on Foreman | Salted Foreman by Bernhard SuttnerOSCamp #4 on Foreman | Salted Foreman by Bernhard Suttner
OSCamp #4 on Foreman | Salted Foreman by Bernhard SuttnerNETWAYS
 
HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?Alessandro Nadalin
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabSoftware Guru
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Dana Luther
 
Saltcheck: a tool in the salt toolbox
Saltcheck: a tool in the salt toolboxSaltcheck: a tool in the salt toolbox
Saltcheck: a tool in the salt toolboxChristian McHugh
 
Converting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaConverting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaDana Luther
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Brian K. Vagnini
 

Semelhante a Salty OPS – Saltstack Introduction (20)

Configuration management and orchestration with Salt
Configuration management and orchestration with SaltConfiguration management and orchestration with Salt
Configuration management and orchestration with Salt
 
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
 
Configuration Management with Saltstack
Configuration Management with SaltstackConfiguration Management with Saltstack
Configuration Management with Saltstack
 
A user's perspective on SaltStack and other configuration management tools
A user's perspective on SaltStack and other configuration management toolsA user's perspective on SaltStack and other configuration management tools
A user's perspective on SaltStack and other configuration management tools
 
SaltStack Configuration Management
SaltStack Configuration ManagementSaltStack Configuration Management
SaltStack Configuration Management
 
Configuration Management and Salt
Configuration Management and SaltConfiguration Management and Salt
Configuration Management and Salt
 
Saltstack for Ansible users
Saltstack for Ansible usersSaltstack for Ansible users
Saltstack for Ansible users
 
Testing Salt States (part 1)
Testing Salt States (part 1)Testing Salt States (part 1)
Testing Salt States (part 1)
 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginners
 
Event driven architecture with SaltStack
Event driven architecture with SaltStackEvent driven architecture with SaltStack
Event driven architecture with SaltStack
 
Automating deployments from GitHub using SaltStack
Automating deployments from GitHub using SaltStackAutomating deployments from GitHub using SaltStack
Automating deployments from GitHub using SaltStack
 
OSBConf 2015 | Live demonstration of tying together git, slat and bareos bacu...
OSBConf 2015 | Live demonstration of tying together git, slat and bareos bacu...OSBConf 2015 | Live demonstration of tying together git, slat and bareos bacu...
OSBConf 2015 | Live demonstration of tying together git, slat and bareos bacu...
 
OSCamp #4 on Foreman | Salted Foreman by Bernhard Suttner
OSCamp #4 on Foreman | Salted Foreman by Bernhard SuttnerOSCamp #4 on Foreman | Salted Foreman by Bernhard Suttner
OSCamp #4 on Foreman | Salted Foreman by Bernhard Suttner
 
HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con Gitlab
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]
 
Saltstack with Zabbix
Saltstack with ZabbixSaltstack with Zabbix
Saltstack with Zabbix
 
Saltcheck: a tool in the salt toolbox
Saltcheck: a tool in the salt toolboxSaltcheck: a tool in the salt toolbox
Saltcheck: a tool in the salt toolbox
 
Converting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaConverting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - Cascadia
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615
 

Mais de Walter Liu

Generative AI 在手機遊戲發行上的應用介紹.pdf
Generative AI 在手機遊戲發行上的應用介紹.pdfGenerative AI 在手機遊戲發行上的應用介紹.pdf
Generative AI 在手機遊戲發行上的應用介紹.pdfWalter Liu
 
Infrastructure as code using Kubernetes
Infrastructure as code using KubernetesInfrastructure as code using Kubernetes
Infrastructure as code using KubernetesWalter Liu
 
手機遊戲數位行銷工具淺談
手機遊戲數位行銷工具淺談手機遊戲數位行銷工具淺談
手機遊戲數位行銷工具淺談Walter Liu
 
關於第三方追蹤廣告再行銷的那些事兒
關於第三方追蹤廣告再行銷的那些事兒關於第三方追蹤廣告再行銷的那些事兒
關於第三方追蹤廣告再行銷的那些事兒Walter Liu
 
Kubernetes Workshop
Kubernetes WorkshopKubernetes Workshop
Kubernetes WorkshopWalter Liu
 
Using Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCPUsing Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCPWalter Liu
 
Game DDOS Prevention
Game DDOS PreventionGame DDOS Prevention
Game DDOS PreventionWalter Liu
 
Airflow - a data flow engine
Airflow - a data flow engineAirflow - a data flow engine
Airflow - a data flow engineWalter Liu
 
Super Fast Gevent Introduction
Super Fast Gevent IntroductionSuper Fast Gevent Introduction
Super Fast Gevent IntroductionWalter Liu
 
HTTP/2 to web dev
HTTP/2 to web devHTTP/2 to web dev
HTTP/2 to web devWalter Liu
 
HTTP/2 Introduction
HTTP/2 IntroductionHTTP/2 Introduction
HTTP/2 IntroductionWalter Liu
 
Consul - service discovery and others
Consul - service discovery and othersConsul - service discovery and others
Consul - service discovery and othersWalter Liu
 
Docker introduction
Docker introductionDocker introduction
Docker introductionWalter Liu
 
WRS GIT Branching Model - draft
WRS GIT Branching Model - draftWRS GIT Branching Model - draft
WRS GIT Branching Model - draftWalter Liu
 
Django deployment and rpm+yum
Django deployment and rpm+yumDjango deployment and rpm+yum
Django deployment and rpm+yumWalter Liu
 
Game Localization in Python
Game Localization in PythonGame Localization in Python
Game Localization in PythonWalter Liu
 
Service production from d3 pitfall viewpoint
Service production from d3 pitfall viewpointService production from d3 pitfall viewpoint
Service production from d3 pitfall viewpointWalter Liu
 
Celery in the Django
Celery in the DjangoCelery in the Django
Celery in the DjangoWalter Liu
 

Mais de Walter Liu (18)

Generative AI 在手機遊戲發行上的應用介紹.pdf
Generative AI 在手機遊戲發行上的應用介紹.pdfGenerative AI 在手機遊戲發行上的應用介紹.pdf
Generative AI 在手機遊戲發行上的應用介紹.pdf
 
Infrastructure as code using Kubernetes
Infrastructure as code using KubernetesInfrastructure as code using Kubernetes
Infrastructure as code using Kubernetes
 
手機遊戲數位行銷工具淺談
手機遊戲數位行銷工具淺談手機遊戲數位行銷工具淺談
手機遊戲數位行銷工具淺談
 
關於第三方追蹤廣告再行銷的那些事兒
關於第三方追蹤廣告再行銷的那些事兒關於第三方追蹤廣告再行銷的那些事兒
關於第三方追蹤廣告再行銷的那些事兒
 
Kubernetes Workshop
Kubernetes WorkshopKubernetes Workshop
Kubernetes Workshop
 
Using Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCPUsing Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCP
 
Game DDOS Prevention
Game DDOS PreventionGame DDOS Prevention
Game DDOS Prevention
 
Airflow - a data flow engine
Airflow - a data flow engineAirflow - a data flow engine
Airflow - a data flow engine
 
Super Fast Gevent Introduction
Super Fast Gevent IntroductionSuper Fast Gevent Introduction
Super Fast Gevent Introduction
 
HTTP/2 to web dev
HTTP/2 to web devHTTP/2 to web dev
HTTP/2 to web dev
 
HTTP/2 Introduction
HTTP/2 IntroductionHTTP/2 Introduction
HTTP/2 Introduction
 
Consul - service discovery and others
Consul - service discovery and othersConsul - service discovery and others
Consul - service discovery and others
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
WRS GIT Branching Model - draft
WRS GIT Branching Model - draftWRS GIT Branching Model - draft
WRS GIT Branching Model - draft
 
Django deployment and rpm+yum
Django deployment and rpm+yumDjango deployment and rpm+yum
Django deployment and rpm+yum
 
Game Localization in Python
Game Localization in PythonGame Localization in Python
Game Localization in Python
 
Service production from d3 pitfall viewpoint
Service production from d3 pitfall viewpointService production from d3 pitfall viewpoint
Service production from d3 pitfall viewpoint
 
Celery in the Django
Celery in the DjangoCelery in the Django
Celery in the Django
 

Último

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 

Último (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 

Salty OPS – Saltstack Introduction

  • 1. Salty OPS – Saltstack Introduction By Walter Liu 2013/12/24
  • 2. Before Saltstack (This section is borrowed slides from slideshare)
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 15. Basic components  Salt-master  Salt-minion  Salt-syndic: for large deployment or cross data-center.
  • 16. Basic files of Salt  Configuration files  /etc/salt/master  /etc/salt/minion  /etc/salt/minion_id (generated when first time start daemon)  /etc/salt/pki/ (generated when first time start daemon)  Log: /var/log/salt/  GITFS cache: /var/cache/salt/master/gitfs/refs/master/
  • 17. Basic command  salt  salt –v "*" test.ping  salt –v –L “web1,web2” test.ping  salt –v –E “web[12]” test.ping  Salt –v –N group1 test.ping  salt-key –a, salt-key -d  salt-call
  • 18. Update to newest state  salt –v '*' state.highstate
  • 19. Copy file to minions  salt „*‟ cp.get_file salt://path/to/file /minion/path/to/file  salt „*‟ cp.get_dir salt://path/to/dir/ /minion/path/to/dir/
  • 20. Information commands  salt '*' sys.doc [module]  salt '*' grains.items  salt '*' pillar.items
  • 21. Package something and Run command  salt '*' pkg.install nginx  salt '*' pkg.remove nginx  salt '*' cmd.run ifconfig
  • 22. Batch Size  Use batch size to rolling web server restart.  Example:  salt “websvr*” –batch-size 25% apache.signal restart  salt “websvr*” –batch-size 10 apache.signal restart
  • 23. Troubleshooting and Test your command  Use salt-call to run locally  Add test=True to just view what will be done.  example:  salt-call -l info state.highstate test=True  salt '*' state.highstate test=True  salt „testsvr01‟ state.sls nginx test=True  Demo: Test failed. only salt-call could see the error.
  • 24. Let‟s run some examples. 
  • 25. Installation (CentOS)  yum install salt-master  yum install salt-minion  yum install salt-api  yum install python-halite  Other OS  wget -O - http://bootstrap.saltstack.org | sudo sh
  • 26. Re-initialize demo environment  salt "*" pkg.remove nginx  salt “*” cmd.run “rm /etc/nginx/conf.d/*”  salt-key -D
  • 27. Add a new machine to Salt  Minion: edit /etc/salt/minion  Minion: hostname change to “www-01.dc1”  Minion: service salt-minion start  Master: salt-key -A
  • 28. Configure installation in Salty way  Master: edit /etc/salt/master  Master: Add file top.sls  Master: Add file nginx.sls  Minion: salt-call -l debug state.highstate test=True  Master: salt "*" state.highstate test=True  Execute on master: salt "*" state.highstate
  • 29. Add another new machine to salt  Minion: Add another machine. (hostname)  Master: salt "*" state.highstate
  • 30. Add a managed config file  Master: edit top.sls, add dc1 directives.  Master: Add dc1/web.sls  Master: Add conf/dc1/www.conf  Master: salt "*" state.highstate
  • 31. Add dc2 managed config file  Master: edit top.sls, add dc1 directives.  Master: Add dc2/web.sls  Master: Add conf/dc2/www.conf  Master: salt "*" state.highstate
  • 32. Grains in short  Key values items of minion hardware/env.  Only acquire at salt-minion startup.  May be used in sls/template.  Let‟s see how to config by domain/hostname.      Master: salt „*‟ grains.items Master: Add web_general/web.sls Master: Modify top.sls Master: Add conf/dc3/www.conf Master: salt-call „*.dc3‟ highstate test=True
  • 33. Pillar in short  Usage  Highly Sensitive Data  Minion Configuration  Variables  Arbitrary Data  Example,  DB username, password  Configure config file by hostname
  • 34. GITFS  /etc/salt/master, change below configuration  fileserver_backend: - git  Gitfs_remotes: - git@gitlab……..  salt-run fileserver.update  Another method: Or only use gitfs to host config files.
  • 35. Check config before restart  Application support check config in service reload (“init.d”).  Return error code if failed.  Use cmd.wait:  - name: ”nginx -s reload” # do reload  - onlyif: “nginx -t” # test if config is ok.  - watch:  - file: /etc/nginx/conf.d/my_web.conf
  • 36. Collaboration  RD  Installation sls: “nginx.sls”  User Config sls: “web_general/web.sls”  User Config template: “www_redis.conf.template”  OPS  top.sls  pillar/top.sls
  • 37. Reference for writing SLS  Salt Formulars on github  https://github.com/saltstack-formulas  Salt-states on github  https://github.com/saltstack/salt-states

Notas do Editor

  1. Other OS installation script supportedAmazon Linux 2012.09ArchCentOS 5/6Debian 6.x/7.xFedora 17/18FreeBSD 9.1GentooLinaroLinux Mint 13/14OpenSUSE 12.xRed Hat 5/6Red Hat Enterprise 5/6SmartOSSuSE 11 SP1/11 SP2Ubuntu 10.x/11.x/12.x/13.04/13.10