inflearn logo
강의

Khóa học

Chia sẻ kiến thức

Kubernetes for SWE do kỹ sư Thung lũng Silicon hướng dẫn

Tìm hiểu chi tiết về lệnh Helm

helm mysql 실습 도중 에러

685

daniel

58 câu hỏi đã được viết

1

 

helm 실습 도중 mysql이 정상적으로 실행이 되지 않는 것 같아 문의드립니다.

helm install mydb bitnami/mysql -f my-values.yaml
NAME: mydb
LAST DEPLOYED: Sun Jan 21 03:15:02 2024
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: mysql
CHART VERSION: 9.18.0
APP VERSION: 8.0.36

** Please be patient while the chart is being deployed **

Tip:

  Watch the deployment status using the command: kubectl get pods -w --namespace default

Services:

  echo Primary: mydb-mysql.default.svc.cluster.local:3306

Execute the following to get the administrator credentials:

  echo Username: root
  MYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace default mydb-mysql -o jsonpath="{.data.mysql-root-password}" | base64 -d)

To connect to your database:

  1. Run a pod that you can use as a client:

      kubectl run mydb-mysql-client --rm --tty -i --restart='Never' --image  docker.io/bitnami/mysql:8.0.36-debian-11-r0 --namespace default --env MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD --command -- bash

  2. To connect to primary service (read/write):

      mysql -h mydb-mysql.default.svc.cluster.local -uroot -p"$MYSQL_ROOT_PASSWORD"

my-values.yaml을 이용해서 helm mysql을 띄우고 있습니다.

kctl get pods
NAME           READY   STATUS    RESTARTS   AGE
mydb-mysql-0   0/1     Running   0          35s

위의 Ready가 1로 바뀌지 않습니다.

아래와 같이 접속이 되지 않습니다

kubectl run mydb-mysql-client --rm --tty -i --restart='Never' --image  docker.io/bitnami/mysql:8.0.36-debian-11-r0 --namespace default --env MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD --command -- bash
If you don't see a command prompt, try pressing enter.
I have no name!@mydb-mysql-client:/$ 

# 실행이 되지 않는 부분
I have no name!@mydb-mysql-client:/$ mysql -h mydb-mysql.default.svc.cluster.local -uroot -p"$MYSQL_ROOT_PASSWORD"
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2003 (HY000): Can't connect to MySQL server on 'mydb-mysql.default.svc.cluster.local:3306' (111)
I have no name!@mydb-mysql-client:/$ 

 

문제가 있는 pod의 로그를 남깁니다.

제가 조치해야할 부분에 대해 답변 해주시면 감사드리겠습니다.

kubectl logs mydb-mysql-0 -n default
mysql 18:16:54.38 INFO  ==> 
mysql 18:16:54.38 INFO  ==> Welcome to the Bitnami mysql container
mysql 18:16:54.38 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
mysql 18:16:54.38 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
mysql 18:16:54.38 INFO  ==> 
mysql 18:16:54.38 INFO  ==> ** Starting MySQL setup **
mysql 18:16:54.39 INFO  ==> Validating settings in MYSQL_*/MARIADB_* env vars
mysql 18:16:54.40 INFO  ==> Initializing mysql database
mysql 18:16:54.40 WARN  ==> The mysql configuration file '/opt/bitnami/mysql/conf/my.cnf' is not writable. Configurations based on environment variables will not be applied for this file.
mysql 18:16:54.40 INFO  ==> Using persisted data
mysql 18:16:54.42 INFO  ==> Running mysql_upgrade
mysql 18:16:54.42 INFO  ==> Starting mysql in background
2024-01-20T18:16:54.827769Z 0 [Warning] [MY-011068] [Server] The syntax 'skip_slave_start' is deprecated and will be removed in a future release. Please use skip_replica_start instead.
2024-01-20T18:16:54.827877Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2024-01-20T18:16:54.827893Z 0 [System] [MY-010116] [Server] /opt/bitnami/mysql/bin/mysqld (mysqld 8.0.36) starting as process 46
2024-01-20T18:16:54.833609Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2024-01-20T18:16:54.842169Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-01-20T18:16:55.006185Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-01-20T18:16:55.095907Z 4 [System] [MY-013381] [Server] Server upgrade from '80036' to '80036' started.
2024-01-20T18:16:57.163961Z 4 [System] [MY-013381] [Server] Server upgrade from '80036' to '80036' completed.
2024-01-20T18:16:57.288943Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-01-20T18:16:57.289454Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-01-20T18:16:57.304275Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock
2024-01-20T18:16:57.304353Z 0 [System] [MY-010931] [Server] /opt/bitnami/mysql/bin/mysqld: ready for connections. Version: '8.0.36'  socket: '/opt/bitnami/mysql/tmp/mysql.sock'  port: 3306  Source distribution.
find: '/docker-entrypoint-startdb.d/': No such file or directory
mysql 18:16:58.45 INFO  ==> Stopping mysql
2024-01-20T18:16:58.468953Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.0.36).
2024-01-20T18:17:00.619438Z 0 [System] [MY-010910] [Server] /opt/bitnami/mysql/bin/mysqld: Shutdown complete (mysqld 8.0.36)  Source distribution.
mysql 18:17:01.54 INFO  ==> ** MySQL setup finished! **

