CN Purge and Installation Instructions --Version 858
----------------------------------------------------

::

  cn-ucsb-1, cn-unm-1, cn-orc-1.dataone.org
 
  apt-get --purge remove dataone-cn-metacat dataone-cn-mercury dataone-cn-rest-service dataone-cn-mnsynchronization
 
  rm -rf /var/mercury
  rm -rf /var/metacat
  rm -rf /var/lib/dataone
  rm /etc/init.d/mn-synchronize
  rm /etc/init.d/mercury-indexer
  rm -rf /var/log/dataone
  rm /usr/share/java/cn-batchscheduler.jar
  rm /usr/share/java/cn-mercuryscheduler.jar
  rm -rf /var/lib/tomcat6/webapps/*
  rm -rf /var/lib/tomcat6/logs/*
 
  mkdir /var/lib/tomcat6/webapps
  mkdir /var/lib/tomcat6/logs
  mkdir /var/lib/dataone
  mkdir /var/log/dataone
  chown tomcat6.tomcat6  /var/log/dataone
  cd /var/lib
  chown tomcat6 tomcat6/webapps tomcat6/logs dataone
  chgrp tomcat6 tomcat6/webapps tomcat6/logs dataone
  cp /home/waltz/dataone/nodeList.xml /var/lib/dataone
  chown tomcat6.tomcat6 /var/lib/dataone/nodeList.xml
 
  cd /home/waltz/bin/
  ./reset
 
  apt-get update
  apt-get install dataone-cn-metacat dataone-cn-mercury dataone-cn-rest-service dataone-cn-mnsynchronization
  (takes a couple minutes)
 
  http://(cn-host-name)/knb/admin
  (make sure all items are configured, including the database)
      Global - ensure username password
      Ignore Skins Specific Properties
      Database Installation/Upgrade - run scripts
      Geoserver - bypass

 
  vi /etc/dataone/mn-synchronize/synchronization.properties
  (edit the string 'NEED_TO_SET'. 
   each cn has its own mn that it syncronizes, you will have to change that string
   to appear as the below depending on which cn you are editing
   cn-ucsb-1 = 'http://knb-mn.ecoinformatics.org'
   cn-unm-1 = 'http://dev-dryad-mn.dataone.org'
   cn-orc-1.dataone.org = 'http://daacmn.dataone.utk.edu' )
 
  ./postConfigure
 
  ensure that the cert exists
  ls /etc/ssl/certs/_.dataone.org.crt
 
   http://(cn-host-name)/knb/style/skins/dev/replControl.html
 
   In the 'Servers' box, click 'Add this server'
  (cn-host-name)/knb/servlet/replication
 
  Replicate xml doc To server (1 or 0)? 1
  Replicate data file To server (1 or 0)?: 1
  Localhost is a hub to server (1 or 0)?: 0
  Download certificate from
  (leave empty)

CN Reset and/or Upgrade --Version 3268
--------------------------------------

::

  cd /home/waltz/bin/
  ./reset

  apt-get update
  apt-get upgrade

  (at this point if there is an upgrade to dataone-cn-os-core, then after
  the upgrade you will need to 
  cp /var/lib/dataone/nodeList.xml /home/waltz/bin/nodeList.xml
  to make certain the lastest version of the nodeList will be installed properly)

  Configure Metacat

  http://(cn-host-name)/knb/admin
  (make sure all items are configured, including the database)
      Global - ensure username password
      Ignore Skins Specific Properties - check Knb, 'Show Site List', 'Show Work Group List',  'Make knb default', and then push Save
      Database Installation/Upgrade - run scripts
      Geoserver - Set to Bypass

  Configure Synchronize

  vi or pico /etc/dataone/mn-synchronize/synchronization.properties
  (edit the string 'NEED_TO_SET'. 
   each cn has its own mn that it syncronizes, you will have to change that string
   to appear as the below depending on which cn you are editing
   cn-ucsb-1 = 'http://knb-mn.ecoinformatics.org'
   cn-unm-1 = 'http://dev-dryad-mn.dataone.org'
   cn-orc-1.dataone.org = 'http://daacmn.dataone.utk.edu' )
 
  Finish Configuration of Mercury

  ./postConfigure
 

  Set up Replication between 2 or more servers:

  http://(cn-host-name)/knb/style/skins/dev/replControl.html
 
  In the 'Servers' box, click 'Add this server'
  (cn-host-name)/knb/servlet/replication
 
  Replicate xml doc To server (1 or 0)? 1
  Replicate data file To server (1 or 0)?: 1
  Localhost is a hub to server (1 or 0)?: 0
  Download certificate from
  (leave empty)


CN KNB Service Update Instructions --Version 0
----------------------------------------------

::

  cn-ucsb-1, cn-unm-1, cn-orc-1.dataone.org

These are the steps that I followed to update metacat without deleting the database

::

  sftp cn-ucsb-1.dataone.org
  put knb.war
  quit

  ssh cn-ucb-1.dataone.org
  sudo -s

  /etc/init.d/tomcat6 stop
  cd /var/lib/tomcat6/webapps/

  rm knb.war.current
  rm -rf knb
  cp /home/waltz/knb.war .

  mkdir knb
  cd knb
  jar -xvf ../knb.war > /dev/null
  cd WEB-INF
  HOSTNAME=`/usr/bin/perl -nle 'if (/^([\d\.]+)\s+(cn[^\s]+)\s*/) {$hostname= $2;exit;} END{print $hostname}' /etc/hosts`

  sed -i.bak  's/\(server\.name\=\)localhost/\1'${HOSTNAME}'/;
  	s/\(application\.deployDir\=\)/\1\/var\/lib\/tomcat6\/webapps/;
  	s/\(application\.backupDir\=\)/\1\/var\/metacat\/\.knb/;
  	s/\(application\.context=\)/\1knb/;
  	s/\(application\.debugOutputFile\=\)\/tmp\/metacat\.debug/\1\/var\/metacat\/temporary\/metacat.debug/;
  	s/\(application\.delimiteredOutputFile\=\)\/tmp\/metacat\.debug\.delimitered/\1\/var\/metacat\/temporary\/metacat\.debug\.delimitered/;
  	s/\(database\.user\=\)/\1metacat/;
  	s/\(database\.password\=\)/\1metacat/;
  	s/\(database\.type\=\)/\1postgres/;
  	s/\(database\.driver\=\)/\1org\.postgresql\.Driver/;
  	s/\(database\.adapter\=\)/\1edu\.ucsb\.nceas\.dbadapter\.PostgresqlAdapter/;
  	s/\(auth\.administrators\=\)/\1uid\=dataone\_cn\_metacat\,o\=DATAONE\,dc\=ecoinformatics\,dc\=org/;
  	s/\(replication\.logdir\=\)/\1\/var\/metacat\/logs/;' \
  	metacat.properties

  cp /usr/share/metacat/debian/log4j.properties .

  cd ../..

  chown -R tomcat6.tomcat6 knb

  mv knb.war knb.war.current


  /etc/init.d/tomcat6 start


  Configure Metacat

  http://(cn-host-name)/knb/admin

  Authentication Configuration -- check values, click Save
  login
  (make sure all items are configured, including the database)
      Global - Configure, ensure username password
      Skins Specific Properties - Configure, check Default, and then push Save
      Database Installation/Upgrade - Should not have to run scripts,if you do you failed updating
      Geoserver - Set to Bypass