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
| # cat /etc/salt/master.d/chubaofs.conf
nodegroups:
cfs-m7-01: 'G@app:chubaofs and G@env:test and G@cluster:m7-01'
cfs-tz-01: 'G@app:chubaofs and G@env:prod and G@cluster:tz-01'
cfs-yz-01: 'G@app:chubaofs and G@env:prod and G@cluster:yz-01'
# /srv/salt/chubaofs
$
$ salt -N "${CLUSTER_NAME}" cp.get_file salt://chubaofs/pkg/${CFS_VERSION}/${CFS_SERVER} ${CFS_BIN_PATH}
$ salt -C "G@app:${CLUSTER_APP} and G@cluster:${CLUSTER_NAME} and G@role:${CLUSTER_ROLE}" \
cp.get_file salt://chubaofs/cluster/${CLUSTER_NAME}/conf/${CLUSTER_ROLE}.json \
/opt/${CLUSTER_APP}/conf/${CLUSTER_ROLE}.json makedirs=True
cd /srv/salt/chubaofs/cluster/
for hostin in `ls master*.json | grep -E -o "[0-9.]+[0-9]+"` ; do
$ salt -C "G@app:${CLUSTER_APP} and G@cluster:${APP_CLUSTER_NAME} and G@role:${CLUSTER_ROLE} and G@ip:${hostip}" \
cp.get_file salt://chubaofs/cluster/${CLUSTER_NAME}/conf/${role}-${hostip}.json \
/opt/${CLUSTER_APP}/conf/${role}.json makedirs=True
done
salt -N 'cfs-yz-ai-02' cmd.run 'ls -l /opt/chubaofs/script'
|