mysql 18:17:01.58 INFO  ==> ** Starting MySQL **
2024-01-20T18:17:01.948065Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2024-01-20T18:17:01.948084Z 0 [System] [MY-010116] [Server] /opt/bitnami/mysql/bin/mysqld (mysqld 8.0.36) starting as process 1
2024-01-20T18:17:01.957828Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2024-01-20T18:17:01.968662Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-01-20T18:17:02.085467Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-01-20T18:17:02.232037Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-01-20T18:17:02.232066Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-01-20T18:17:02.245171Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock
2024-01-20T18:17:02.245200Z 0 [System] [MY-010931] [Server] /opt/bitnami/mysql/bin/mysqld: ready for connections. Version: '8.0.36'  socket: '/opt/bitnami/mysql/tmp/mysql.sock'  port: 3306  Source distribution.
2024-01-20T18:17:13.205722Z 8 [Warning] [MY-013360] [Server] Plugin mysql_native_password reported: ''mysql_native_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'
2024-01-20T18:17:23.196807Z 9 [Warning] [MY-013360] [Server] Plugin mysql_native_password reported: ''mysql_native_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'
2024-01-20T18:17:34.146016Z 10 [Warning] [MY-013360] [Server] Plugin mysql_native_password reported: ''mysql_native_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'
2024-01-20T18:17:43.208718Z 11 [Warning] [MY-013360] [Server] Plugin mysql_native_password reported: ''mysql_native_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'

 

kubernetes

Câu trả lời 1

0

altoformula

안녕하세요 Daniel Ryu님,

일단 불편을 드려 죄송합니다. Helm Chart를 제가 관리하지 않다보니, 버전이 올라가면 안될 가능성이 있을 수 있겠네요.

제가 실습 당시 사용했던 버전은 아래와 같았습니다.

NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: mysql
CHART VERSION: 9.7.2
APP VERSION: 8.0.33

저도 다음 명령어를 사용해서 같은 버전을 사용해서 해봤는데 helm install mydb bitnami/mysql --version 9.18.0 -f my-values.yaml 아무런 문제는 찾지 못했습니다.

혹시 제가 사용했던 버전을 사용해 보시겠어요?

 

일단 helm uninstall mydb을 사용하셔서 기존에 설치한 부분을 릴리즈 하신 후에 제가 실습때 사용했던 helm install mydb bitnami/mysql --version 9.7.2 -f my-values.yaml를 사용해 보세요.

 

남겨주신 로그와 제 로컬과 비교했을때에도 별로 문제를 찾지는 못했습니다.

마지막으로 혹시 kubectl get service을 하셔서 혹시 다른 Pod이 방해를 하지는 않는지도 확인해 보셨으면 합니다.

마지막 방법으로는 minikube stop을 하신 후 재 시작하는 방법도 추천드립니다.

그래도 안되면 알려주세요. 다른 이슈가 있을 지 한 번 생각해 보겠습니다.

gateway 생성 후 접속 확인 질문

0

8

1

Ingress 생성하기 ingressclass 질문

1

23

2

deployment 업데이트 및 롤백 실행하기 -2

1

24

2

강사님 Sprint6 은 언제쯤 나오나요?

1

17

1

젠킨스버전과 플러그인설치

1

37

2

cpu&memory 재설정하기에 질문이 있습니다.

1

51

2

시험 시작하기 전에 한 가지 질문 있습니다.

1

51

2

yml 작성하다가 에러 발생해서 문의 드립니다.

0

39

2

섹션2. 1.5쿠버네티스_컨트롤플레인_노드와_워커_노드_그리고 kubeadm으로 쿠버네티스 직접 구성하기-v1.30 오류

0

37

2

설치수업중에 질문드립니다.

1

58

2

CNI 문제 질문

1

53

2

dns 관련하여 질문이 있습니다.

0

42

2

강의가 안나와요 - Kube Proxy에 대해 알아보자

0

147

1

service, pod 개념 질문

1

181

1

Kubectl, minikube 로컬 환경 설치 질문

1

186

1

NAT을 사용하면 안되는 규칙에 대한 질문입니다. (Cluster Network(클러스터 네트워크)에 대해 알아보자 )

1

201

1

한번에 다운 받기 자료 요청

1

151

1

Daemonset 에 임계점이 오면 어떻게 처리하나요?

1

179

1

사이드 프로젝트를 쿠베로 배포하고 싶은데요

1

260

1

yaml 작성법 문의

1

188

1

DNS강의 관련 질문

1

271

1

net cat 관련 질문

1

450

2

화면자료 공유 가능하실까요?

2

432

1

학습자료

1

400

1