Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nacos-server docker镜像初始脚本报错 #469

Open
liujing1087 opened this issue Aug 19, 2024 · 5 comments
Open

nacos-server docker镜像初始脚本报错 #469

liujing1087 opened this issue Aug 19, 2024 · 5 comments

Comments

@liujing1087
Copy link

最新V2.4.1 docker镜像的基础镜像改用alpine, 其使用的sh命令不支持数组,会报“syntax error: unexpected "("”;且alpine中的ping命令其-c参数必须在域名之前(即ping -c 1 nacos-0.nacos-headless.ciotd-system.svc.cluster.local),-c参数放在尾部也会报错。上述两个问题会导致pod无法启动或启动后集群组建失败。
微信截图_20240819185319

@zhengyu1992linux
Copy link

发现这个问题了,作者太马虎了我只能说

@QQ853695231
Copy link

2.4.3版本的依旧不行,也是报这个错。

@2387503106
Copy link

2.5.0版本的也不行,也是这个问题

@zhaomingcheng01
Copy link

Image
生成的sh也有这个问题

@zhaomingcheng01
Copy link

      command:
        - sh
        - '-c'
        - >-
          array="nacos-0.nacos-headless.nacos.svc.cluster.local
          nacos-1.nacos-headless.nacos.svc.cluster.local
          nacos-2.nacos-headless.nacos.svc.cluster.local"

          for element in $array

          do
            while true
            do
              ping -c 1 $element > /dev/stdout
              if [ $? -eq 0 ]; then
                echo "$element all domain ready"
                break
              else
                echo "$element wait for other domain ready"
              fi
              sleep 1
            done
          done

          sleep 1


          echo "init success" && bin/docker-startup.sh

改成这样能起来

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants