Docker
597534

k8s安装20.3.0成功,但是重启pod后漂移到另一台机器会报错,已解决 悬赏5积分

提问者卖萌的生菜 答案数1 阅读数193 发表时间2024-07-24 23:58:19

k8s-deploy-yaml如下

---

kind: Deployment
apiVersion: apps/v1
metadata:
  name: svc-zentao
  namespace: base-service
  labels:
    app: svc-zentao
spec:
  replicas: 1
  selector:
    matchLabels:
      app: svc-zentao
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: svc-zentao
    spec:
      volumes:
      - name: zentao-pvc-test
        persistentVolumeClaim:
          claimName: zentao-pvc-test
      containers:
      - name: zentao
        image: zentao:20.3.0
        ports:
        - name: tcp-80
          containerPort: 80
          protocol: TCP
        env:
        - name: TZ
          value: Asia/Shanghai
        - name: MYSQL_INTERNAL
          value: 'true'
        resources:
          limits:
            cpu: '1'
            memory: 1Gi
          requests:
            cpu: '1'
            memory: 1Gi
        volumeMounts:
        - name: zentao-pvc-test
          mountPath: /data


---

持久化了 /data , 存储用的glsuterfs共享存储

如果还是使用这个节点跑zentao的话,不会报错,如果换节点的话, 存储是可以拉到的,只是会报错 

23:57:23.01 
 23:57:23.01 Welcome to the Easysoft ZenTao 20.3.0 container
 23:57:23.01 Subscribe to project updates by watching https://www.zentao.net
 23:57:23.01 Submit issues and feature requests at https://www.zentao.net/ask.html
 23:57:23.01 
 23:57:23.02 INFO  ==> Prepare persistence directories.
mv: cannot remove '/apps/zentao/config/license': Directory not empty
 23:57:23.01 Welcome to the Easysoft ZenTao 20.3.0 container
 23:57:23.01 Subscribe to project updates by watching https://www.zentao.net
 23:57:23.01 Submit issues and feature requests at https://www.zentao.net/ask.html
 23:57:23.01 
 23:57:23.02 INFO  ==> Prepare persistence directories.
mv: cannot remove '/apps/zentao/config/license': Directory not empty
,然后就重启了


 23:57:09.40 
 23:57:09.40 Welcome to the Easysoft ZenTao 20.3.0 container
 23:57:09.40 Subscribe to project updates by watching https://www.zentao.net
 23:57:09.40 Submit issues and feature requests at https://www.zentao.net/ask.html
 23:57:09.41 
 23:57:09.42 INFO  ==> Prepare persistence directories.
mv: cannot remove '/apps/zentao/config/license': Directory not empty
 23:57:09.40 
 23:57:09.40 Welcome to the Easysoft ZenTao 20.3.0 container
 23:57:09.40 Subscribe to project updates by watching https://www.zentao.net
 23:57:09.40 Submit issues and feature requests at https://www.zentao.net/ask.html
 23:57:09.41 
 23:57:09.42 INFO  ==> Prepare persistence directories.
mv: cannot remove '/apps/zentao/config/license': Directory not empty
 23:57:09.40 
 23:57:09.40 Welcome to the Easysoft ZenTao 20.3.0 container
 23:57:09.40 Subscribe to project updates by watching https://www.zentao.net
 23:57:09.40 Submit issues and feature requests at https://www.zentao.net/ask.html
 23:57:09.41 
 23:57:09.42 INFO  ==> Prepare persistence directories.
mv: cannot remove '/apps/zentao/config/license': Directory not empty
23:57:23.01 
 23:57:23.01 Welcome to the Easysoft ZenTao 20.3.0 container
 23:57:23.01 Subscribe to project updates by watching https://www.zentao.net
 23:57:23.01 Submit issues and feature requests at https://www.zentao.net/ask.html
 23:57:23.01 
 23:57:23.02 INFO  ==> Prepare persistence directories.
mv: cannot remove '/apps/zentao/config/license': Directory not empty


禅道版本:禅道开源版 20.2.0

安装包类型:源码包

操作系统:CentOS

客户端浏览器:Chrome

设置备注
内容
答案列表
2024-07-25 09:09:09
原因可能是mv的目标目录下有与源目录下同名的目录。

可以尝试:在yaml中添加DEBUG环境变量为true开启debug后看看这个完整的命令行操作是什么,然后把目标目录下的文件手动重命名一下,看下。


另外,禅道使用问题,可以联系客户经理QQ,邀请加入技术交流群沟通。

😁
2024/07/25
;5;6m \033[38;5;5m13:19:48.24 \033[0m\033[38;5;2mINFO \033[0m ==> Zentao is ready to use.'
+ local bool=false, 日志是这个, 是不是禅道docker镜像 不支持 切换pod
😁
2024/07/25
local -r paths=/apps/zentao/config/license
+ local dir_mode=
+ local file_mode=
+ local user=
+ local group=
+ shift 1
+ '[' 2 -gt 0 ']'
+ case "$1" in
+ shift
+ dir_mode=777
+ shift
+ '[' 0 -gt 0 ']'
+ read -r -a filepaths
+ for p in "${filepaths[@]}"
+ [[ -e /apps/zentao/config/license ]]
+ [[ -n 777 ]]
+ find -L /apps/zentao/config/license -type d -exec chmod 777 '{}' ';'
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -z '' ]]
+ [[ -n '' ]]
+ '[' '!' -e /data/zentao/config/license ']'
+ '[' -e /apps/zentao/config/license ']'
+ '[' '!' -L /apps/zentao/config/license ']'
+ mv /apps/zentao/config/license /apps/zentao/config/license.15
mv: cannot remove '/apps/zentao/config/license': Directory not empty
+ exit 1
😁
2024/07/25
如果每次换node节点 都需要重命名 目标文件,这不合时吗,那和不支持k8s有啥区别
2024/07/25
正常和不正常的节点都执行docker info对比下,看下 storageDriver 的值分别是什么?
2024/07/25
docker info -f json | jq .Driver
联系我们
联系人
高丽亚/高级客户经理
电话(微信)
17667930330
QQ号码
3645260865
联系邮箱
gaoliya@chandao.com
返回顶部
高丽亚
高级客户经理
17667930330
3645260865
统一服务热线 4006-8899-23
我要提问提问有任何问题,您都可以在这里提问。 问题反馈反馈点击这里,让我们聆听您的建议与反馈。