博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
test-definitions/blob/master/auto-test/etcd/etcd.sh
阅读量:4214 次
发布时间:2019-05-26

本文共 2397 字,大约阅读时间需要 7 分钟。

#!/bin/bash#回显执行的命令和参数set -x#cd到目录执行脚本,然后通过cd - 返回到当前目录cd ../../utils. ./sys_info.sh. ./sh-test-libcd -#根据不同的发行版安装repocase "${distro}" in	centos|fedora)		sudo wget -O /etc/yum.repos.d/estuary.repo https://raw.githubusercontent.com/open-estuary/distro-repo/master/estuaryftp.repo		sudo chmod +r /etc/yum.repos.d/estuary.repo		sudo rpm --import ftp://repoftp:repopushez7411@117.78.41.188/releases/ESTUARY-GPG-KEY		yum clean dbcache		print_info $? setup-estuary-repository		#保存好repo之后安装etcd的安装包		pkgs="etcd"		install_deps "${pkgs}"		print_info $? install-bazel	;;	*)		error_msg "Unsupported distribution!"esac#启动etcd server 并在后台运行etcd &print_info $? start-single-etcd#执行etcdctl 命令etcdctl set hello worldprint_info $? create-key-valueetcdctl get hello | grep "world"print_info $? search-key-value#删除etcd 进程kill -9 $(pidof etcd)print_info $? stop-single-etcdecho $local_ip#重新执行etcd命令,设置位置参数etcd --name infra0 --initial-advertise-peer-urls http://$local_ip:2380 \	--listen-peer-urls http://$local_ip:2380 \	--listen-client-urls http://$local_ip:2379,http://127.0.0.1:2379 \	--advertise-client-urls http://$local_ip:2379 \	--initial-cluster-token etcd-cluster-1 \	--initial-cluster infra0=http://$local_ip:2380,infra1=http://$local_ip:2382,infra2=http://$local_ip:2384 \	--initial-cluster-state new &etcd --name infra1 --initial-advertise-peer-urls http://$local_ip:2382 \	--listen-peer-urls http://$local_ip:2382 \	--listen-client-urls http://$local_ip:2381,http://127.0.0.1:2381 \	--advertise-client-urls http://$local_ip:2381 \	--initial-cluster-token etcd-cluster-1 \	--initial-cluster infra0=http://$local_ip:2380,infra1=http://$local_ip:2382,infra2=http://$local_ip:2384 \	--initial-cluster-state new &etcd --name infra2 --initial-advertise-peer-urls http://$local_ip:2384 \	--listen-peer-urls http://$local_ip:2384 \	--listen-client-urls http://$local_ip:2383,http://127.0.0.1:2383\	--advertise-client-urls http://$local_ip:2383 \	--initial-cluster-token etcd-cluster-1 \	--initial-cluster infra0=http://$local_ip:2380,infra1=http://$local_ip:2382,infra2=http://$local_ip:2384 \	--initial-cluster-state new &print_info $? start-cluster-etcd#执行etcdctl命令etcdctl member listprint_info $? search-cluster-listetcdctl cluster-health | grep 'cluster is healthy'print_info $? check-cluster-health#删除etcd 进程kill -9 $(pidof etcd)print_info $? stop-cluster-etcd#删除包yum remove -y etcdprint_info $? remove-etcd

转载地址:http://lznmi.baihongyu.com/

你可能感兴趣的文章
让自己不空虚就做出点事了
查看>>
android 标题 名字修改设计
查看>>
android 保持屏幕常亮
查看>>
android 获取权限以及feature
查看>>
android返回按键触摸监听
查看>>
android MediaPlayer 的使用背景音乐的播放
查看>>
感悟随笔1
查看>>
android list 保存点进行有关操作
查看>>
android menue键的相关设置 菜单的设置
查看>>
android应用上传至各应用平台(1)
查看>>
Android应用上传至各应用平台(2)
查看>>
eclipse中修改包名 Android应用上线包冲突问题
查看>>
android 消息接受传送与线程的启动
查看>>
android 欢迎界面的实现在一个activity中
查看>>
android menu 使用总结1
查看>>
C++结构体与链表总结
查看>>
c,c++宏
查看>>
c++中的枚举类型
查看>>
c++ 运算符重载
查看>>
android使用已安装程序实现分享功能
查看>>