@@ -528,3 +528,178 @@ xprojects NONE
528528usage_scaling NONE
529529report_variables cpu,np_load_avg,slots
530530```
531+
532+ # Update DBWriter
533+
534+ Updating DBWriter can be done as a binary replacement. In case the update also requires a database schema update,
535+ an upgrade script has to be executed.
536+
537+ The following steps will update DBWriter to the latest version and apply any necessary database schema changes.
538+
539+ ## Shutdown DBWriter
540+
541+ You need to be user ` root ` on the DBWriter host to shut down DBWriter.
542+
543+ If DBWriter has been installed as a Systemd service, shut down DBWriter via Systemd:
544+
545+ ``` bash
546+ systemctl stop ocs< port> -dbwriter.service
547+ ```
548+
549+ otherwise use the ` sgedbwriter ` script:
550+
551+ ``` bash
552+ $SGE_ROOT /$SGE_CELL /common/sgedbwriter stop
553+ ```
554+
555+ ## Backup the DBWriter Directory
556+
557+ You should backup the DBWriter directory before updating.
558+
559+ Make a copy or a ` tar ` archive of the ` $SGE_ROOT/dbwriter ` directory.
560+
561+ Back up the database. Follow the instructions of your database management system.
562+
563+ ## Prepare the Binary Update
564+
565+ Delete all files in ` $SGE_ROOT/dbwriter/lib ` except for the JDBC driver JAR file.
566+
567+ ## Do the Binary Update
568+
569+ As user root extract the ` gcs-<version>-arco.tar.gz ` archive in the ` $SGE_ROOT ` directory.
570+
571+ ``` bash
572+ cd $SGE_ROOT
573+ tar xzf < path-to-packages> /gcs-< version> -arco.tar.gz
574+ ```
575+
576+ ## Adjustments for the Update: Older than 9.1.2 to 9.1.2 (or newer)
577+
578+ ### Update the Java Version
579+ If you are updating from a version older than 9.1.2
580+ to a version greater than or equal to 9.1.2, you need to adjust the Java version in the DBWriter startup script.
581+
582+ Older versions required Java version 1.8.0,
583+ The current DBWriter version requires Java version 11 and can be used with current Java versions (tested up to Java 25).
584+
585+ Edit ` $SGE_ROOT/$SGE_CELL/common/sgedbwriter ` ,
586+ search for ` JAVA_HOME ` ,
587+ and set ` JAVA_HOME ` to the path of a Java version >= 11.
588+
589+ ### Update the Reporting File Type
590+
591+ Older versions of DBWriter used the old reporting file format (colon-separated lines).
592+ Beginning with version 9.1.2, DBWriter uses the new one-line JSON format.
593+
594+ If you had been running an older version, the global configuration, ` reporting_params ` , contained the setting
595+ ` old_reporting=true ` . Change this setting to ` false ` or remove it.
596+
597+ ``` bash
598+ qconf -mconf
599+ # in the editor adjust the setting `old_reporting` to `false` or remove it
600+ ```
601+
602+ Change the path to the reporting file in the ` $SGE_ROOT/$SGE_CELL/common/dbwriter.conf ` file:
603+
604+ Edit ` $SGE_ROOT/$SGE_CELL/common/dbwriter.conf ` ,
605+ search for ` DBWRITER_REPORTING_FILE= ` ,
606+ to the file name append the suffix ` .jsonl ` to make it ` reporting.jsonl ` .
607+
608+ ## Update the Database Schema
609+
610+ As user ` root ` , run the ` updatedb.sh ` script.
611+ It will verify the database schema version and update it if necessary.
612+
613+ Example for an update of DBWriter to schema version 9.1.2:
614+
615+ ``` bash
616+ source $SGE_ROOT /$SGE_CELL /common/settings.sh
617+ cd $SGE_ROOT /dbwriter
618+ ./updatedb.sh
619+
620+ Installation / Upgrade for the @@ARCO_NAME@@ database
621+ -----------------------------------------------------
622+
623+
624+ Java setup
625+ ----------
626+
627+ ARCo needs at least java 11
628+
629+ Enter the path to your java installation [] >> /usr/lib/jvm/java-11-openjdk-amd64/
630+
631+ Enter your SGE_ROOT [/scratch/joga/clusters/master] >>
632+
633+ Enter your SGE_CELL [default] >>
634+
635+ Enter the path to the dbwriter configuration file [/scratch/joga/clusters/master/default/common/dbwriter.conf]>>
636+
637+ Database connection test
638+ ------------------------
639+
640+ Searching for the jdbc driver com.mysql.jdbc.Driver
641+ in directory /scratch/joga/clusters/master/dbwriter/lib
642+
643+ OK, jdbc driver found
644+
645+ Should the connection to the database be tested? (y/n) [y] >>
646+
647+
648+ Test database connection to ' jdbc:mysql://ubuntu-22-amd64-2:3306/arco_8012' ... OK
649+
650+ Shall we only print all sql statements which will be executed during the upgrade? (y/n) [y] >> n
651+
652+ Query database version ... found version 10 6.2u1
653+ New version of the database model is needed
654+
655+ Should the database model be upgraded to version 11 GCS-9.1.2? (y/n) [y] >>
656+
657+ Upgrade to database model version 11 GCS-9.1.2...
658+
659+ Version with name 6.2u1 is already installed. It will be skipped.
660+ Install version GCS-9.1.2 (id=11) -------
661+ Drop view view_ar_time_usage
662+ Drop view view_job_times
663+ Drop view view_job_times_subquery
664+ Drop view view_accounting
665+ Drop view view_ar_attribute
666+ Drop view view_ar_log
667+ Drop view view_ar_resource_usage
668+ Drop view view_ar_usage
669+ Drop view view_job_log
670+ Drop view view_jobs_completed
671+ Modify column ar_number in sge_ar to BIGINT
672+ Modify columns j_job_number and j_task_number in sge_job to BIGINT
673+ Recreate view view_accounting
674+ Recreate view view_ar_attribute
675+ Recreate view view_ar_log
676+ Recreate view view_ar_resource_usage
677+ Recreate view view_ar_usage
678+ Recreate view view_job_log
679+ Recreate view view_job_times_subquery
680+ Recreate view view_job_times
681+ Recreate view view_ar_time_usage
682+ Recreate view view_jobs_completed
683+ Update version table
684+ committing changes
685+ Version GCS-9.1.2 (id=11) successfully installed
686+ OK
687+ ```
688+
689+ ## Restart DBWriter
690+
691+ You need to be user ` root ` to start DBWriter.
692+
693+ If DBWriter has been installed as a Systemd service, start DBWriter via Systemd:
694+
695+ ``` bash
696+ systemctl start ocs< port> -dbwriter.service
697+ ```
698+
699+ otherwise use the ` sgedbwriter ` script:
700+
701+ ``` bash
702+ $SGE_ROOT /$SGE_CELL /common/sgedbwriter start
703+ ```
704+
705+
0 commit comments