consul安装部署

consul_template: https://www.hi-linux.com/posts/36431.html

1、下载安装包 并解压consul 得到consul二进制文件

https://releases.hashicorp.com/consul/1.3.1/consul_1.3.1_linux_amd64.zip 

mkdir /application &&  mv consul /application

2、启动脚本启动consul_server 

#!/bin/bash
bin_path=/application/
data_path="$bin_path"/data
nodename=`hostname`
idc=dc1
bindip=`/sbin/ifconfig eth0 |grep '\binet \b' |sed -nr 's#[^0-9]*([0-9.]*).*#\1#gp'`
bootstrap_expect=1
$bin_path/consul agent  -server \
                        -bind=$bindip \
                        -ui \
   -client=0.0.0.0 \
                        -bootstrap-expect=$bootstrap_expect \
                        -data-dir $data_path \
                        -node $nodename \
                        -datacenter=$idc \
                        -log-level=warn \
                        -pid-file=$bin_path/consul.pid


猜你喜欢

转载自blog.51cto.com/dellinger/2392519