PCF Installation Guide
-
Upload
seungdon-choi -
Category
Software
-
view
167 -
download
0
description
Transcript of PCF Installation Guide
PCF Installation Guide
Last Updated: 2014.9.29Last Updated by: [email protected] [email protected]
문서이력
버전 일자 이력사항 작성자1.0 2014.09.05 문서초안 이상희1.1 2014.09.29 세부 내역 추가 최승돈
목차
문서이력...................................................................................................................................... 2
System Configuration............................................................................................................. 4
Software Download................................................................................................................ 5
Prerequisites............................................................................................................................ 5
Ops Manager 설치................................................................................................................. 10
Elastic Runtime 설치............................................................................................................ 22
Cloud Foundry CLI 설치....................................................................................................... 31
Configure MySQL................................................................................................................... 31
New Account 생성 / 설정..................................................................................................... 32
HAProxy IP 설정.................................................................................................................... 34
deploy 환경 설정.................................................................................................................... 36
Appendix: References.......................................................................................................... 41
Appendix: Vmware operation manager 설치.............................................45
About This Documentation
본 문서는 Pivotal CF 1.2 의 설치 과정에 대해 기술한다. 본 문서는 공식적인 Pivotal 의 문서는 아니며, 에러를 포함할 수 있으므로, 실제 운영계 시스템의 설치시에는 반드시 공식 문서 http://docs.pivotal.io 를 참조하도록 한다.
본 문서의 작성에 참조한 사이트들은 다음과 같다.1. vcenter 설치 - http://pivotallabs.com/worlds-smallest-iaas-part-1/ 2. pcf 설치 - http://pivotallabs.com/worlds-smallest-iaas-part-2/3. Configuring Elastic Runtime - http://pivotallabs.com/worlds-smallest-iaas-part-3-paas/ 4. pcf_docs - http://docs.pivotal.io/pivotalcf/getstarted/index.html#system
System Configuration
Pivotal CF 설치 시에 필요한 IP list 들과 각 설정 사항들은 다음과 같다. 하기 내용은 내부 시스템에 한정하며, 고객사에 설치시는 네트워크 엔지니어와 협의하여 필요 IP 를 할당하여 진행하도록 한다.
내역 IP 참고Vmware ESXi 10.35.106.178Vmware vCenter 10.35.106.175 내부: 10.10.10.200NAT 10.35.106.177:8443 PCF:
10.10.10.101:443Gateway 10.10.10.254Internal IP 10.10.10.102 ~ 199Domain Pcftest175.comHA Proxy 10.10.10.199DNS 10.35.106.179 10.10.10.250
Software Download
다음의 사이트에서 PCF 설치 미디어를 다운받는다. 현재(2014.9.29) 최신 버전은 1.3 이며, 본 문서는 1.2 버전을 기준으로 설치하였다.
PCF download : http://network.pivotal.ioPCF document : http://docs.pivotal.io
Media 의 이름과 각 역할은 다음과 같다- ova : Ops Manager- cf-xxx.pivotal : CF- P-mysql-xxx.pivotal = MySQL Service
Prerequisites
VMware vSphere 의 설치는 별도 문서를 참조한다.
NAT 서버의 설정 NAT 서버 설정
* 주의 사항 1. pcf 설치시 iexplorer 가 아닌 다른 browser 에서 실행(eg:chrome)하기를 권고함.
Vcenter 설치1. EXSI 설치 - 설치 - Network Device 추가 (구성>네트워킹, vmnetwork 로 추가 후 이름 변경Internal ) : internal connection 을 위한 별도 가상 네트워크 구축
2. Vcenter 설치 - ESXi 서버 IP 를 등록해서 Vcenter. ova 파일 deploy 3. Vcenter 설치 후에 network device 추가 - 시스템 부팅 - root / vmware - IP 할당 # yast . 탭으로 옮김 . ip 할당 . gateway (routing)
# 추가 device 설정 . internal - vcenter EUL https://IP:5480 - Network Device 추가 . Internal - vcenter 활성화 - data center 생성 - 클러스터 생성 - 클러스터 생성 후 호스트 추가(esxi 서버 추가) --참고 사이트 1. vcenter 참조 - vcenter 웹클라이언트 https://10.35.106.175:9443/vsphere-client/ 에서 vSphere Client 를 다운받아 설치 후 접속한다.
Ops Manager 설치.
vSphere Client 에서 File OVF Template 배포 를 시작한다
다음 클릭
동의 클릭
다음 클릭
Thin Provisioning 선택
Thin Provision 선택
네트워크 선택
사용 IP 입력
완료 클릭
Ops Manager 의 설치가 끝났다. 설정을 위해 브라우저상에서 https://10.35.106.177:8443 로 접속한다.
최초 접속시 유저 생성을 한다. Admin 유저 생성 : pivotalcf/changeme
Dash Board vmware vSphere 선택
vCenter Admin 유저 : root/vmware
Datacenter 명, Cluster 명, Datastore 명을 입력한다.
사용 IP 와 대역대를 입력한다. 사용하지 않는 IP 대역대는 하기와 같은 형식으로 입력하여야 한다.
NTP 서버 : 여기서는 DNS 서버에서 띄움.
나머지 Health Monitor, System Setting, Resource Size 는 Default 값으로 사용하고, Apply Change 버튼을 누르면 설정사항 반영이 진행된다.
OPS Manager 설치 및 설정이 완료되었다.
Elastic Runtime 설치 이제 PCF ERS 설치를 진행한다.
Import a Product: cf~ 로 시작하는 ERS media 를 import 한다.
선택
add click
타일상에서 녹색으로 보이는 부분은 설정이 완료, 오렌지는 설정미완료임을 나타낸다. Elastic Runtime 을 선택한다.
Generate SSL Certificate, 아래 trusted Self Signed Certificated 선택 후 save 함.
System Domain/Apps Domain 을 입력후 save 클릭
나머지 부분들은 모두 default 로 선택하여도 현재 무방하다. Apply Change 를 클릭하면 하기와 같이 워닝 메시지가 보이지만 무시하고 진행한다.
Ignore Error 하고 설치를 진행한다.
최초 설치시는 약 1 시간 이상 소요된다.
ERS 설정이 완료되었다. Credential Tab 의 Admin 패스워드를 이용하여 Console 에 로그인하자.
DNS 서버에서 console.pcftest175.com 으로 접속. 위의 admin/… 으로 접속
Pivotal Web Service 누르면
최초 Org 생성 메시지가 나온다. Org Name : pivotal_kr 로 생성
Cloud Foundry CLI 설치 인터넷이 연결된 환경이라면 Developer Console 상의 Tool 메뉴에서, 인터넷이 연결되지 않았다면 하기의 사이트에서 Client OS 에 알맞은 CLI 툴을 다운받도록 한다. https://github.com/cloudfoundry/cli/releases
Configure MySQL
Ops Manager 에서 MySQL 서비스를 설치한다. Import 후 Add 클릭.
Apply Change, Ignore CPU Core 에러할것.
New Account 생성 / 설정 - 웹 push 를 위한 계정 생성 (테스트시에는 필요 없음, admin 으로 처리)
HAProxy IP 설정외부 서비스 연결을 위해서 HA Proxy 상에 External IP 를 설정한다.
vCenter 서버 리스트중에서 HA Proxy Job 을 담당하는 서버를 확인하여 접속한다.
접속시에는 push_console, 혹은 vcap 등의 패스워드 를 사용하여 접속한다.
Root 로 접속하여 /etc/network/interface 에 external ip 를 기술하고 network restart 하여 적용 사항을 반영시킨다.
확인
deploy 환경 설정
# Client (개인 PC)에 host (haproxy) 추가# 여기서는 별도의 외부 DNS 가 없으므로 client 내의 hosts 파일로 요청 URL 에 대한 naming resolution 을 처리한다. App 이 등록될 때마다 subdomain 을 hosts 파일에 기술하여야 한다. koxxlees55m1:~ lees55$ sudo vi /etc/hostsPassword:
127.0.0.1 localhost255.255.255.255 broadcasthost
::1 localhostfe80::1%lo0 localhost10.35.106.179 api.pcftest175.com10.35.106.179 login.pcftest175.com10.35.106.179 console.pcftest175.com10.35.106.179 loggregator.pcftest175.com10.35.106.179 orders.pcftest175.com10.35.106.179 music.pcftest175.com
## cf login 시 패스워드 확인
## cf login
koxxlees55m1:~ lees55$ cf api api.pcftest175.comSetting api endpoint to api.pcftest175.com...FAILEDInvalid SSL Cert for api.pcftest175.comTIP: Use 'cf api --skip-ssl-validation' to continue with an insecure API endpointkoxxlees55m1:~ lees55$ cf api --skip-ssl-validation api.pcftest175.comSetting api endpoint to api.pcftest175.com...OK
API endpoint: https://api.pcftest175.com (API version: 2.2.0)Not logged in. Use 'cf login' to log in.
koxxlees55m1:~ lees55$ cf login -u push_console -p 8b58f95707888d4c05f1API endpoint: https://api.pcftest175.comAuthenticating...OK
Select an org (or press enter to skip):1. system2. pivotal_kr
Org> 2Targeted org pivotal_kr
Targeted space development
API endpoint: https://api.pcftest175.com (API version: 2.2.0)User: push_consoleOrg: pivotal_krSpace: developmentkoxxlees55m1:~ lees55$ pwd
Push 테스트[root@nat pcf]# cf push Orders -i 1 -m 512M -p pcfdemo.warCreating app Orders in org pivotal_kr / space development as push_console...OK
Creating route orders.pcftest175.com...OK
Binding orders.pcftest175.com to Orders...OK
Uploading Orders...Uploading app files from: pcfdemo.warUploading 10.9M, 96 filesOK
Starting app Orders in org pivotal_kr / space development as push_console...OK-----> Downloaded app package (8.4M)-----> Java Buildpack Version: v2.1.2 (offline) | https://github.com/cloudfoundry/java-buildpack.git#074fd9a-----> Downloading Open Jdk JRE 1.7.0_55 from http://download.run.pivotal.io/openjdk/lucid/x86_64/openjdk-1.7. 0_55.tar.gz (found in cache) Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.3s)-----> Downloading Spring Auto Reconfiguration 0.8.9 from http://download.run.pivotal.io/auto-reconfiguration/
auto-reconfiguration-0.8.9.jar (found in cache) Modifying /WEB-INF/web.xml for Auto Reconfiguration-----> Downloading Tomcat Instance 7.0.53 from http://download.run.pivotal.io/tomcat/tomcat-7.0.53.tar.gz (fou nd in cache) Expanding Tomcat to .java-buildpack/tomcat (0.1s)-----> Downloading Tomcat Lifecycle Support 2.1.0_RELEASE from http://download.run.pivotal.io/tomcat-lifecycle -support/tomcat-lifecycle-support-2.1.0_RELEASE.jar (found in cache)-----> Downloading Tomcat Logging Support 2.1.0_RELEASE from http://download.run.pivotal.io/tomcat-logging-sup port/tomcat-logging-support-2.1.0_RELEASE.jar (found in cache)-----> Uploading droplet (47M)
0 of 1 instances running, 1 starting0 of 1 instances running, 1 starting0 of 1 instances running, 1 starting0 of 1 instances running, 1 starting1 of 1 instances running
App started
Showing health and status for app Orders in org pivotal_kr / space development as push_console...OK
requested state: startedinstances: 1/1usage: 512M x 1 instancesurls: orders.pcftest175.com
state since cpu memory disk#0 running 2014-09-02 12:33:07 PM 0.0% 365.4M of 512M 108.1M of 1G[root@nat pcf]# cf servicesGetting services in org pivotal_kr / space development as push_console...OK
No services found[root@nat pcf]#
## 웹 콘솔에서 확인
Web application 확인
Appendix: Referenceshttp://pivotallabs.com/worlds-smallest-iaas-part-1/
http://docs.pivotal.io/pivotalcf/getstarted/index.html#systemhttps://www.youtube.com/watch?v=4R9L-g_2CHc
koxxlees55m1:PCF_Certi lees55$ cf appsGetting apps in org pivotal_kr / space development as push_console...OK
name requested state instances memory disk urlsMusic started 1/1 512M 1G music.pcftest175.comOrders started 2/2 512M 1G orders.pcftest175.comkoxxlees55m1:PCF_Certi lees55$ cf scale orders --i 5 -m 512M
This will cause the app to restart. Are you sure you want to scale Orders?> y
Scaling app Orders in org pivotal_kr / space development as push_console...OKStopping app Orders in org pivotal_kr / space development as push_console...OK
Starting app Orders in org pivotal_kr / space development as push_console...OK
0 of 5 instances running, 5 starting….0 of 5 instances running, 4 starting, 1 down0 of 5 instances running, 5 starting1 of 5 instances running, 4 starting
App started
Showing health and status for app Orders in org pivotal_kr / space development as push_console...OK
requested state: startedinstances: 5/5usage: 512M x 5 instancesurls: orders.pcftest175.com
state since cpu memory disk#0 starting 2014-09-02 04:49:41 PM 0.0% 0 of 0 0 of 0#1 starting 2014-09-02 04:49:41 PM 0.0% 0 of 0 0 of 0#2 starting 2014-09-02 04:49:41 PM 0.0% 0 of 0 0 of 0#3 running 2014-09-02 04:50:05 PM 0.0% 333.8M of 512M 108.1M of 1G#4 starting 2014-09-02 04:50:01 PM 0.0% 0 of 0 0 of 0koxxlees55m1:PCF_Certi lees55$ cf appsGetting apps in org pivotal_kr / space development as push_console...OK
name requested state instances memory disk urlsMusic started 1/1 512M 1G music.pcftest175.comOrders started 5/5 512M 1G orders.pcftest175.comkoxxlees55m1:PCF_Certi lees55$ cf scale orders --i 1 -m 512M
This will cause the app to restart. Are you sure you want to scale Orders?> y
Scaling app Orders in org pivotal_kr / space development as push_console...OKStopping app Orders in org pivotal_kr / space development as push_console...OK
Starting app Orders in org pivotal_kr / space development as push_console...OK
0 of 1 instances running, 1 starting0 of 1 instances running, 1 starting0 of 1 instances running, 1 starting0 of 1 instances running, 1 starting1 of 1 instances running
App started
Showing health and status for app Orders in org pivotal_kr / space development as push_console...OK
requested state: startedinstances: 1/1usage: 512M x 1 instancesurls: orders.pcftest175.com
state since cpu memory disk
#0 running 2014-09-02 04:53:24 PM 0.0% 334.1M of 512M 108.1M of 1Gkoxxlees55m1:PCF_Certi lees55$
Appendix: Vmware operation manager 설치
설치 파일 : appliance 으로 설치VMware-vcops-5.8.2.0-1885282-vapp.ova
필요한 사항 : IP 두 개 필요
http://virtualhive.tistory.com/593
admin/admin
root/vmware
admin/Password1!root/Password1!
Administrator/Password1!