dapr离线安装

国内网络问题按dapr官方的指导无法完成安装,只能通过下载安装包的方式进行离线安装,步骤:

  1. 从https://github.com/dapr/cli/releases下载dapr_windows_amd64.zip或者dapr_linux_arm64.tar.gz
  2. 解压,在windows上需要将解决压后的路径添加到path环境变量,在linux上直接将解压后的dapr文件复制到/usr/local/bin目录下
  3. 输入:dapr,出现如下内容表示dapr CLI安装成功
  4.          __
        ____/ /___ _____  _____
       / __  / __ '/ __ \/ ___/
      / /_/ / /_/ / /_/ / /
      \__,_/\__,_/ .___/_/
                  /_/
    
    ===============================
    Distributed Application Runtime
    
    Usage:
      dapr [command]
    
    Available Commands:
      completion     Generates shell completion scripts
      components     List all Dapr components. Supported platforms: Kubernetes
      configurations List all Dapr configurations. Supported platforms: Kubernetes
      dashboard      Start Dapr dashboard. Supported platforms: Kubernetes and self-hosted
      help           Help about any command
      init           Install Dapr on supported hosting platforms. Supported platforms: Kubernetes and self-hosted
      invoke         Invoke a method on a given Dapr application. Supported platforms: Self-hosted
      list           List all Dapr instances. Supported platforms: Kubernetes and self-hosted
      logs           Get Dapr sidecar logs for an application. Supported platforms: Kubernetes
      mtls           Check if mTLS is enabled. Supported platforms: Kubernetes
      publish        Publish a pub-sub event. Supported platforms: Self-hosted
      run            Run Dapr and (optionally) your application side by side. Supported platforms: Self-hosted
      status         Show the health status of Dapr services. Supported platforms: Kubernetes
      stop           Stop Dapr instances and their associated apps. . Supported platforms: Self-hosted
      uninstall      Uninstall Dapr runtime. Supported platforms: Kubernetes and self-hosted
      upgrade        Upgrades a Dapr control plane installation in a cluster. Supported platforms: Kubernetes
    
    Flags:
      -h, --help      help for dapr
      -v, --version   version for dapr
    
    Use "dapr [command] --help" for more information about a command.
    

  5. 从https://github.com/dapr/dashboard/releases/上下载dashboard_linux_amd64.tar.gz,如果是windows则请下载对应的windows版本
  6. 从https://github.com/dapr/dashboard/releases/上下载daprd_linux_amd64.tar.gz,如果是windows则请下载对应的windows版本
  7. 执行:dapr init,一般都会由于网络问题而导致初始化过程中止,运行docker ps命令会看到多了三个容器,其中 dapr_placement应当是一直处于运行失败的状态
  8. 将dashboard_linux_amd64.tar.gz和daprd_linux_amd64.tar.gz复制到/root/.dapr/bin目录下,windows上应当是C:\Users\{用户名}\.dapr\bin目录下,并解压。
  9. 执行docker restart dapr_placement后,dapr_placement容器将会处于正常运行的状态
  10. 执行dapr --version,看到如下内容表示正常:
  11. CLI version: 1.8.1 
    Runtime version: 1.8.4
  12. 如果看到Runtime version: n/a则表示没有成功
  13. 初始化成功后,可继续按官方文档进行后面的操作

你可能感兴趣的:(linux,运维,服务器)