메뉴 건너뛰기

Cloudera, BigData, Semantic IoT, Hadoop, NoSQL

Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.


1. microservice pattern책의 부록 부분을 참고하여 window에서 리눅스를 사용할 수 있도록(WSL2등) 설치/설정한다.


2. kubernetes로 서비스를 기동할때 몇가지 수정해야할 부분이 있다. 

  (kubernetes가 버젼이 올라가면서 예제로 만들어진 kubernetes기동용 yaml과 script자체가 잘못되거나 없어진 옵션을 사용하고 있어 몇가지를 수정해야한다.)

  가. apps/v1beta1를 apps/v1로 수정

  나. extentions/v1beta1를 apps/v1로 수정

  다. selector.matchLabels.app에 app이름 추가

  라. metadata의 label항목에 app: app이름 추가


3. github소스 받아 build및 docker이미 생성

가. git clone github.com/microservice-patterns/ftgo-application

나. cd ftgo-application

다. ./gradlew buildContracts

라. ./gradlew assemble


4. container 배포

가. cd ~/ftgo-application/deployment/kubernetes/scripts

나. ./kubernetes-deploy-all.sh 

gooper@DESKTOP-PJ7F3IU:~/ftgo-application/deployment/kubernetes/scripts$ ./kubernetes-deploy-all.sh

secret/ftgo-db-secret created

service/ftgo-dynamodb-local created

statefulset.apps/ftgo-dynamodb-local created

job.batch/ftgo-dynamodb-local-init created

service/ftgo-kafka created

statefulset.apps/ftgo-kafka created

service/ftgo-mysql created

statefulset.apps/ftgo-mysql created

service/ftgo-zookeeper created

statefulset.apps/ftgo-zookeeper created

....................................................................................................................................connected

service/ftgo-cdc-service created

deployment.apps/ftgo-cdc-service created


5. container삭제

gooper@DESKTOP-PJ7F3IU:~/ftgo-application/deployment/kubernetes/scripts$ ./kubernetes-delete-all.sh

service "ftgo-cdc-service" deleted

deployment.apps "ftgo-cdc-service" deleted

secret "ftgo-db-secret" deleted

service "ftgo-dynamodb-local" deleted

statefulset.apps "ftgo-dynamodb-local" deleted

job.batch "ftgo-dynamodb-local-init" deleted

service "ftgo-kafka" deleted

statefulset.apps "ftgo-kafka" deleted

service "ftgo-mysql" deleted

statefulset.apps "ftgo-mysql" deleted

service "ftgo-zookeeper" deleted

statefulset.apps "ftgo-zookeeper" deleted


6. port forwarding하기 (이거 반드시 실행해줘야 한다)

가. cd ~/ftgo-application/deployment/kubernetes/scripts

나. ./port-forwards.sh


7. swagger ui를 이용한 서비스 테스트

가. consumer controller; http://127.0.0.1:8081/swagger-ui/

나. order controller, restaurant conroller; http://127.0.0.1:8082/swagger-ui/

다. kitchen controller, restaurant conroller; http://127.0.0.1:8083/swagger-ui/

라. basic error controller, operation handler, restaurant conrolle, web-mvc-link-handler ; http://127.0.0.1:8084/swagger-ui/

마. accounts controller; http://127.0.0.1:8085/swagger-ui/


* 수정해야 하는 파일 #1

