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.5k
Other Decks in Programming
See All in Programming
The Sequel to a Dream of Ruby Parser's Grammar
ydah
1
180
令和トラベルにおけるLLM活用事例:社内ツール開発から得た学びと実践
ippo012
0
110
楽しく簡単に!QRコードの読み取り機能を実装しよう
penguinsan_pg
1
190
ゲームボーイアドバンスでSwiftを動かそう
k_koheyi
0
510
Swiftで高速フーリエ変換してオーディオビジュアライザーを作る / iOSDC Japan 2024 Day1 Track D
kyome22
2
460
Meet BrowserEngineKit
swiftty
0
190
RAGの回答精度評価用のQAデータセットを生成AIに作らせた話
kurahara
0
210
From Spring Boot 2 to Spring Boot 3 with Java 22 and Jakarta EE
ivargrimstad
0
930
Web技術を駆使してユーザーの画面を「録画」する
yukukotani
13
6.2k
【TID2024】模擬講義:プログラマと一緒にゲームをデザインしてみよう!
akatsukigames_tech
0
370
(非公開スライド追加)座談会 「Strict ConcurrencyとSwift 6が開く新時代: 私たちはどう生きるか?」
shiz
1
140
GoのIteratorに詳しくなってしまう
inatonix
1
170
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
270
40k
How to Think Like a Performance Engineer
csswizardry
15
910
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
27
1.6k
The Language of Interfaces
destraynor
153
23k
The Straight Up "How To Draw Better" Workshop
denniskardys
230
130k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Faster Mobile Websites
deanohume
304
30k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
25
1.3k
Embracing the Ebb and Flow
colly
83
4.4k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
27
7.4k
Scaling GitHub
holman
458
140k
A designer walks into a library…
pauljervisheath
201
24k
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