Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD #654

Open
bongmu opened this issue Aug 15, 2022 · 20 comments
Labels
question Further information is requested

Comments

@bongmu
Copy link

bongmu commented Aug 15, 2022

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 bongmu added the question Further information is requested label Aug 15, 2022
@github-actions
Copy link

Hi! thanks for your contribution! great first issue!

@runkecheng
Copy link
Collaborator

check the env

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

@bongmu
Copy link
Author

bongmu commented Aug 15, 2022

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]]]]

@runkecheng
Copy link
Collaborator

runkecheng commented Aug 15, 2022

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}$)

@bongmu
Copy link
Author

bongmu commented Aug 15, 2022

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

@runkecheng
Copy link
Collaborator

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.

@bongmu
Copy link
Author

bongmu commented Aug 15, 2022

检查环境

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
Copy link
Author

bongmu commented Aug 15, 2022

The following errors were found in the init-mysql container

image

1 similar comment
@bongmu
Copy link
Author

bongmu commented Aug 15, 2022

The following errors were found in the init-mysql container

image

@zhl003
Copy link
Collaborator

zhl003 commented Aug 15, 2022

please check :

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

@acekingke
Copy link
Contributor

check the config innodb_use_native_aio whether exist.

@bongmu
Copy link
Author

bongmu commented Aug 15, 2022

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

@acekingke
Copy link
Contributor

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

@bongmu
Copy link
Author

bongmu commented Aug 15, 2022

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

mysql-operator-2.2.0

@acekingke
Copy link
Contributor

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

@bongmu
Copy link
Author

bongmu commented Aug 15, 2022

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
Copy link
Author

bongmu commented Aug 15, 2022

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
Copy link
Author

bongmu commented Aug 15, 2022

Re-opened an issue
#655

@sysadminxxx
Copy link

minikube下同样遇到一样的报错

@bongmu
Copy link
Author

bongmu commented Aug 16, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants