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
29k
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
400
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
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
750
fs2-io を試してたらバグを見つけて直した話
chencmd
0
270
テストコード書いてみませんか?
onopon
2
270
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
6
1.3k
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
130
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
770
Spatial Rendering for Apple Vision Pro
warrenm
0
290
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
220
HTML/CSS超絶浅い説明
yuki0329
0
100
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
980
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
840
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
8
1.7k
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
46
7k
Six Lessons from altMBA
skipperchong
27
3.5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Documentation Writing (for coders)
carmenintech
67
4.5k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
Statistics for Hackers
jakevdp
796
220k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
A Modern Web Designer's Workflow
chriscoyier
693
190k
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