Linux 下安装 Dopra 的实用指南
名称辨析与准备
场景一 安装 Dapr 分布式应用运行时
curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh | /bin/bashdapr --versiondapr initdocker ps 应能看到 dapr_redis、dapr_placement、dapr_sidecar_injector 等容器git clone https://github.com/dapr/quickstarts.git && cd quickstarts/hello-worlddapr run --app-id hello --port 3000 --protocol http -- python3 app.pycurl -H "Content-Type: text/plain" -d "Hello Dapr!" http://localhost:3000dapr init --runtime-version <版本号> --components-path <自定义路径>。场景二 安装 Docker 容器引擎
sudo yum update -y && sudo yum install -y yum-utils device-mapper-persistent-data lvm2sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.reposudo yum install -y docker-cesudo systemctl start docker && sudo systemctl enable dockersudo docker run hello-world(看到 “Hello from Docker!” 即成功)场景三 安装名为 Dopra 的特定软件或 Python 包
sudo apt update && sudo apt install dopra(如包名不同,请替换为实际包名)sudo dpkg -i dopra.debsudo apt-get install -fsudo apt install build-essential cmake git./configure && make && sudo make install(具体以项目 README/INSTALL 为准)pip install --upgrade pip && pip install dopra(或指定版本:pip install dopra==x.x.x)dopra --version