Rancher(https://rancher.com/)是一個容器管理平臺,能夠添加、刪除容器,查看容器運行狀態,也能夠批量啓動和中止docker compose組成的多個docker組合而成的應用服務,能夠支持多臺服務節點,支持雲服務器,支持多種受權管理方式。Rancher具備Web GUI,操做很方便,入門比較快。node
Rancher自己也是容器服務,快速安裝參考:https://rancher.com/quick-start/git
Rancher能夠直接啓動Docker的鏡像,也能夠從「應用商店」裏快速啓動一個應用服務。github
Rancher「應用商店」實質是docker compose支持的docker image集合,包括官方的應用服務和社區庫,都採用git庫的方式存儲在github中(https://github.com/rancher/community-catalog)。咱們也能夠按照相似的格式建立github庫,而後將其添加到Rancher的「應用商店」目錄列表中。docker
在github.com中建立一個新項目,如rancher-catalog。服務器
name: Apache Kafka description: | Kafka cluster version: 1.0.0-rancher1 category: Clustering maintainer: "Raul Sanchez <rawmind@gmail.com>" minimum_rancher_version: v0.59.0 license: projectURL: https://github.com/rawmind0/alpine-kafka
.catalog: name: Kafka version: 0.9.0-rancher1 description: | (Experimental) Apache Kafka cluster. minimum_rancher_version: v0.56.0 maintainer: "Raul Sanchez <rawmind@gmail.com>" uuid: kafka-0 questions: - variable: "kafka_scale" description: "Number of brokers nodes. Note: Recommended an odd number" label: "Broker Nodes:" required: true default: 3 type: "int" - variable: "kafka_mem" description: "Amount of memory to config brokers." label: "Broker Memory (mb):" required: true default: 1024 type: "string" - variable: "kafka_interval" description: "Interval to poll/apply configuration changes. 0 to disable" label: "Broker Interval (s):" required: true default: 60 type: "int" - variable: "zk_link" description: | Choose the Zookeeper service to use. It's really recommended a dedicated zookeeper service just for Kafka. label: "Zookeeper stack/service" default: "kafka-zk/zk" required: true type: "service" broker: scale: ${kafka_scale} health_check: port: 9092 interval: 5000 unhealthy_threshold: 3 request_line: '' healthy_threshold: 2 response_timeout: 5000
broker: tty: true image: rawmind/rancher-kafka:0.9.0 volumes: - /opt/kafka/data environment: - JVMFLAGS=-Xmx${kafka_mem}m -Xms${kafka_mem}m - CONFD_INTERVAL=${kafka_interval} - ZK_SERVICE=${zk_link} external_links: - ${zk_link}:zk
按照上面的流程,能夠在一個gihub項目中建立多個應用服務。app
如今,進入Rancher,在「添加應用商店」,將github庫添加到Rancher的「應用商店」目錄列表中。svg
若是沒有顯示出來,嘗試到「系統管理->系統設置」中添加,而後到「應用商店」中點擊刷新按鈕。ui
應用商店的詳細格式:http://www.javashuo.com/article/p-fiuatifz-dy.htmlspa
自動建立應用商店參考:https://github.com/slashgear/generator-rancher-catalog.net