Project

General

Profile

Set up a new station

We'll go though doing a "hypot" station in the "hypot" experiment...

Create a station config file

  • ssh sam@samwebgpvm03 (or wherever stations live now)
  • cd config
  • copy an existing consumption rules file:
    cp station_rules/gm2_consumption_rules.cfg station_rules/hypot_consumption_rules.cfg
  • convert an existing config file
    sed -e 's/gm2/hypot/g' < station_gm2.conf > station_hypot.conf
  • find a port number for it get a list of existing ones, pick a number one higher than max
    grep http-server-port *.conf | sort -n -k 3
  • edit the hypot.conf and set the http-server-port

Map the station in apache config

  • cd ~/httpd/conf.d
  • Add a rule to sam_web_servers.conf with your port number from above instead of PORT below:
    <Location /sam/hypot/stations/hypot>
    ProxyPass http://localhost:PORT max=50 connectiontimeout=1800 ttl=5 retry=0
    </Location>
    
  • restart apache with $HOME/bin/apachectl graceful

Add station to supervisor.conf

  • cd ~/config
  • Add en entry to the supervisor.conf there
    #
    [program:station_hypot]
    command = /home/sam/bin/samstationctl v11_0_14 hypot  start --config-file=%(here)
    s/%(program_name)s.conf
    stdout_logfile = /home/sam/logs/%(program_name)s/stdouterr.log
    redirect_stderr = true
    
  • have supervisord re-read its config
    source $HOME/products/setups
    setup supervisor
    supervisorctl update
    

Configure station in sam database

Currently there are no client commands to modify station settings, and disk and group changes require a restart to take effect. So the station set up requires using curl directly.

Add station to the database:

$ curl --data-urlencode "name=hypot" -k --cert /tmp/x509up_u$(id -u) https://samweb.fnal.gov:8483/sam/hypot/api/stations

Add disks to station:

$ curl --data-urlencode "node=dcache" --data-urlencode "mountpoint=enstore:/pnfs/hypot" -k --cert /tmp/x509up_u$(id -u) https://samweb.fnal.gov:8483/sam/hypot/api/stations/name/hypot/disks
$ curl --data-urlencode "node=dcache" --data-urlencode "mountpoint=virtual:dcache:/pnfs/hypot/scratch" -k --cert /tmp/x509up_u$(id -u) https://samweb.fnal.gov:8483/sam/hypot/api/stations/name/hypot/disks
$ curl --data-urlencode "node=dcache" --data-urlencode "mountpoint=virtual:dcache:/pnfs/hypot/persistent" -k --cert /tmp/x509up_u$(id -u) https://samweb.fnal.gov:8483/sam/hypot/api/stations/name/hypot/disks
$ curl --data-urlencode "node=hypotdata" --data-urlencode "mountpoint=virtual:hypotdata:/hypot/data" -k --cert /tmp/x509up_u$(id -u) https://samweb.fnal.gov:8483/sam/hypot/api/stations/name/hypot/disks

... and to SAM:

$ samweb -e hypot add-data-disk enstore:/pnfs/hypot
$ samweb -e hypot add-data-disk dcache:/pnfs/hypot/persistent
$ samweb -e hypot add-data-disk dcache:/pnfs/hypot/scratch
$ samweb -e hypot add-data-disk hypotdata:/hypot/data
$ samweb -e hypot list-data-disks

and a group:
$ samweb -e hypot add-value groups hypot
$ curl --data-urlencode "group=hypot" -k --cert /tmp/x509up_u$(id -u) https://samweb.fnal.gov:8483/sam/hypot/api/stations/name/hypot/groups