gooper@DESKTOP-PJ7F3IU:~/ftgo-application/deployment/kubernetes/scripts$ ls -al ~/ftgo-application/*/src/deployment/kubernetes/*.yml

-rw-r--r-- 1 gooper gooper 1820 Jan 30 10:17 /home/gooper/ftgo-application/ftgo-accounting-service/src/deployment/kubernetes/ftgo-accounting-service.yml

-rw-r--r-- 1 gooper gooper 1542 Jan 30 10:17 /home/gooper/ftgo-application/ftgo-api-gateway/src/deployment/kubernetes/ftgo-api-gateway.yml

-rw-r--r-- 1 gooper gooper 1780 Jan 30 10:17 /home/gooper/ftgo-application/ftgo-consumer-service/src/deployment/kubernetes/ftgo-consumer-service.yml

-rw-r--r-- 1 gooper gooper 1802 Jan 30 10:17 /home/gooper/ftgo-application/ftgo-kitchen-service/src/deployment/kubernetes/ftgo-kitchen-service.yml

-rw-r--r-- 1 gooper gooper 2123 Jan 30 10:17 /home/gooper/ftgo-application/ftgo-order-history-service/src/deployment/kubernetes/ftgo-order-history-service.yml

-rw-r--r-- 1 gooper gooper 1931 Jan 30 10:17 /home/gooper/ftgo-application/ftgo-order-service/src/deployment/kubernetes/ftgo-order-service.yml

-rw-r--r-- 1 gooper gooper 1853 Jan 30 10:17 /home/gooper/ftgo-application/ftgo-restaurant-service/src/deployment/kubernetes/ftgo-restaurant-service.yml


* 수정해야 하는 파일 #2
gooper@DESKTOP-PJ7F3IU:~/ftgo-application/deployment/kubernetes/stateful-services$ ls -al
total 28
drwxr-xr-x 2 gooper gooper 4096 Jan 30 13:28 .
drwxr-xr-x 6 gooper gooper 4096 Jan 30 14:30 ..
-rw-r--r-- 1 gooper gooper  138 Jan 30 10:17 ftgo-db-secret.yml
-rw-r--r-- 1 gooper gooper 1651 Jan 30 13:21 ftgo-dynamodb-local.yml
-rw-r--r-- 1 gooper gooper 1215 Jan 30 13:26 ftgo-kafka-deployment.yml
-rw-r--r-- 1 gooper gooper 1250 Jan 30 13:24 ftgo-mysql-deployment.yml
-rw-r--r-- 1 gooper gooper 1081 Jan 30 13:25 ftgo-zookeeper-deployment.yml

* 수정해야 하는 파일 #3
~/ftgo-application/deployment/kubernetes/cdc-service/ftgo-cdc-service.yml

* 수정해야 하는 파일 #4(typo및 경로를 수정해야함)
gooper@DESKTOP-PJ7F3IU:~/ftgo-application/deployment/kubernetes/scripts$ ls -al *.sh
-rwxr-xr-x 1 gooper gooper 219 Jan 30 15:01 kubernetes-delete-all.sh
-rwxr-xr-x 1 gooper gooper 231 Jan 30 10:17 kubernetes-delete-volumes.sh
-rwxr-xr-x 1 gooper gooper 450 Jan 30 14:26 kubernetes-deploy-all.sh
-rwxr-xr-x 1 gooper gooper 156 Jan 30 10:17 kubernetes-deploy-and-test.sh
-rwxr-xr-x 1 gooper gooper  76 Jan 30 10:17 kubernetes-kill-port-forwarding.sh
-rwxr-xr-x 1 gooper gooper 316 Jan 30 10:17 kubernetes-run-end-to-end-tests.sh
-rwxr-xr-x 1 gooper gooper 513 Jan 30 10:17 kubernetes-wait-for-ready-pods.sh
-rwxr-xr-x 1 gooper gooper 621 Jan 30 10:17 port-forwards.sh

번호 제목 날짜 조회 수
642 oracle 접속 방식에 따른 --connect 지정 방법 2022.02.11 504
641 [vue storefrontui]외부 API통합하기 참고 문서 2022.02.09 165
640 vuestorefrontui.io를 이용한 front end project 생성하기 2022.02.06 209
639 eclipse editor 설정방법 2022.02.01 576
» windows10 pro에서 microservice pattern책의 예제를 kubernetes에서 기동하는 방법 2022.01.30 274
637 [백업] 리눅스 시스템 백업하기 (Linux System Backup) - TAR 사용 시스템 전체 백업 2022.01.19 1400
636 kudu rebalance수행 command예시 2022.01.17 1261
635 Kudu tablet이 FAILED일때 원인 확인 방법 2022.01.17 945
634 Failed to write to server: (no server available): 2022.01.17 1159
633 Soft memory limit exceeded (at 100.05% of capacity) 오류 조치 2022.01.17 915
632 not leader of this config: current role FOLLOWER 오류 발생시 확인방법 2022.01.17 1119
631 Oracle NLOB type의 데이터를 import하는 경우 No Java type for SQL type 2011 for column rst와 같은 오류 발생시 조치사항 2022.01.14 218
630 kudu 테이블 metadata강제 삭제시 발생하는 오류 메세지 2022.01.12 961
629 hadoop nfs gateway설정 (Cloudera 6.3.4, CentOS 7.4 환경에서) 2022.01.07 1383
628 oracle 12에 sqoop해서 데이터 import하기 (console에서 sqoop import하는 방법) 2021.12.31 929
627 python2.7.4에서 Oracle DB(11.2)를 사용하기 위한 설정(RPM을 이용하여 RHEL 7.4에 설치) 2021.11.26 1079
626 클러스터내의 전체 workflow및 coordinator현황을 사용자별로 추출하는 방법 2021.11.25 1206
625 hue.axes_accessattempt테이블의 username컬럼에 NULL 혹은 space가 들어갈수도 있음. 2021.11.03 3385
624 Query Status: Sender xxx.xxx.xxx.xxx timed out waiting for receiver fragment instance: 1234:cdsf, dest node: 10 의 오류 원인및 대응방안 2021.11.03 1106
623 hive metastore db중 TBLS, TABLE_PARAMS테이블 설명 2021.10.22 1026
위로