]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MONITOR/alistoragemanager/setupStorageDatabase.sh
small changes in configuration scripts for storage manager
[u/mrichter/AliRoot.git] / MONITOR / alistoragemanager / setupStorageDatabase.sh
1 #!/bin/bash
2 DB_PASS=""
3 HOST="localhost"   # IP of machine on which mysql database is located
4 PORT="5055"
5 DATABASE="storage"
6 USER="storage"
7 PASS="storage123"
8 TABLE="events"
9 STORAGE_PATH="/local/storedFiles"
10 MAX_SIZE="3000000"
11 MAX_OCCUPATION="80"
12 REMOVE_PERCENT="60"
13 EVENTS_IN_FILE="5"
14 EVENT_SERVER="pcald39fix"   # IP of machine running alieventserver
15 EVENT_SERVER_PORT="5024"
16 STORAGE_SERVER="localhost"      # IP of machine running alistorage
17 STORAGE_SERVER_PORT="5066"      # server thread communication port
18 STORAGE_CLIENT_PORT="5088"      # client thread communication port
19 XML_SERVER_PORT="5099"          # server of xml files
20 mysql -u root -p$DB_PASS -e "create database if not exists $DATABASE;"
21 mysql -u root -p$DB_PASS -e "grant ALL PRIVILEGES on $DATABASE.* to '$USER'@'$HOST' identified by '$PASS';"
22 mysql -u root -p$DB_PASS -e "use $DATABASE;"
23 mysql -u root -p$DB_PASS -e "CREATE TABLE IF NOT EXISTS $DATABASE.$TABLE(\
24 run_number int(6) NOT NULL,\
25 event_number int(6) NOT NULL,\
26 system text(7) DEFAULT NULL,\
27 multiplicity int(5) DEFAULT NULL,\
28 permanent tinyint(1) DEFAULT NULL,\
29 file_path text(100) DEFAULT NULL,\
30 PRIMARY KEY(run_number,event_number));"
31
32 echo "-----------------------------"
33 echo "Databases successfuly created"
34 echo "-----------------------------"