解密解密

115
薹薹 吚舙ᑀದ萬蔩 [email protected]

Upload: tom-chen

Post on 21-Apr-2017

895 views

Category:

Engineering


0 download

TRANSCRIPT

Page 2: 解密解密
Page 3: 解密解密
Page 4: 解密解密

( DevOps T.T)

Page 5: 解密解密

20 !

Page 6: 解密解密

http://www.inside.com.tw/2013/12/20/59-hilarious-but-true-programming-quotes-for-software-developers

orz

Page 7: 解密解密
Page 8: 解密解密

• Server•

• ID •

Page 9: 解密解密

Server

Page 10: 解密解密

: , : Server

, , ISP

- / ( ) / ...

Page 11: 解密解密

: Server : HA (High Availability)

DRBD + Heartbeat Active-Passive HA

10.0.0.101 10.0.0.102

IP (VIP)10.0.0.100 IP

, (transparent)

* 101/102 IP

DRBD MySQL (samba)

Page 12: 解密解密

...

Page 13: 解密解密

: wifi or 4G : , Server/

MySQL Read-only Replica

server server

server, ,

Page 14: 解密解密

server DRBD + heartbeat

serverRead-only replica

DB

Internet

LAN

ID

Page 15: 解密解密

(Read/Write)?

: Primary (Active) Write, Secondary (Passive) Read

Page 16: 解密解密

ID

Django Server(HTTP API Server)

• ( / JPG)•• ( / )• / / •• (Session)•Insnergy •Infographics

Page 17: 解密解密

• Session, , • ( / RFID ) Session • Session • RFID • ,

Page 18: 解密解密

serverRead-only replica

DBredis slave

server DRBD + heartbeat

django django-rest-framework

django django-rest-framework django-allauth (social)

only ( )django django-rest-framework

(read-only)

Page 19: 解密解密

• Server•

• ID •

Page 20: 解密解密
Page 21: 解密解密

,

Page 22: 解密解密

AP, 200+ , 10

Page 23: 解密解密

AP Switch

Page 24: 解密解密

Router!!!

Page 25: 解密解密

10.0.0.X

10.0.1.XA/B ( / )

10.0.3.XC ( )

10.0.4.XD ( )

10.0.5.XE ( )

10.0.6.XF ( )

10.0.7.XG ( )

Lab Internal &

+

1 ( ) 2 ( )

x15

Page 26: 解密解密
Page 27: 解密解密
Page 28: 解密解密
Page 29: 解密解密

(A-G) X (EX2)

Page 30: 解密解密

IP

Page 31: 解密解密

ABCDEFG X

EX2 ( )

10.0.X.YX A-G , 1-7

Y , 101 EX2 IP 10.0.5.102

Page 32: 解密解密

?

Page 33: 解密解密

orz

Page 34: 解密解密

DEMO!

Page 35: 解密解密

• Server•

• ID •

Page 36: 解密解密

ID

Page 37: 解密解密

: Plug & Play & Portable

1. ( / ) 2. 3. IP ( DHCP),

Page 38: 解密解密

QR code

Page 39: 解密解密

Bad Practice: Server IP & Port zeroconf / avahi , subnet

zeroconf / avahi, ID ,

Page 40: 解密解密

, ID

QR Code ,

ID

Page 41: 解密解密

QR Code /

Page 42: 解密解密

:

bug feature request ...

: Auto Update ID

Page 43: 解密解密

(HTTP API call)

git fetchgit checkout version_tag

Page 44: 解密解密

redis

Page 45: 解密解密

ID redis 1. 2. 3.

Page 46: 解密解密

ID

C2 C

magic packet

Page 47: 解密解密

IP, heartbeat server

Page 48: 解密解密
Page 49: 解密解密

Django (Web Server)

Page 50: 解密解密

Integration Test redis ID

Page 51: 解密解密

ID

••• RFID• QR Code• Session ••

• Auto Update • / • Heartbeat••

• (redis / QR)• (QR)• (redis)

Page 52: 解密解密

• Server•

• ID •

Page 53: 解密解密
Page 54: 解密解密

?

Page 55: 解密解密

Server

