gpt4 book ai didi

elasticsearch 集群成员没有在 Kubernetes 中进入就绪状态

转载 作者:行者123 更新时间:2023-12-04 07:17:59 24 4
gpt4 key购买 nike

我是 kubernetes 的初学者我正在尝试在其中运行一个 elasticsearch 集群,我正在关注这个(教程)[https://phoenixnap.com/kb/elasticsearch-helm-chart] 遵循所有命令,并且当我这样做的时候

kubectl get pods --namespace=default -l app=elasticsearch-master -w
我正进入(状态
NAME                     READY   STATUS     RESTARTS   AGE
elasticsearch-master-0 0/1 Init:0/1 0 55s
elasticsearch-master-1 0/1 Init:0/1 0 55s
elasticsearch-master-2 0/1 Init:0/1 0 55s
他们没有变成就绪状态
和命令
helm test elasticsearch
卡住了,没有反应
这是日志
kubectl logs -f elasticsearch-master-0
Error from server (BadRequest): container "elasticsearch" in pod "elasticsearch-master-0" is waiting to start: PodInitializing
kubectl logs -f elasticsearch-master-1
Error from server (BadRequest): container "elasticsearch" in pod "elasticsearch-master-1" is waiting to start: PodInitializing
kubectl logs -f elasticsearch-master-2
Error from server (BadRequest): container "elasticsearch" in pod "elasticsearch-master-2" is waiting to start: PodInitializing
kubectl cluster-info返回
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {

},
"status": "Failure",
"message": "services \"kube-dns:dns\" is forbidden: User \"system:anonymous\" cannot get resource \"services/proxy\" in API group \"\" in the namespace \"kube-system\"",
"reason": "Forbidden",
"details": {
"name": "kube-dns:dns",
"kind": "services"
},
"code": 403
}
这就是我现在所知道的,因为我是初学者,请帮助我的 Elasticsearch 节点没有准备好

最佳答案

有一个open issue around this helm on GitHub .

Check once which storage class you have for PVC creation. 
但是,此问题可能有多种原因,例如 聚氯乙烯 没有被创造或其他人。
单节点 可以试试 Elasticsearch 合作与否聚氯乙烯 使用动态创建:
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app : elasticsearch
component: elasticsearch
release: elasticsearch
name: elasticsearch
spec:
podManagementPolicy: Parallel
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app : elasticsearch
component: elasticsearch
release: elasticsearch
serviceName: elasticsearch
template:
metadata:
creationTimestamp: null
labels:
app : elasticsearch
component: elasticsearch
release: elasticsearch
spec:
containers:
- env:
- name: cluster.name
value: <SET THIS>
- name: discovery.type
value: single-node
- name: ES_JAVA_OPTS
value: -Xms512m -Xmx512m
- name: bootstrap.memory_lock
value: "false"
image: elasticsearch:6.5.0
imagePullPolicy: IfNotPresent
name: elasticsearch
ports:
- containerPort: 9200
name: http
protocol: TCP
- containerPort: 9300
name: transport
protocol: TCP
resources:
limits:
cpu: 250m
memory: 1Gi
requests:
cpu: 150m
memory: 512Mi
securityContext:
privileged: true
runAsUser: 1000
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /usr/share/elasticsearch/data
name: elasticsearch-data
dnsPolicy: ClusterFirst
initContainers:
- command:
- sh
- -c
- chown -R 1000:1000 /usr/share/elasticsearch/data
- sysctl -w vm.max_map_count=262144
- chmod 777 /usr/share/elasticsearch/data
- chomod 777 /usr/share/elasticsearch/data/node
- chmod g+rwx /usr/share/elasticsearch/data
- chgrp 1000 /usr/share/elasticsearch/data
image: busybox:1.29.2
imagePullPolicy: IfNotPresent
name: set-dir-owner
resources: {}
securityContext:
privileged: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /usr/share/elasticsearch/data
name: elasticsearch-data
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 10
updateStrategy:
type: OnDelete
volumeClaimTemplates:
- metadata:
creationTimestamp: null
name: elasticsearch-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi

关于elasticsearch 集群成员没有在 Kubernetes 中进入就绪状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68681135/

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