Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ops Tool made by Perl Beginner #yapcasia 2012
Search
riywo
September 28, 2012
Programming
5
28k
Ops Tool made by Perl Beginner #yapcasia 2012
You can talk using this slide without any permission:)
riywo
September 28, 2012
Tweet
Share
More Decks by riywo
See All by riywo
Monitoring Casual #2
riywo
1
390
ServerSchemaCoreAPI
riywo
0
1.5k
Most Powerful High Availability / Load Balancing #yapcasia 2012
riywo
3
3.6k
Other Decks in Programming
See All in Programming
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
110
初めてDefinitelyTypedにPRを出した話
syumai
0
400
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.7k
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
220
Jakarta EE meets AI
ivargrimstad
0
120
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
RubyLSPのマルチバイト文字対応
notfounds
0
120
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
280
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1k
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Gamification - CAS2011
davidbonilla
80
5k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
KATA
mclloyd
29
14k
Transcript
Ops Tool made by Perl Beginner @riywo Sep, 28, 2012
YAPC::Asia 2012
@riywo
http://www.publicdomainpictures.net/view-image.php?image=4314&picture=t-shirt-image
None
Perl Beginner
I Love Cats
DataBase Engineer MySQL
Operation Engineer DevOps
Operation Engineer?
Trouble Shooting Design System Setup Server On Calling Isu nage
Sync Info Operation Inspection Develop Tools Capacity Plan
Trouble Shooting Design System Setup Server On Calling Isu nage?
Sync Info Operation Inspection Develop Tools Capacity Plan
=Throwing Chair :-p
F*cking Query SELECT SQL_CALC_FOUD_ROWS * FROM table WHERE c1 >
1000 OR c2 != 100 ORDER BY c3 LIMIT 10 OFFSET 100000;
http://www.flickr.com/photos/andrew_freese/2200774154/ Operation Engineer
dev> I did nothing..., but....
ops> What did you do? dev> I did nothing..., but....
http://www.flickr.com/photos/jaydoubleyougee/2259260845/ Operation Engineer
I Love Cats
But...., do they only happen in Dev side?
Operation Error!!!!!!!!!!!!!
Operation Mistake # rm -fr /tmp/* # rm -fr /
tmp/*
Capacity Over Sorry, we have no more servers....
...and... Setup Error
server_id = 1212 default_character_set=sjis innodb_buffer_pool_size=2G server_id = 1213 default_character_set=utf8 innodb_buffer_pool_size=3G
Can’t copy the same file to all servers => edit
manually
Can’t copy the same file to all servers => edit
manually M istake!!!
Current servers’ sysctl changed But setup operation did not follow
it...
Current servers’ sysctl changed But setup operation did not follow
it... M istake!!!
http://www.flickr.com/photos/clickflashphotos/3402287993/
Why? Are you a Professional?
Someone has “Setup Procedure Manual” 1. OS install 1.1 IP
address 1.2 nameserver 1.3 OS user 2. SSH Configuration 2.1 ... 3. Install Perl 3.1 ...
Someone have “Setup Procedure Manual” 1. OS install 1.1 IP
address 1.2 nameserver 1.3 OS user 2. SSH Configuration 2.1 ... 3. Install Perl 3.1 ... Operate Manually Check Visually
# ssh $TGT cat /etc/my.cnf | diff -u /etc/my.cnf -
- server_id = 2323 + server_id = 2324 - log_slave_updaets Yes, this difference is OK If $TGT is Master DB this difference is NG
# ssh $TGT cat /etc/my.cnf | diff -u /etc/my.cnf -
- server_id = 2323 + server_id = 2324 - log_slave_updaets Yes, this difference is OK If $TGT is Master DB this difference is NG Impossible
OK, Setup scripts help us!
OK, Setup scripts help us! ✗
Patch, Patch, Patch... patch for a new component many times,
setup script become a spaghetti code...
Script Bug OpsEngi usually not good at programing, the script
will have many many bugs...
Unfollow current change For trouble, servers’ config were changed, but
setup script isn’t changed...
No Test!!!! F*ck!!! usually setup script is simple shell script,
only listed exec commands no test
No Test!!!! F*ck!!! usually setup script is simple shell script,
only listed exec commands no test
Check return code Check status of servers ✗
Describe
Server Correct Status /etc/sysconfig/ /etc/my.cnf /etc/sysctrl.conf /etc/ssh/ssh_config / /etc/cron.d /etc/resolv.conf
/etc/yum.repos.d/ /service/app/run chkconfig ulimit httpd.conf rpms
If you describe the correct status you can also test
current servers!
Correct Status New Server Server Server Server Server Server
Correct Status New Server Server Server Server Server Server Test
Setup
Break Time :) Remain 10min?
Correct Status New Server Server Server Server Server Server Test
Setup
http://www.flickr.com/photos/stocktoc/4539506889/ Touryo ౩ྊNBTUFS DBSQFOUFSPGTFSWFST
Describe
Orchestration Configuration Bootstrapping Server Setup
Orchestration Configuration Bootstrapping Server Setup Data sync, LB configuration OS
install
Orchestration Configuration Bootstrapping Server Setup Configure, Install Middleware
Describe test/setup procedures DSL = blueprint.pl (cron,httpd,mysql,...) test { my
$c = shift; ok ... }; run { my $c = shift; $c->ssh(...) };
server_id = <: $server_id :> default_character_set= <: $char :> Server’s
my.cnf Text::Xslate::render Test example diff
server_id = <: $server_id :> default_character_set= <: $char :> Server’s
my.cnf Text::Xslate::render Run example SSH install
server1 => mbga:web server2 => mbga:db:master server3 => game1:web Describe
role of nodes
Describe blueprints of roles mbga:web => [cron, httpd] mbga:db:master =>
[cron, mysql] game1:web => [cron, httpd]
Describe attribute of roles mbga:web => { cron_hour => 1,
proc_num => 50, } mbga:db:master => {...} game1:web => {...}
How to develop?
Make time
Research
Small snippet
Ask Devs!
Lessons for Manage Tool Development
Maintenance Can you hand over its maintenance?
Touryo blueprint are written by other staffs :)
Simple The UNIX philosophy
Touryo only care about server configuration. Combine other tools ex.
AdminTool(node-role)
Replace Is it able to replace easily?
By Touryo, undocumented procedures have been described. Easier to replace!
Any Questions?
Thanks!
@riywo blog.riywo.com weblog.riywo.com