|
@@ -3,21 +3,17 @@ set -e
|
|
|
|
|
|
start_consul()
|
|
|
{
|
|
|
- ip=`get_ip`
|
|
|
+ ip=`get_ip 10`
|
|
|
if [ "$1" == "server" ]; then
|
|
|
process_start consul agent -server -bootstrap-expect 1 -data-dir /root/consul/data -config-dir /root/consul/config -client 0.0.0.0
|
|
|
elif [ "$1" == "client" ]; then
|
|
|
process_start consul agent -client -config-dir /root/consul/config -join 0.0.0.0
|
|
|
+ elif [ `echo $@|grep bind|wc -l` -eq 1 ];then
|
|
|
+ process_start consul agent $@
|
|
|
elif [ `echo $@|grep node|wc -l` -eq 1 ];then
|
|
|
- if [ `echo $@|grep join|wc -l` != 1 ];then
|
|
|
- echo "$ip consul_master" >> /etc/hosts
|
|
|
- fi
|
|
|
process_start consul agent $@ -bind=$ip
|
|
|
- else
|
|
|
- if [ `echo $@|grep join|wc -l` != 1 ];then
|
|
|
- echo "$ip consul_master" >> /etc/hosts
|
|
|
- fi
|
|
|
- process_start consul agent $@ -bind=$ip -node=$ip
|
|
|
+ else
|
|
|
+ process_start consul agent $@ -bind=$ip -node=$ip
|
|
|
fi
|
|
|
#consul members
|
|
|
}
|