forked from dCache/SmallFiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
63 lines (55 loc) · 1.93 KB
/
install.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh
SRC_BIN="src/skel/usr/local/bin"
SRC_ETC="src/skel/etc/dcache"
SRC_LIB="src/skel/usr/share/dcache/lib"
LOCAL_BIN="/usr/local/bin/"
LOCAL_ETC="/etc/dcache"
LOCAL_LOG="/var/log/dcache"
DCACHE_LIB="/usr/share/dcache/lib/"
if [ ! $# = 1 ];
then
echo "This script needs root privileges"
echo
echo "Usage: install [pack [--update]|pool]"
echo "Modes: "
echo " pack: Install packing scripts"
echo " pool: Install hsm scripts"
echo
exit 1
fi
if [ ${1} = "pack" ];
then
echo "Copying packing scripts to ${LOCAL_BIN}"
cp "${SRC_BIN}/pack-files.py" "${LOCAL_BIN}"
cp "${SRC_BIN}/fillmetadata.py" "${LOCAL_BIN}"
cp "${SRC_BIN}/writebfids.py" "${LOCAL_BIN}"
cp "${SRC_BIN}/dcap.py" "${LOCAL_BIN}"
if [ ${2} != "--update" ];
then
echo "Copying configuration file to ${LOCAL_ETC}"
mkdir -p "${LOCAL_ETC}"
cp "${SRC_ETC}/container.conf" "${LOCAL_ETC}"
echo "Creating log directory ${LOCAL_LOG}"
mkdir -p "${LOCAL_LOG}"
fi
echo "Make sure your MongoDB is accessible from the pools and the packing machines"
echo "and has an index on ctime on the smallfiles database."
echo ""
echo "To get started edit the configuration in /etc/dcache/container.conf."
fi
if [ ${1} = "pool" ];
then
echo "Copying hsm scripts to ${DCACHE_LIB}"
cp "${SRC_LIB}/hsm-internal.sh" "${DCACHE_LIB}"
cp "${SRC_LIB}/datasetPut.js" "${DCACHE_LIB}"
echo "To setup a pool to use the hsm-internal.sh script, set the following properties (adjusted to your system) on your pool:"
echo ""
echo "hsm set dcache -mongoUrl=packer/smallfiles"
echo "hsm set dcache -dcapLib=/usr/lib64/libdcap.so.1"
echo "hsm set dcache -dcapDoor=dcap-door:22125"
echo "hsm set dcache -command=/usr/share/dcache/lib/hsm-internal.sh"
echo ""
echo "On the directory that will hold the small files, set the sGroup and OSMTemplate tags to s.th. appropriate"
echo "Then set the hsmInstance tag on that directory to 'dcache'"
fi
echo "finished."