radondb-mysql-kubernetes
radondb-mysql-kubernetes copied to clipboard
You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD
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
Hi! thanks for your contribution! great first issue!
check the env
kubectl get po mysql-mysql-0 -n uat -o custom-columns='ENV:.spec.initContainers[1].env'
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]]]]
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}$)
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
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.
检查环境
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
The following errors were found in the init-mysql container
The following errors were found in the init-mysql container
please check :
kubectl get pods -o jsonpath="{.items[*].spec.containers[*].image}"
kubectl get cm sample-mysql -o yaml
check the config innodb_use_native_aio
whether exist.
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
which version of the operator? it should not exist the innodb_use_native_aio = 1
in new version.
which version of the operator? it should not exist the
innodb_use_native_aio = 1
in new version.
mysql-operator-2.2.0
check the all node has the sample image. please, in mysql-operator-2.2.0
it should not have this parameter.
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
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
Suspect that there will be problems when mysql runs on the same node
Re-opened an issue https://github.com/radondb/radondb-mysql-kubernetes/issues/655
minikube下同样遇到一样的报错
Add kernel optimization parameter solution vim /etc/sysctl.conf fs.aio-max-nr=1048576 sysctl -p