前几天给大家详细介绍了docker的集群存储软件etcd的安装(详细地址在http://dl528888.blog.51CTO.com/2382721/1623746)。今天我给大家详细介绍一下机群监控软件fleet的安装。
车队的详细介绍,复制于info
简单来说,我搭建一个docker集群,用etcd作为信息内容存储,fleet连接并 *** 纵所有节点的网络服务器的systemd,然后按照想要的指令在节点中搭建或求解docker船只。
下面是我自己画的一个舰队的框架图
Fleet和etcd都是由coreos开发设计,并嵌入到coreos系统中。不过我在docker集群的情况下在centos7系统软件中部署应用了这两款手机软件,应用起来非常方便。
下面是安装。
1.安装go
2.免费下载舰队
cd /tmp/ git clone https://github.com/coreos/fleet.git3.安装车队
cd fleet ./build4.承接可执行文件
cp bin/fleetd /usr/local/bin/ cp bin/fleetctl /usr/local/bin/5.配备车队
编写并在一个节点中装备/etc/fleet/fleet.conf。
09:15:02 # cat /etc/fleet/fleet.conf # This config file is INI-formatted # Lower the logging threshold. Acceptable values are 0, 1, and 2. A higher # value corresponds to a lower logging threshold. # verbosity=0 # Provide a custom set of etcd endpoints. The default value is determined # by the underlying go-etcd library. #etcd_servers=["http://192.168.65.2:4001"] # Amount of time in seconds to allow a single etcd request before considering it failed. # etcd_request_timeout=1.0 # Provide TLS configuration when SSL certificate authentication is enabled in etcd endpoints # etcd_cafile=/path/to/CAfile # etcd_keyfile=/path/to/keyfile # etcd_certfile=/path/to/certfile # IP address that should be published with any socket information. By default, # no IP address is published. public_ip="10.10.27.221" # Comma-delimited key/value pairs that are published to the fleet registry. # This data can be referenced in unit files to affect scheduling descisions. # An example could look like: metadata="region=us-west,az=us-west-1" metadata="region=cn-core-02" # An Agent will be considered dead if it exceeds this amount of time to # communicate with the Registry. The agent will attempt a heartbeat at half # of this value. # agent_ttl="30s" # Interval at which the engine should reconcile the cluster schedule in etcd. # engine_reconcile_interval=2只有public_ip和metadata必须为foundation更改。
6、配备启动脚本制作。
09:16:14 # cat /usr/lib/systemd/system/fleet.service; [Unit] Description=Fleet Documentation=https://github.com/coreos/fleet [Service] Type=simple EnvironmentFile=-/etc/fleet/fleet.conf ExecStart=/usr/local/bin/fleetd -config /etc/fleet/fleet.conf ExecStop=/usr/bin/killall -9 fleetd Restart=on-failure RestartSec=5s [Install] WantedBy=multi-user.target7.启动舰队
systemctl start fleet8.查询集群情况。
在这个阶段,我已经建立了一个包含四个节点的集群。
09:15:06 # fleetctl list-machines -l MACHINEIPMETADATA 1a1b60030aaef2f1d8d0468f0000002d10.10.21.199region=cn-core-01 6d832c54a40fe752dba35d0b0000002410.10.27.221region=cn-core-02 893b160e363b4ec7834719a7f06e67cf10.10.17.3region=cn-core-04 cce83e1dd55b46f6a543b49a6b59586a10.10.17.3region=cn-core-03Machine是服务器的唯一标识符,ip是之前fleet.conf中的public_ip项,metadata是fleet.conf中的元数据..
在此阶段,集群已经创建完毕。请在立即安装fleet之前在每个节点上安装etcd,否则fleet将无法工作。以后我们会全面详细的介绍一个docker集群的真实案例。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)