WwanjunleiK零S
leishengxn 是的
leishengxn 是的
wanjunlei 我要更改的是runbroker.sh,他的目录在/home/rocketmq/rocketmq-4.7.0/bin 下,我直接把文件挂载到这个目录下也改名成runbroker.sh,启动的时候说文件不存在
你这挂载的是存储吧?要挂载配置
wanjunlei 是挂载的配置,我觉的
路径有问题
挂载的时候你目录覆盖了镜像里的目录,导致这个目录下的其他文件都没了,你挂载配置的时候选择特定的键和路径,
键就是runbroker.sh
wanjunlei 那我是不是还需要写启动命令?
应该不需要,你可以试一试
wanjunlei 一直在更新中
wanjunlei 启动不了,一直更新
报什么错?
wanjunlei 没有报错,一直是更新中的状态
我也试了另外一个服务,也按照这样改,也一直更新中的状态
wanjunlei 容器组也没有这个服务
wanjunlei 事件里面提示
create Pod aaaa-d0atm5-0 in StatefulSet aaaa-d0atm5 failed error: Pod “aaaa-d0atm5-0″ is invalid: [spec.volumes[1].configMap.items[0].path: Invalid value: “/home/rocketmq/rocketmq-4.7.0/bin/runbroker.sh”: must be a relative path, spec.containers[0].volumeMounts[1].name: Not found: “volume-16i98z”]
把挂载路径/home/rocketmq/rocketmq-4.7.0/bin/runbroker.sh 改成/home/rocketmq/rocketmq-4.7.0/bin/
wanjunlei 还是这个错
你把service的yaml文件发出来看下
wanjunlei kind: Service
apiVersion: v1
metadata:
name: aaaa
namespace: daiyu
labels:
app: aaaa
annotations:
kubesphere.io/serviceType: statefulservice
spec:
ports:
- name: tcp-10909
protocol: TCP
port: 10909
targetPort: 10909
- name: tcp-10911
protocol: TCP
port: 10911
targetPort: 10911
- name: tcp-10912
protocol: TCP
port: 10912
targetPort: 10912
- name: tcp-9876
protocol: TCP
port: 9876
targetPort: 9876
selector:
app: aaaa
clusterIP: None
type: ClusterIP
sessionAffinity: ClientIP
sessionAffinityConfig:
clientIP:
timeoutSeconds: 10800
还有对应的工作负载的yaml
wanjunlei
kind: StatefulSet
apiVersion: apps/v1
metadata:
name: aaaa-d0atm5
namespace: daiyu
labels:
app: aaaa
annotations:
kubesphere.io/alias-name: aaaa
spec:
replicas: 1
selector:
matchLabels:
app: aaaa
template:
metadata:
creationTimestamp: null
labels:
app: aaaa
annotations:
kubesphere.io/containerSecrets: ''
kubesphere.io/restartedAt: ‘2020-07-22T03:11:28.685Z’
logging.kubesphere.io/logsidecar-config: ‘{}’
spec:
volumes:
- name: volume-2jsqfn
configMap:
name: rocket-berak
items:
- key: borker
path: broker.conf
defaultMode: 420
- name: volume-16i98z
configMap:
name: berak-sh
items:
- key: runbroker.sh
path: /home/rocketmq/rocketmq-4.7.0/bin/
defaultMode: 420
containers:
- name: container-mxvydq
image: ‘foxiswho/rocketmq:broker-4.7.0′
ports:
- name: tcp-10909
containerPort: 10909
protocol: TCP
- name: tcp-10911
containerPort: 10911
protocol: TCP
- name: tcp-10912
containerPort: 10912
protocol: TCP
- name: tcp-9876
containerPort: 9876
protocol: TCP
resources:
requests:
cpu: 10m
memory: 10Mi
volumeMounts:
- name: volume-2jsqfn
mountPath: /etc/rocketmq
- name: volume-16i98z
mountPath: /data
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: IfNotPresent
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
serviceAccountName: default
serviceAccount: default
securityContext: {}
affinity: {}
schedulerName: default-scheduler
serviceName: aaaa
podManagementPolicy: OrderedReady
updateStrategy:
type: RollingUpdate
rollingUpdate:
partition: 0
revisionHistoryLimit: 10
这样配置,注意下面的挂载路径开始没有 /