radondb-mysql-kubernetes icon indicating copy to clipboard operation
radondb-mysql-kubernetes copied to clipboard

You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD

Open bongmu opened this issue 1 year ago • 20 comments

apiVersion: mysql.radondb.com/v1alpha1 kind: MysqlCluster metadata: name: mysql namespace: uat spec: replicas: 2 mysqlVersion: "5.7" mysqlOpts: rootPassword: "dasfdasmk1" rootHost: localhost user: radondb_usr password: RadonDB@123 database: radondb initTokuDB: false

Create MysqlCluster error:

2022-08-15T10:26:43.717189615+08:00 error: database is uninitialized and password option is not specified

2022-08-15T10:26:43.717223701+08:00 You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD

image image

bongmu avatar Aug 15 '22 02:08 bongmu

Hi! thanks for your contribution! great first issue!

github-actions[bot] avatar Aug 15 '22 02:08 github-actions[bot]

check the env

kubectl get po mysql-mysql-0 -n uat -o custom-columns='ENV:.spec.initContainers[1].env'

runkecheng avatar Aug 15 '22 02:08 runkecheng

check the env

kubectl get po mysql-mysql-0 -n uat -o custom-columns='ENV:.spec.initContainers[1].env'

kubectl get po mysql-mysql-0 -n uat -o custom-columns='ENV:.spec.initContainers[1].env'

ENV [map[name:MYSQL_ALLOW_EMPTY_PASSWORD value:yes] map[name:MYSQL_ROOT_HOST value:localhost] map[name:MYSQL_INIT_ONLY value:1] map[name:MYSQL_ROOT_PASSWORD valueFrom:map[secretKeyRef:map[key:root-password name:mysql-secret optional:false]]]]

bongmu avatar Aug 15 '22 02:08 bongmu

check the env

kubectl get po mysql-mysql-0 -n uat -o custom-columns='ENV:.spec.initContainers[1].env'

kubectl get po mysql-mysql-0 -n uat -o custom-columns='ENV:.spec.initContainers[1].env'

ENV [map[name:MYSQL_ALLOW_EMPTY_PASSWORD value:yes] map[name:MYSQL_ROOT_HOST value:localhost] map[name:MYSQL_INIT_ONLY value:1] map[name:MYSQL_ROOT_PASSWORD valueFrom:map[secretKeyRef:map[key:root-password name:mysql-secret optional:false]]]]