1. OS: + x2 (ubuntu server)2. HA: DRBD + heartbeat, zfs3. DB: MySQL (replica)4. MQ: redis 5. DNS: Domain 6. Web Server : nginx / Let’s Encrypt / Security Check7. Web App: Python Environment / git / python code8. samba ( )9.

https://www.ssllabs.com/ssltest/

Page 56: 解密解密

ProductionStagingDev

Development

http://www.webopedia.com/TERM/S/staging_server.html

Page 57: 解密解密

server

1. dev code, git2. server git code3. transpile (webpack) Babel, JSX, minify etc.4. Django collect static5. reload nginx

Page 58: 解密解密

ID : Auto Update

Page 59: 解密解密

, Prototype Auto Update

Auto Update bug GG!!!

Page 60: 解密解密

ID

1. dev code, git2. server ID machine version 3. ID

Page 61: 解密解密

Auto Update Auto Update?

Page 62: 解密解密
Page 63: 解密解密

: Copy & Paste orz..

Page 64: 解密解密

BT Sync (Now Resilio)

Page 65: 解密解密

Server (HTTP API)

Page 66: 解密解密

• Server•

• ID •

Page 67: 解密解密
Page 68: 解密解密
Page 69: 解密解密

? XD

Page 70: 解密解密
Page 71: 解密解密
Page 72: 解密解密

HTTPS

Page 73: 解密解密

SSL HTTPS

Page 74: 解密解密

: Wifi WEP

Wifi, (like: HTTPS)

Page 75: 解密解密

QR code ?

hash checksum

command.reboot.d87a

Page 76: 解密解密

QR Code?

Page 77: 解密解密

10.0.0.X

10.0.1.XA ( )

10.0.3.XC ( )

10.0.4.XD ( )

10.0.5.XE ( )

10.0.6.XF ( )

10.0.7.XG ( )

Lab Internal &

+

1 ( ) 2 ( )

x15

Page 78: 解密解密

+ : XSS / SQL Injection etc.

https://docs.djangoproject.com/ja/1.9/topics/security/

,

Page 79: 解密解密

Trade-off

Page 80: 解密解密

Server: , ,

: Server GG? Bottle neck Server

Page 81: 解密解密

Server: , loosely coupled

: Bottle neck Server , Server

Page 82: 解密解密

Subnet: ,

: , zeroconf / avahi

Page 83: 解密解密

MySQL Replica HTTP API Call: , MySQL ,

: Django ,

Page 84: 解密解密

ID unicast: , , Debug

:

Page 85: 解密解密

Database ( ) code?DB : , , :

: source control , : ,

Page 86: 解密解密

UDP TCP?UDP : , , : , TCP : , , : ,

Page 87: 解密解密

90% , , 90%

Page 88: 解密解密

(good practices)

Page 89: 解密解密

, code ... ...

Page 90: 解密解密

source control ...

Page 91: 解密解密

coding… 50 ...

...

Page 92: 解密解密

512 527 90% 501 511 525?

Page 93: 解密解密
Page 94: 解密解密
Page 95: 解密解密

/ Google / Facebook / KKBox / m01( )

Page 96: 解密解密
Page 97: 解密解密

Chrome ? Blizzard Agent ?MOD ? KKBox ?

Page 98: 解密解密

Thank youAny questions?

Page 99: 解密解密
Page 100: 解密解密

Scale

Page 101: 解密解密
Page 102: 解密解密
Page 103: 解密解密

C10K problemhttp://www.kegel.com/c10k.html

Page 104: 解密解密

( )

: — ( ) ( ) — ( ) ( ) — ( ) ( ) — ( )

Jack ( ) , , !

http://www.mobile01.com/topicdetail.php?f=507&t=1955864

Page 105: 解密解密

Server ?

Page 106: 解密解密

moment ?or ?

Page 107: 解密解密

HTTP API Server request ?

request?300 , Server ?

Page 108: 解密解密

Example: PyCon 2015 Bingo!

, Check

Page 109: 解密解密

300 & Check: , 15

Cache

Page 110: 解密解密
Page 111: 解密解密

CPU I/O?

? scale?

Page 112: 解密解密

Example: 101 25ms or 200ms

( HTTP request header overhead)

Page 113: 解密解密

Performance Tuning

Page 114: 解密解密

Sphinx

Page 115: 解密解密