2017-03-13 20:11:28 +08:00
|
|
|
#配置apt源
|
|
|
|
#echo "deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
|
|
|
|
#deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
|
|
|
|
#deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
|
|
|
|
#deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
|
|
|
|
#deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse" > /etc/apt/sources.list
|
|
|
|
|
|
|
|
#更新apt
|
|
|
|
apt-get update
|
|
|
|
|
|
|
|
|
|
|
|
#下载git包
|
2018-05-13 13:21:17 +08:00
|
|
|
apt-get install -y git
|
2017-03-13 20:11:28 +08:00
|
|
|
|
|
|
|
#下载docklet源码
|
|
|
|
git clone http://github.com/unias/docklet.git /home/docklet
|
|
|
|
|
|
|
|
#运行prepare.sh
|
2018-05-13 13:21:17 +08:00
|
|
|
sed -i '61s/^/#&/g' /home/docklet/prepare.sh
|
|
|
|
sed -i '62s/^/#&/g' /home/docklet/prepare.sh
|
2017-03-13 20:11:28 +08:00
|
|
|
/home/docklet/prepare.sh
|
|
|
|
|
|
|
|
#挂载global目录,通过gluster方式
|
2018-05-13 13:21:17 +08:00
|
|
|
#mount -t glusterfs docklet-master:/docklet /opt/docklet/global
|
2017-03-13 20:11:28 +08:00
|
|
|
|
|
|
|
#下载base镜像
|
2018-05-13 13:21:17 +08:00
|
|
|
#wget http://docklet.unias.org/images/basefs-0.11.tar.bz2 -P /opt/local/temp
|
2017-03-13 20:11:28 +08:00
|
|
|
|
|
|
|
#解压镜像
|
2018-05-13 13:21:17 +08:00
|
|
|
#mkdir -p /opt/docklet/local
|
|
|
|
#mkdir -p /opt/docklet/global
|
|
|
|
#tar -jxvf /root/basefs-0.11.tar.bz2 -C /opt/docklet/local/
|
2017-03-13 20:11:28 +08:00
|
|
|
|
|
|
|
#获得docklet.conf
|
|
|
|
cp /home/docklet/conf/docklet.conf.template /home/docklet/conf/docklet.conf
|
2018-05-13 13:21:17 +08:00
|
|
|
cp /home/docklet/web/templates/home.template /home/docklet/web/templates/home.html
|
2017-03-13 20:11:28 +08:00
|
|
|
|
|
|
|
#获得网卡名称
|
|
|
|
NETWORK_DEVICE=`route | grep default | awk {'print $8'};`
|
|
|
|
|
|
|
|
#更改配置文件
|
2018-05-13 13:21:17 +08:00
|
|
|
echo "DISKPOOL_SIZE=20000
|
|
|
|
ETCD=%MASTERIP%:2379
|
2017-03-13 20:11:28 +08:00
|
|
|
NETWORK_DEVICE=$NETWORK_DEVICE
|
2018-05-13 13:21:17 +08:00
|
|
|
PROXY_PORT=8000
|
|
|
|
NGINX_PORT=80" >> /home/docklet/conf/docklet.conf
|
2017-03-13 20:11:28 +08:00
|
|
|
|
|
|
|
#启动worker
|
2018-05-13 13:21:17 +08:00
|
|
|
#/home/docklet/bin/docklet-supermaster init
|
|
|
|
#/home/docklet/bin/docklet-worker start
|
2017-03-13 20:11:28 +08:00
|
|
|
exit 0
|