env looks no problem,may be your password do not meet the specifications(^[A-Za-z0-9@#$%^&*_+\-=]{8,32}$)

runkecheng avatar Aug 15 '22 03:08 runkecheng

check the env

kubectl get po mysql-mysql-0 -n uat -o custom-columns='ENV:.spec.initContainers[1].env'

kubectl get po mysql-mysql-0 -n uat -o custom-columns='ENV:.spec.initContainers[1].env' ENV [map[name:MYSQL_ALLOW_EMPTY_PASSWORD value:yes] map[name:MYSQL_ROOT_HOST value:localhost] map[name:MYSQL_INIT_ONLY value:1] map[name:MYSQL_ROOT_PASSWORD valueFrom:map[secretKeyRef:map[key:root-password name:mysql-secret optional:false]]]]

env looks no problem,may be your password do not meet the specifications(^[A-Za-z0-9@#$%^&*_+-=]{8,32}$)

No, I tried a more complex password 7X^c29y&QyeuwQLXeW still that error

bongmu avatar Aug 15 '22 03:08 bongmu

check the env

kubectl get po mysql-mysql-0 -n uat -o custom-columns='ENV:.spec.initContainers[1].env'

kubectl get po mysql-mysql-0 -n uat -o custom-columns='ENV:.spec.initContainers[1].env' ENV [map[name:MYSQL_ALLOW_EMPTY_PASSWORD value:yes] map[name:MYSQL_ROOT_HOST value:localhost] map[name:MYSQL_INIT_ONLY value:1] map[name:MYSQL_ROOT_PASSWORD valueFrom:map[secretKeyRef:map[key:root-password name:mysql-secret optional:false]]]]

env looks no problem,may be your password do not meet the specifications(^[A-Za-z0-9@#$%^&*_+-=]{8,32}$)

No, I tried a more complex password 7X^c29y&QyeuwQLXeW still that error

After modifying the password, you need to delete the POD and PVCs that have been created.

runkecheng avatar Aug 15 '22 03:08 runkecheng

检查环境

kubectl get po mysql-mysql-0 -n uat -o custom-columns='ENV:.spec.initContainers[1].env'

kubectl get po mysql-mysql-0 -n uat -o custom-columns='ENV:.spec.initContainers[1].env' ENV [map[name:MYSQL_ALLOW_EMPTY_PASSWORD value:yes] map[name:MYSQL_ROOT_HOST value:localhost] map[name:MYSQL_INIT_ONLY value:1] map[name:MYSQL_ROOT_PASSWORD valueFrom:map[secretKeyRef:map[key:root-password name:mysql-secret optional:false]]]]

env看起来没问题,可能是你的密码不符合规范(^[A-Za-z0-9@#$%^&*_+-=]{8,32}$)

不,我尝试了更复杂的密码 7X^c29y&QyeuwQLXeW 仍然是那个错误

修改密码后,需要删除已创建的POD和PVC。

yes, I follow the delete and create steps to recreate, but it is still an error

bongmu avatar Aug 15 '22 03:08 bongmu

The following errors were found in the init-mysql container

image

bongmu avatar Aug 15 '22 05:08 bongmu

The following errors were found in the init-mysql container

image

bongmu avatar Aug 15 '22 05:08 bongmu

please check :

 kubectl get pods  -o jsonpath="{.items[*].spec.containers[*].image}"
kubectl get cm  sample-mysql -o yaml

zhl003 avatar Aug 15 '22 06:08 zhl003

check the config innodb_use_native_aio whether exist.

acekingke avatar Aug 15 '22 06:08 acekingke

check the config innodb_use_native_aio whether exist.

kubectl get cm mysql-mysql -n uat -o yaml|grep innodb_use_native_aio innodb_use_native_aio = 1

it exists

bongmu avatar Aug 15 '22 06:08 bongmu

which version of the operator? it should not exist the innodb_use_native_aio = 1 in new version.

acekingke avatar Aug 15 '22 06:08 acekingke

which version of the operator? it should not exist the innodb_use_native_aio = 1 in new version.

mysql-operator-2.2.0

bongmu avatar Aug 15 '22 06:08 bongmu

check the all node has the sample image. please, in mysql-operator-2.2.0 it should not have this parameter.

acekingke avatar Aug 15 '22 06:08 acekingke

check the all node has the sample image. please, in mysql-operator-2.2.0 it should not have this parameter.

In fact, I have successfully run 2 instances of the same configuration

kubectl get mysql --all-namespaces NAMESPACE NAME STATE DESIRED CURRENT LEADER AGE xxx-prod mysql Ready 2 2 mysql-mysql-0.mysql-mysql.xxx-prod 17d xxx-uat mysql Ready 2 2 mysql-mysql-0.mysql-mysql.xxx-uat 21d uat mysql Initializing 2 65m

Run three instance error

bongmu avatar Aug 15 '22 06:08 bongmu

check the all node has the sample image. please, in mysql-operator-2.2.0 it should not have this parameter.

In fact, I have successfully run 2 instances of the same configuration

kubectl get mysql --all-namespaces NAMESPACE NAME STATE DESIRED CURRENT LEADER AGE xxx-prod mysql Ready 2 2 mysql-mysql-0.mysql-mysql.xxx-prod 17d xxx-uat mysql Ready 2 2 mysql-mysql-0.mysql-mysql.xxx-uat 21d uat mysql Initializing 2 65m

Run three instance error

kubectl get pod --all-namespaces -o wide|grep mysql mysql-mysql-0 4/4 Running 0 7d4h 10.233.66.224 kubesphere-3 mysql-mysql-1 4/4 Running 0 7d4h 10.233.69.8 kubesphere-5 mysql-mysql-0 4/4 Running 0 20d 10.233.65.194 kubesphere-2 mysql-mysql-1 4/4 Running 0 20d 10.233.67.87 kubesphere-4 mysql-operator-658999f496-qq7wm 2/2 Running 0 27d 10.233.68.64 kubesphere-6 mysql-mysql-0 2/4 CrashLoopBackOff 41 (3m25s ago) 72m 10.233.65.247 kubesphere-2

image Suspect that there will be problems when mysql runs on the same node

bongmu avatar Aug 15 '22 07:08 bongmu

Re-opened an issue https://github.com/radondb/radondb-mysql-kubernetes/issues/655

bongmu avatar Aug 15 '22 07:08 bongmu

minikube下同样遇到一样的报错

sysadminxxx avatar Aug 15 '22 08:08 sysadminxxx

Add kernel optimization parameter solution vim /etc/sysctl.conf fs.aio-max-nr=1048576 sysctl -p

bongmu avatar Aug 16 '22 01:08 bongmu