-
Notifications
You must be signed in to change notification settings - Fork 0
/
node.sh
executable file
·27 lines (21 loc) · 897 Bytes
/
node.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
set -x -e
# Usage: ./stage2.sh node_ip control_service_ip
FLOCKER_NODE_NAME=$1
FLOCKER_CONTROL_NODE=$2
yum install -y https://s3.amazonaws.com/archive.zfsonlinux.org/epel/zfs-release.el7.noarch.rpm
yum install -y https://s3.amazonaws.com/clusterhq-archive/centos/clusterhq-release$(rpm -E %dist).noarch.rpm
yum install -y clusterhq-flocker-node
if selinuxenabled; then setenforce 0; fi
test -e /etc/selinux/config && sed --in-place='.preflocker' 's/^SELINUX=.*$/SELINUX=permissive/g' /etc/selinux/config
systemctl enable docker.service
systemctl start docker.service
mkdir -p /var/opt/flocker
truncate --size 10G /var/opt/flocker/pool-vdev
zpool create flocker /var/opt/flocker/pool-vdev
cat <<EOF >/etc/sysconfig/flocker-agent
FLOCKER_NODE_NAME = ${FLOCKER_NODE_NAME}
FLOCKER_CONTROL_NODE = ${FLOCKER_CONTROL_NODE}
EOF
systemctl enable flocker-agent
systemctl start flocker-agent