gpt4 book ai didi

mysql - Kubernetes MySQL pod持续崩溃并显示无法锁定./ibdata1错误:11

转载 作者:行者123 更新时间:2023-11-29 15:32:03 25 4
gpt4 key购买 nike

我创建了新的docker镜像并在kuponetes statefulset yaml中添加了mysql pod。当我将mysql pod缩放到1时,它不断崩溃并抛出消息
 unable to lock ./ibdata1 error: 11

我对此错误进行了很多搜索,但没有一个提供解决方案。感谢有人帮助我!

enter image description here

Docker文件:

FROM mysql/mysql-server
CMD [ "--max_connections=10000" ]


并创建如下所示的MySQL YAML:

{
"kind": "StatefulSet",
"apiVersion": "apps/v1beta2",
"metadata": {
"name": "mysql-test",
"namespace": "test",
"selfLink": "/apis/apps/v1beta2/namespaces/test/statefulsets/mysql-test",
"uid": "e7768a0b-faf9-11e9-a989-d8c497367e2a",
"resourceVersion": "315823479",
"generation": 33,
"creationTimestamp": "2019-10-30T09:44:44Z",
"labels": {
"app": "mysql-test",
"release": "mysql-test"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "mysql-test"
}
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"app": "mysql-test"
}
},
"spec": {
"volumes": [
{
"name": "data",
"persistentVolumeClaim": {
"claimName": "mysqldata"
}
},
{
"name": "backup",
"persistentVolumeClaim": {
"claimName": "mysqlbackup"
}
}
],
"containers": [
{
"name": "latest",
"image": "<Enterprise repository>/careercompass/mysql:latest",
"ports": [
{
"name": "mysql",
"containerPort": 3306,
"protocol": "TCP"
}
],
"env": [
{
"name": "MYSQL_PASSWORD",
"valueFrom": {
"secretKeyRef": {
"name": "mysql",
"key": "mysql-password",
"optional": true
}
}
},
{
"name": "MYSQL_ROOT_PASSWORD",
"valueFrom": {
"secretKeyRef": {
"name": "mysql",
"key": "mysql-root-password",
"optional": true
}
}
},
{
"name": "MYSQL_USER",
"value": "mysql"
},
{
"name": "MYSQL_DATABASE"
}
],
"resources": {
"limits": {
"cpu": "10",
"memory": "10000Mi"
},
"requests": {
"cpu": "200m",
"memory": "3000Mi"
}
},
"volumeMounts": [
{
"name": "data",
"mountPath": "/var/lib/mysql"
},
{
"name": "backup",
"mountPath": "/var/lib/mysqlbackup"
}
],
"terminationMessagePath": "/var/lib/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"securityContext": {
"runAsUser": 999,
"fsGroup": 999
},
"schedulerName": "default-scheduler"
}
},
"serviceName": "",
"podManagementPolicy": "OrderedReady",
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"partition": 0
}
},
"revisionHistoryLimit": 10
},
"status": {
"observedGeneration": 33,
"replicas": 1,
"currentReplicas": 1,
"updatedReplicas": 1,
"currentRevision": "mysql-test-68cb64885c",
"updateRevision": "mysql-test-68cb64885c",
"collisionCount": 0
}
}

最佳答案

在日志中,您将找到以下内容:

[ERROR] Do you already have another mysqlId sever running on port: 3306?


让我们找出端口3306上已经在运行什么:

lsof -i:3306


然后使用 kill -9 PROCESS杀死它(即进程号)

kill -9 13498


然后尝试重新启动MySQL。

关于mysql - Kubernetes MySQL pod持续崩溃并显示无法锁定./ibdata1错误:11,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58642671/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com