ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

使用foreman 管理基于Procfile 的应用

2019-12-30 20:54:11  阅读:360  来源: 互联网

标签:foreman Procfile http etcd IP initial 基于 cluster urls


foreman 是一个协议,我们可以用来方便的管理基于Procfile 文件定义的应用(测试环境会很方便,当然生产也可以使用)
我们可以用来快速的搭建一个服务的依赖系统,同时方便的进行管理,同时社区也有了多种语言的实现

几个方便的语言实现

一个基于goreman 部署的本地etcd 集群

  • Procfile
 
# Use goreman to run `go get github.com/mattn/goreman`
# Change the path of bin/etcd if etcd is located elsewhere
etcd1: bin/etcd --name infra1 --listen-client-urls http://${IP}:2379 --advertise-client-urls http://${IP}:2379 --listen-peer-urls http://${IP}:12380 --initial-advertise-peer-urls http://${IP}:12380 --initial-cluster-token etcd-cluster-1 --initial-cluster 'infra1=http://${IP}:12380,infra2=http://${IP}:22380,infra3=http://${IP}:32380' --initial-cluster-state new --enable-pprof --logger=zap --log-outputs=stderr
etcd2: bin/etcd --name infra2 --listen-client-urls http://${IP}:22379 --advertise-client-urls http://${IP}:22379 --listen-peer-urls http://${IP}:22380 --initial-advertise-peer-urls http://${IP}:22380 --initial-cluster-token etcd-cluster-1 --initial-cluster 'infra1=http://${IP}:12380,infra2=http://${IP}:22380,infra3=http://${IP}:32380' --initial-cluster-state new --enable-pprof --logger=zap --log-outputs=stderr
etcd3: bin/etcd --name infra3 --listen-client-urls http://${IP}:32379 --advertise-client-urls http://${IP}:32379 --listen-peer-urls http://${IP}:32380 --initial-advertise-peer-urls http://${IP}:32380 --initial-cluster-token etcd-cluster-1 --initial-cluster 'infra1=http://${IP}:12380,infra2=http://${IP}:22380,infra3=http://${IP}:32380' --initial-cluster-state new --enable-pprof --logger=zap --log-outputs=stderr
proxy: bin/etcd grpc-proxy start --endpoints=${IP}:2379,${IP}:22379,${IP}:32379 --listen-addr=${IP}:23790 --advertise-client-url=${IP}:23790 --enable-pprof
# A learner node can be started using Procfile.learner
  • 环境变量
    .env 文件
 
IP=127.0.0.1
  • 启动
goreman -f Procfile start

参考资料

https://ddollar.github.io/foreman/
https://github.com/mattn/goreman

标签:foreman,Procfile,http,etcd,IP,initial,基于,cluster,urls
来源: https://www.cnblogs.com/rongfengliang/p/12121637.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有