[ devpack IDE ]
devpack Cloud, PaaS PaaS 세상이오고있다 IDE Cloud IDE devpack redis 실습은 A~E 까지 5 개 Session Clustering 2
devpack + Cloud, PaaS 이야기 3
A devpack node-talk 4
A-1. git, cf CLI http://zetawiki.com/wiki/ 윈도우 _Git_ 설치 http://zetawiki.com/wiki/ 윈도우 _cf_cli_ 설치 Git cmd 창에서이렇게나오면성공 https://git-scm.com/download/win ( Git-2.x.x-64-bit.exe ) Git-2.x.x-64-bit.exe Next cf CLI https://cli.run.pivotal.io/stable?release=windows64 ( cf-cli-installer_6.x.x_winx64.zip ) cf_installer.exe Next 오늘실습에필요한프로그램을설치해봅시다. 5
A-2. node-talk http://zetawiki.com/wiki/cf 에 _node-talk_ 앱 _ 올려보기 _( 윈도우 ) mkdir \workspace cd \workspace git clone https://github.com/jmnote/node-talk.git cd node-talk http://devpack.co.kr frontier00 cf login -a https://api.devpack.co.kr cf push http://node-talk-xxx-xxx.devpack.co.kr git 으로소스코드다운로드 cf 로 devpack 에배포 6
Cloud? Cloud computing http://zetawiki.com/wiki/cloud, - NIST IT - IT IT API / endpoint, CLI 7
Cloud as a service SaaS PaaS IaaS On-Premises 오늘의주제 Cloud 반대개념 https://blogs.technet.microsoft.com/kevinremde/2011/04/03/saas-paas-and-iaas-oh-my-cloudy-april-part-3 8
IaaS vs PaaS 개발자는 Application 요리에집중하고싶다 대자연캠핑장글램핑호텔 ü SaaS 가더좋은거아님? ü 원래출처가어딘지는모르겠으나, IBM 공진기님의발표자료에서참고함 ü 이런근사한비유가있었다니 캠핑족이신가? 9
PaaS platform as a service Cloud 실행런타임, 웹서버, 개발도구, Cloud,, - Application FTP 로소스코드업로드하여사용하는웹호스팅과는무엇이어떻게다를까? 10
PaaS 개발자맞춤형 Cloud / WAS Cloud 정확히는컨테이너 + α, 웹서버, 패키지구성을소스코드처럼관리, 간편 scale out, 로드밸런서포함 : Cloud Foundry, OpenShift : devpack, PWS, Bluemix, ElasticBeanstalk, GAE PaaS IaaS PaaS 2 Layer IaaS(OS ) PaaS( ) 11
IaaS vs PaaS 구축, 증설기간대폭단축! On-Premises IaaS PaaS H/W, H/W, H/W, O/S / O/S / O/S / SW SW SW / / / 28 13 1 VM Container 7 2 0 정말? 12
vs PaaS 웹호스팅은 Cloud 일까? 아닐까? PaaS scale up, scale out API / / scale up, scale out API / / PHP 5.6 대신 7.0 버전을쓰고싶다. ( 왜?) 아파치 DOCUMENT_ROOT 경로를바꾸고싶다. 아파치대신 Nginx 를쓰고싶다. No Problem! 즉시적용가능 http://zetawiki.com/wiki/ 웹호스팅 _vs_paas 13
PaaS Load Balancer PaaS Load Balancer? OS MW DB scale out Web Web Router Router à WAS WAS App App? cloud storage (?) session clustering (?) DB NAS DB In-Memory Cache Storage à scale out 14
devpack [ 데브팩 ] develop + package ktds PaaS PaaS Cloud Foundry + 15
devpack ü ü ü ü ü Java, PHP, Python, Go, Node.js, Ruby 1GB 2 à 3TB MySQL, Redis 30MB Redis 1 앱인스턴스메모리최소단위가 1GB 라는얘기는아님 1MB 단위로설정할수있음간단한애플리케이션이라면 32MB 로도가능 32MB 라면월 1000 원이하 16
Cloud Foundry cloudfoundry.org PaaS 라우터 ( 로드밸런서, 도메인기반 ) 사용자인증 / 관리 애플리케이션보관 / 실행 부가서비스연동 미터링 https://docs.cloudfoundry.org/concepts/architecture/ 로그수합 17
, PaaS 랑뭔상관임? 결국다먹고살자고 App 배포하자고하는얘기 18
B node-talk 19
B-1. Node.js http://zetawiki.com/wiki/ 윈도우 _node.js_ 설치 https://nodejs.org/en/download/ Next CMD 에서해보는건그냥재미로 설치확인 파일실행 대화형 바로코드실행 20
B-2. npm node.js npm cd \workspace\node-talk npm install npm start http://localhost:3000 npm 으로필요패키지다운로드애플리케이션실행 21
여기서는웹애플리케이션프레임워크 http://zetawiki.com/wiki/ 프레임워크 http://zetawiki.com/wiki/ 웹애플리케이션 _ 프레임워크 22
& Go Revel, Martini, Gorilla gvt, godep Java Spring, Grails, Play Maven, Gradle Node.js React, AngularJS, Express.js, Meteor npm PHP Laravel, CakePHP, Symfony, Zend composer Python Django, Flask pip Ruby Rails, Sinatra RubyGems http://zetawiki.com/wiki/ 언어별 _ 웹애플리케이션프레임워크 http://zetawiki.com/wiki/ 언어별 _ 패키지매니저 23
node.js, npm node.js I/O V8 event libuv Non-blocking I/O HTTP. npm node.js node.js 24
socket.io node.js,, npm 25
Cloud Foundry, Java, Ruby, Node.js, Go, PHP, Python Spring, Symfony, Django, Rails, 실습 A 에서는빌드팩이 node.js 설치, npm 작업을해준것 26
Cloud IDE IDE 27
C IDE node-talk 28
C-1. IDE 구름으로소스코드가져오기 https://ide.goorm.io/ frontier00@goorm.io --- : node1 --- : Node.js --- [ ], [ ] --- --- (O) Git URL: https://github.com/jmnote/node-talk.git (O) --- [Test] --- [ ] : node-talk --- [ ] 29
C-2. devpack #1 구름 -> devpack 으로배포 https://ucloudbiz.olleh.com devpack Deployment --- Cloud Foundry --- Info User Name: frontier00 --- Password: devpack --- [Connect] Push --- [Push] --- [ ] http://node-talk-xxx-xxx.devpack.co.kr 30
C-3. groom 구름 IDE 에서실행하기 # npm install [ ] --- Alert [ ] --- (O) --- : server --- [ ], [ ] [ ] --- Server Domain [ ] URL: https://frontier00_node-talk.goorm.io --- [ ] --- [ ] https://frontier00_node-talk.goorm.io/ 31
C-4. 수정하고실행해보면 public app.js --- [ ] [ ], [Deploy][Push] 32
Cloud IDE 웹 IDE 즉, IDE를제공하는 SaaS이면서실행공간을제공하는 PaaS 성격도있음 SLA 33
IDE (codigm) IDE ( IDE, EDU, TEST) git / svn ( ), 34
devpack redis devpack 부가서비스중하나 35
D node-session 로그인기능만구현한간단한애플리케이션 36
D-1. node-session https://ide.goorm.io/ frontier00@goorm.io --- --- (O) Git URL: https://github.com/jmnote/node-session.git (O) --- [Test] --- [ ] : node-session --- [ ] 37
D-2. devpack, scale out manifest.yml host: session00 --- [ ] [Deploy] --- [Push] --- [ ] - 테스트 ( 로그인 / 로그아웃 / 페이지이동 ) CF Push # cf scale session -i 2 - 테스트 ( 로그인 / 로그아웃 / 페이지이동 ) scale out 했더니? 38
Redis http://zetawiki.com/wiki/ 레디스 _redis -, -, (MongoDB ) / 39
Session Clustering http://zetawiki. com/wiki/ 스티키 _ 세션 http://zetawiki. com/wiki/ 세션 _ 클러스터링 - PaaS 세션이언제죽는다고생각하나? 사람들에게서잊혀졌을때다!! Web WAS Load Balancer Web WAS WAS ) 1-WAS1 2-WAS2 Load Balancer 의분기알고리즘을 Source Hash 로하면이상없음. 단, 증설 감설시매핑관계가흐트러질수있음 Router Load Balancer Router App #1 App #2 In-Memory Cache Round Robin App #1, #2 그냥공유저장소면되는데세션정보는매번확인하므로성능을위해인메모리키 - 밸류스토어사용이권장되는것 40
- Laravel 다른프레임워크들도지원하는경우가많음예 ) http://zetawiki.com/wiki/ 스프링 _REDIS_ 프로퍼티.env APP_ENV=local APP_KEY= APP_DEBUG=true APP_LOG_LEVEL=debug APP_URL=http://localhost DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 MAIL_DRIVER=smtp MAIL_HOST=mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null à redis à redis, APP_KEY https://github.com/laravel/laravel/blob/master/.env.example 41
E node-session-redis 42
E-1. Redis https://ucloudbiz.olleh.com devpack [App Service] --- [Redis +] : redis1 --- : shared-vm --- [ ] 43
E-2. node-session-redis, https://ide.goorm.io/ frontier00@goorm.io --- --- (O) Git URL: https://github.com/jmnote/node-session-redis.git (O) --- [Test] --- [ ] : node-session-redis --- [ ] manifest.yml host: session00 --- [ ] [Deploy] --- [Push] --- [ ] - 테스트 ( 로그인 / 로그아웃 / 페이지이동 ) 44
PaaS & Cloud Native App 본격 PaaS 삼국지어디에도없는근본없는그림 PaaS 환경에서개발하다보니관심이가게된것들 관련이깊은것끼리연결해보았음 오늘은다루지않음. http://www.slideshare.net/onmay1/paas-66446915 참고 45
PaaS? 개발자맞춤형 Cloud! OS, 웹서버, 패키지관리에서해방 ;; devpack scale out. 서비스중단도없음. node.js, express. 32MB 애플리케이션이라니. 이러면 devpack에서월 1000원도안됨ㅎㄷㄷ redis. - 물론다른용도도얼마든지있음 IDE. 코딩도되고실행도되고 46
PaaS 세상은온다 ( 언제? ) 개발자라면 PaaS 에익숙해지자. 개발자가아니라면? 개발을공부하자 Special thanks to 구름 IDE 47