claimName: es-pvc
- name: es-config
configMap:
name: es
2. 重新部署, 容器不再退出, deployment状态保持green, 但es服务不可用(预料中, 因为改了command, 所以ES服务压根儿就没启), `kubectl exec -it <pod_name> -c <container_name> /bin/bash`进入容器, 手动执行`bash /usr/share/elasticsearch/bin/elasticsearch`命令启动ES服务, 查看到报错信息如下:
{
“@timestamp”: “2023-04-06T10:06:47.648Z”,
“log.level”: “ERROR”,
“message”: “fatal exception while booting Elasticsearch”,
“ecs.version”: “1.2.0”,
“service.name”: “ES_ECS”,
“event.dataset”: “elasticsearch.server”,
“process.thread.name”: “main”,
“log.logger”: “org.elasticsearch.bootstrap.Elasticsearch”,
“elasticsearch.node.name”: “node-1”,
“elasticsearch.cluster.name”: “my-cluster”,
“error.type”: “java.lang.IllegalStateException”,
“error.message”: “failed to obtain node locks, tried [/usr/share/elasticsearch/data]; maybe these locations are not writable or multiple nodes were started on the same data path?”,
“error.stack_trace”: “java.lang.IllegalStateException: failed to obtain node locks, tried [/usr/share/elasticsearch/data]; maybe these locations are not writable or multiple nodes were started on the same data path?\n\tat org.elasticsearch.server@8.6.2/org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:285)\n\tat org.elasticsearch.server@8.6.2/org.elasticsearch.node.Node.(Node.java:478)\n\tat org.elasticsearch.server@8.6.2/org.elasticsearch.node.Node.(Node.java:322)\n\tat org.elasticsearch.server@8.6.2/org.elasticsearch.bootstrap.ElasticsearchKaTeX parse error: Undefined control sequence: \n at position 33: …earch.java:214)\̲n̲\tat org.elasti…NodeLock.(NodeEnvironment.java:230)\n\tat org.elasticsearch.server@8.6.2/org.elasticsearch.env.NodeEnvironmentKaTeX parse error: Undefined control sequence: \n at position 42: …nment.java:198)\̲n̲\tat org.elasti…NodeLock.(NodeEnvironment.java:223)\n\t… 7 more\n”
}
挂载的路径`/usr/share/e