Setup

在 Linux 拉起来一个最小的 eru 单点集群.

前置配置

节点需要安装 Docker 并且把 Docker 配置为监听 0.0.0.0:2376.

部署一个 etcd

单节点就行了, 用容器跑起来超简单.

docker run -d --net host --name etcd --restart always quay.io/coreos/etcd:v3.4.9 /usr/local/bin/etcd --enable-v2 --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://etcd:2379

准备一个配置文件

这是 eru-core 的配置文件, 详细的配置在这里

mkdir -p /etc/eru
cat <<! > /etc/eru/core.yaml
log_level: "DEBUG"
bind: ":5001"
service_address: 127.0.0.1:5001
statsd: "127.0.0.1:8125"
profile: ":12346"
global_timeout: 300s
lock_timeout: 30s
cert_path: "/tmp"
max_concurrency: 20

grpc:
    max_concurrent_streams: 100

etcd:
    machines:
        - "http://localhost:2379"
    prefix: "/eru"
    lock_prefix: "core/_lock"

docker:
    log:
      type: "json-file"
      config:
        "max-size": "10m"
    network_mode: "bridge"
    hub: "hub.docker.com"
    namespace: "projecteru2"
    build_pod: "local"
    local_dns: true

scheduler:
    maxshare: -1
    sharebase: 100
!

起服务

安装命令行 eru-cli

运行我们的第一个 eru 命令:

成功的话能看到输出:

因为还是一个空集群, 不过:

Welcome to Eru world!

加节点

就把自己所在的节点加入 eru-core:

需要先把 dockerd 设置为绑定 2376 端口:

然后就可以在 eru-core 里注册节点了. 不过你需要先添加一个 pod

顺利的话你能看到正确的输出:

接下来我们可以开始创建应用了.

Last updated