Whamcloud - gitweb
b81455f2a217e74d8a9112bb2317e476252902e9
[fs/lustre-release.git] / lustre / tests / ba-mount.sh
1 #!/bin/bash
2
3 # There are configurations for three machines in this config file: the OST,
4 # the MDS/client, other clients
5 #
6 # To start your cluster using the ba-mount.xml file that this produces, first
7 # run:
8 # > lconf ba-mount.xml
9 # on the MDS/client, and then run:
10 # > lconf --node client ba-mount.xml
11 # on any other clients.
12
13 config=${1:-ba-mount.xml}
14
15 LMC_REAL="${LMC:-../utils/lmc} -m $config"
16 LMC="save_cmd"
17
18 TCPBUF=1048576
19 OST=${OST:-ba-ost-1}
20 MDS=`hostname`
21  
22 UUIDLIST=${UUIDLIST:-/usr/local/admin/ba-ost/UUID.txt}
23
24 h2ip () {
25     echo "${1}"
26 }
27 BATCH=/tmp/lmc-batch.$$
28 save_cmd() {
29     echo "$@" >> $BATCH
30 }
31
32 [ -f $config ] && rm $config
33
34 # MDS/client node
35 ${LMC} --node $MDS --tcpbuf $TCPBUF --net $MDS tcp
36 ${LMC} --node $MDS --mds mds1 /tmp/mds1 50000
37
38 OBD_UUID=`awk "/$OST / { print \\$3 }" $UUIDLIST`
39 [ "$OBD_UUID" ] && OBD_UUID="--obduuid=$OBD_UUID" || echo "$OST: no UUID"
40
41 # server node
42 ${LMC} --node $OST --tcpbuf $TCPBUF --net $OST tcp
43 ${LMC} --node $OST $OBD_UUID --ost bluearc
44
45 # mount point on the MDS/client
46 ${LMC} --node $MDS --mtpt /mnt/lustre mds1 OSC_$OST
47
48 # other clients
49 ${LMC} --node client --tcpbuf $TCPBUF --net '*' tcp
50 ${LMC} --node client --mtpt /mnt/lustre mds1 OSC_$OST
51
52 $LMC_REAL --batch $BATCH
53 rm -f $BATCH