From: rsoulliere Date: Mon, 2 Jan 2012 14:53:33 +0000 (-0500) Subject: Add chapter for stopping, restaring, etc... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2038ded1c64b6d5615c07670f4af650705e64b8a;p=Evergreen-DocBook.git Add chapter for stopping, restaring, etc... --- diff --git a/admin/AdminMisc.xml b/admin/AdminMisc.xml new file mode 100644 index 0000000..ec6144e --- /dev/null +++ b/admin/AdminMisc.xml @@ -0,0 +1,320 @@ + + + + + Server Operations and Maintenance + receipt template editor + + This chapter deals with basic server operations such as starting and stopping Evergreen as well wall + security, backing up and troubleshooting Evergreen. + + +
+ Starting, Stopping and Restarting + Occasionally, you may need to restart Evergreen. It is imperative that you understand the basic + commands to stop and start the Evergreen server. You can start and stop Evergreen from the command line of + the server using the osrf_ctl.sh script located in the + openils/bin directory. + The osrf_ctl.sh command must be run as the opensrf user. + To view help on osrf_ctl.sh and get all of its options, run: + osrf_ctl.sh -h + To start Evergreen, run: + osrf_ctl.sh -l -a start_all + The flag is used to indicate that Evergreen is configured to use localhost as + the host. If you have configured opensrf.xml to use your real hostname, do not use the flag. The + option is required and indicates the action of the command. In this case + . + + + If you receive the error message: osrf_ctl.sh: command not found, then your environment variable + PATHenvironment variablePATH does not include the + /openils/bin directory. You can set it using the following command: + export PATH=$PATH:/openils/bin + If you receive the error message Can't locate OpenSRF/System.pm in @INC … BEGIN + failed–compilation aborted, then your environment variable PERL5LIBenvironment + variablePERL5LIB does not + include the /openils/lib/perl5 directory. You can set it + using the following command: + export PERL5LIB=$PERL5LIB:/openils/lib/perl5 + + It is also possible to start a specific service. For example: + osrf_ctl.sh -l -a start_router + will only start the router service. + + If you decide to start each service individually, you need to start them in a specific order + for Evergreen to start correctly. Run the commands in this exact order: + osrf_ctl.sh -l -a start_router + osrf_ctl.sh -l -a start_perl + osrf_ctl.sh -l -a start_c + + After starting or restarting Evergreen, it is also necessary to restart the Apache web server + web serverApache for the OPAC to work correctly. + To stop Evergreen, run: + osrf_ctl.sh -l -a stop_all + As with starting, you can choose to stop services individually. + To restart Evergreen, run: + osrf_ctl.sh -l -a restart_all +
+
+ Backing Up + databasesbacking up + + Backing up your system files and data is a critical task for server and database administrators. + Having a strategy for backing up and recovery could be the difference between a minor annoyance for users and + a complete catastrophe. + + Backing up the <application>Evergreen</application> Databasedatabases + Most of the critical data for an Evergreen system – patrons, bibliographic records, holdings, + transactions, bills – is stored in the PostgreSQLdatabases + PostgreSQL database. You can therefore use normal + PostgreSQL backup procedures to backup this data. For example, the simplest method of backing up the Evergreen + database is to use the pg_dump command to create a live backup of the database without having to + interrupt any Evergreen services. Here is an example pg_dump command which will dump a local Evergreen database into a the file evergreen_db.backup: + pg_dump -U evergreen -h localhost -f evergreen_db.backup evergreen + To restore the backed up database into a new database, create a new database using the + template0 database template and the UTF8 encoding, and run the psql command, specifying the new + database as your target: + createdb -T template0 -E UTF8 -U evergreen -h localhost new_evergreen + psql -U evergreen -h localhost -f evergreen_db.backup new_evergreen + + This method of backup is only suitable for small Evergreen instances. Larger sites + should consider implementing continuous archiving (also known as log shipping) to provide + more granular backups with lower system overhead. More information on backing up PostgreSQL + databases can be found in the official PostgreSQL documentation. + + + + Backing up Evergreen Files + directoriesbacking up + When you deploy Evergreen, you will probably customize many aspects of your system including + the system configuration files, Apache configuration files, OPAC and Staff Client. In order to + protect your investment of time, you should carefully consider the best approach to backing up + files. + There are a number of ways of tackling this problem. You could create a script that regularly + creates a time-stamped tarball of all of these files and copies it to a remote server - but that + would build up over time to hundreds of files. You could use rsync + rsync to ensure that the files of + interest are regularly updated on a remote server - but then you would lose track of the changes to + the files, should you make a change that introduces a problem down the road. + Perhaps one of the best options is to use a version control system like + BazaarVersion Control SystemSubversion, + gitVersion Control Systemgit + or SubversionVersion Control System + Subversion to regularly push updates of the files you care about to a repository on a + remote server. This gives you the advantage of quickly being able to run through the history of the + changes you made, with a commenting system that reminds you why each change was made, combined with + remote storage of the pertinent files in case of disaster on site. In addition, your team can create + local copies of the repository and test their own changes in isolation from the production + system. Using a version control system also helps to recover system customizations after an + upgrade. + + + Full System Backup + A full system backup archives every file on the file system. Some basic methods require you + to shut down most system processes; other methods can use mirrored RAIDRAID setups or + SANSAN storage to + take snapshot backups of your full system while the system continues to run. The subject of how + to implement full system backups is beyond the scope of this documentation. + +
+
+ Security + security + As with an ILS and resource accessible from the world wide web careful consideration needs to be + given to the security of your Evergreen servers and database. While it is impossible to cover all aspects + of security, it is important to take several precautions when setting up production Evergreen site. + + + Change the Evergreen admin password and keep it secure. The + default admin password is known by anyone who has installed Evergreen. It is not a secret + and needs to be changed by the Administrator. It should also only be shared by those who + need the highest level of access to your system. + + + Create strong passwords using a combination of numerical and alphabetical characters + for all of the Administrative passwords including the postgres and + opensrf users + + + Open ports in the firewallfirewall with caution - It is only necessary to open ports + 80 and 443 + for TCP connections to the Evergreen server from the OPAC and the staff client. It is critical for administrators to + understand the concepts of network security and take precautions to minimize vulnerabilities. + + + + Use permissions permissions and permission groups wisely - it is important to understand the + purpose of the permissions and to only give users the level of access that they require. + + + +
+
+ Managing Log Files + logsmanaging + Evergreen comes with a sophisticated logging system, but it is important to manage the OpenSRF + and Evergreen logs. This section will provide a couple of log management techniques and tools. + + Using the <systemitem class="service">logrotate</systemitem> Utility to Manage Log Size + logsLog Rotate + Fortunately, this is not a new problem for Unix administrators, and there are a number of ways of keeping your logs under control. + On Debian and Ubuntu, for example, + the logrotate utility controls when old log files are compressed and a new log file is started. + logrotate runs once a day and checks all log files that it knows about to see if a + threshold of time or size has been reached and rotates the log files if a threshold condition has been met. + To teach logrotate to rotate Evergreen logs on a weekly basis, or if they are > 50MB in size, + create a new file /etc/logrotate.d/evergreen with the following contents: + +compress +/openils/var/log/*.log { +# keep the last 4 archived log files along with the current log file + # log log.1.gz log.2.gz log.3.gz log.4.gz + # and delete the oldest log file (what would have been log.5.gz) +rotate 5 +# if the log file is > 50MB in size, rotate it immediately +size 50M + # for those logs that don't grow fast, rotate them weekly anyway + weekly +} + + + + Changing Logging Level for <application>Evergreen</application> + logslogging levels + Change the Log Levels in your config files. Changing the level of logging will help + narrow down errors. + + A high logging level is not wise to do in a production environment since it + will produce vastly larger log files and thus reduce server performance. + + Change logging levels by editing the configuration file + /openils/conf/opensrf_core.xmlconfiguration filesopensrf_core.xml + you will want to search for lines containing <loglevel>. + the default setting for loglevel is 3 which will log errors, + warnings and information. + The next level is 4 which is for debugging and provides additional information + helpful for the debugging process. + Thus, lines with: + <loglevel>3</loglevel> + Should be changed to: + <loglevel>4</loglevel> + to allow debugging level logging + Other logging levels include 0 for no logging, + 1 for logging errors and 2 for logging warnings + and errors. + +
+
+ Installing PostgreSQL from Source + databasesPostgreSQL + Some Linux distributions, such as Debian Etch (4.0), do not offer PostgreSQL + version 8.2 as an installable package. Before you continue, examine the software dependencies listed in + to ensure that your Linux distribution supports the required version of PostgreSQL. + + + Some Linux distributions, such as Debian Etch (4.0), do not offer PostgreSQL + version 8.2 as an installable package. Before you continue, examine the software dependencies listed in + to ensure that your Linux distribution supports the required version of PostgreSQL. + + + + + Install the application stow on your system if it is not already installed. Issue the following command as + the root user: + +apt-get install stow + + + + Download, compile, and install the latest release for PostgreSQL 8.2 (which was version 8.2.12 at the time of this writing). + As the root user, follow these steps: + + + +wget http://wwwmaster.postgresql.org/redir/198/h/source/v8.2.17/postgresql-8.2.17.tar.bz2 +tar xzf postgresql-8.2.17.tar.gz +cd postgresql-8.2.17 +./configure --with-perl --enable-integer-datetimes --with-openssl --prefix=/usr/local/stow/pgsql +make +make install +cd contrib +make +make install +cd xml2 +make +make install +cd /usr/local/stow +stow pgsql + + + + + + Create the new user postgres to run the PostgreSQL processes. + As the root user, execute this command: + adduser postgres + + + Initialize the database directory and start up PostgreSQL. As the root user, follow these steps: + + + +mkdir -p /usr/local/pgsql/data +chown postgres /usr/local/pgsql/data +su - postgres +initdb -D /usr/local/pgsql/data -E UNICODE --locale=C +pg_ctl -D /usr/local/pgsql/data -l /home/postgres/logfile start + + + + If an error occurs during the final step above, review the path of the home directory for the + postgres user. It may be /var/lib/postresql instead of /home/postres. + + + +
+
+ Configuring PostgreSQL + databasesPostgreSQL + The values of several PostreSQL configuration parameters may be changed for enhanced performance. The following table lists the default values + and some suggested updates for several useful parameters: + + Suggested configuration values + + + + + + + Parameter + Default + Suggested + + + + + default_statistics_target + 10 + 100 + + + work_mem + 4Mb + 128Mb + + + shared_buffers + 8Mb + 512Mb + + + effective_cache_size + 128Mb + 4Gb + + + +
+
+
diff --git a/root.xml b/root.xml index 878fe56..6944f9f 100755 --- a/root.xml +++ b/root.xml @@ -100,8 +100,10 @@ ApacheApache documentation for a greater understanding of the software stack on which Evergreen is built. + +