This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
sccl:configuration [2015-01-15 15:18] uls created |
sccl:configuration [2015-07-07 15:35] (current) uls [resources.conf] |
||
---|---|---|---|
Line 19: | Line 19: | ||
==== sccl.conf ==== | ==== sccl.conf ==== | ||
+ | This is the upper level configuration file of the script cluster. | ||
+ | The arbitrary name of the cluster (CLUSTER) is defined and all associated cluster nodes (NODES) are listed. | ||
:NOTE: This file is source'd, so be careful when editing. | :NOTE: This file is source'd, so be careful when editing. | ||
+ | |||
+ | <file - sccl.conf> | ||
+ | # Definition der Variablen fuers Script-Cluster | ||
+ | # | ||
+ | # Clustername | ||
+ | CLUSTER=SCCL001 | ||
+ | # | ||
+ | # Physische Nodes im Cluster | ||
+ | NODES="host001 host002" | ||
+ | # HBNODE_EXT="hb1" | ||
+ | # HBNODES="" | ||
+ | |||
+ | # Pakete bei sccl_show_cluster sortieren | ||
+ | SHOWSORTED=1 | ||
+ | |||
+ | # Start und Stopp-Zeiten ans ULS liefern? | ||
+ | ULS="1" | ||
+ | # ULS="" | ||
+ | |||
+ | ############################################################ | ||
+ | # Verzeichnis zum Speichern der Cluster-Lockdateien | ||
+ | LOCKDIR=/var/clusterlocks | ||
+ | |||
+ | # Datei mit den Paketen des Clusters | ||
+ | PACKAGES=/etc/sccl/packages.conf | ||
+ | |||
+ | # Datei mit den Resourcen des Clusters | ||
+ | RESOURCES=/etc/sccl/resources.conf | ||
+ | |||
+ | # Directory mit den Start-Stop und Test-Scripten der Resourcen | ||
+ | STARTSTOPDIR=/usr/local/sccl | ||
+ | |||
+ | # Einstellungen fuer die Clusterkommunikation ueber unix2web | ||
+ | U2WHOME=/usr/local/sccl/bin | ||
+ | U2WPWDDAT=/usr/local/sccl/bin/u2w_pwd.dat | ||
+ | U2WPORT=3579 | ||
+ | </file> | ||
+ | |||
+ | :TODO: missing explanation | ||
----- | ----- | ||
Line 26: | Line 67: | ||
==== packages.conf ==== | ==== packages.conf ==== | ||
- | Die Clusterpakete werden in der Datei, die durch PAKETE in der | + | The packages are configured in the file indicated by the (showing the default entry): |
- | /etc/sccl/sccl.conf angegeben ist, definiert. Als Standard ist | + | |
- | /etc/sccl/packages.conf festgelegt. Sie beinhaltet eine Tabelle mit allen Paketen | + | |
- | des Clusters und die Clusterknoten, auf denen sie gestartet werden dürfen. | + | |
- | # vi /etc/sccl/packages.conf | + | PACKAGES=/etc/sccl/packages.conf |
- | package1 clnode1 clnode2 | + | |
- | package2 - clnode2 clnode1 | + | |
- | package3 - clnode2 clnode1 | + | |
- | Jede Zeile hat die Form: | + | entry in the ''/etc/sccl/sccl.conf''. |
- | <package> { - | <stdnode> } [<altnode1> <altnode2> ...] | + | |
+ | The PACKAGES file contains all packages belonging to the cluster. | ||
+ | Each package lists one or more cluster nodes (NODES) on which they may be started. | ||
+ | The first node defines the default node. | ||
+ | |||
+ | <file - /etc/sccl/packages.conf> | ||
+ | # packages.conf | ||
+ | # | ||
+ | # <package> { - | <stdnode> } [<altnode1> [<altnode2> ...]] | ||
+ | # | ||
+ | |||
+ | p1 host001 host002 | ||
+ | db - host001 | ||
+ | other_package - host002 | ||
+ | |||
+ | </file> | ||
+ | |||
+ | :TODO: needs translation :TODO: needs verification of exact usage | ||
Das Clusterpaket <package> wird automatisch beim Start des Clusters auf | Das Clusterpaket <package> wird automatisch beim Start des Clusters auf | ||
Line 65: | Line 117: | ||
The resource definition **must** be in one line! | The resource definition **must** be in one line! | ||
- | The general syntax of a resource definition: | ||
- | <package> <description_no_spaces> [MULTI] <resource> <resource> ... | + | <file - /etc/sccl/resources.conf> |
+ | |||
+ | # The general syntax of a resource definition: | ||
+ | <package> <description_no_spaces> [MULTI] <resource> <resource> ... | ||
+ | |||
+ | # example | ||
+ | db My_Database IP:AUTO:10.1.2.4.255.255.255.240 PRG:/home/db/scripts/sccl_startstop | ||
+ | |||
+ | </file> | ||
When the package ist "started", all resources are activated or started in the sequence | When the package ist "started", all resources are activated or started in the sequence | ||
Line 90: | Line 149: | ||
:TODO: Link to examples | :TODO: Link to examples | ||
+ | |||
+ | The resources are described in [[sccl:configuration:resource_description]]. | ||
----- | ----- | ||
- | ==== Resources ==== | + | ==== examples ==== |
+ | <file packages.conf> | ||
+ | db host1 host2 | ||
+ | tomcat host3 | ||
+ | apache host4 host5 | ||
+ | </file> | ||
- | === IP === | + | <file resources.conf> |
+ | db MySQL_DB PRG:/etc/init.d/mysql RST:tomcat,apache:CLUSTER | ||
+ | tomcat Tomcat CPKG:db:WAIT PRG:/etc/init.d/tomcat6 | ||
+ | apache Apache CPKG:db:WAIT PRG:/etc/init.d/apache2 | ||
+ | </file> | ||
- | ip address | ||
- | {| | ||
- | ! definition | ||
- | | ''IP:{<interface>|AUTO}:<ip_address>:<netmask>[:ROUTE]'' | ||
- | |- | ||
- | ! action when "start" | ||
- | | startup an ip address on the given <interface> or if ''AUTO'' is set, | ||
- | find depending on the ip-address and netmask a matching interface. | ||
- | |- | ||
- | ! action when "stop" | ||
- | | The optional ROUTE is removed and the ip-address is removed from the used interface. | ||
- | |- | ||
- | ! examples | ||
- | | ''IP:eth0:10.1.17.103:255.255.255.0'', ''IP:AUTO:10.1.12.122:255.255.255.0'' | ||
- | |} | ||
- | |||
- | === PROC == | ||
- | |||
- | Start only, if a specific process is running. | ||
- | |||
- | {| | ||
- | ! definition | ||
- | | ''PROC:<expression>[:WAIT]'' | ||
- | |- | ||
- | ! action when "start" | ||
- | | It is checked, whether one or more specific processes are running. | ||
- | The used command is ''ps -efa | grep <expression>''. | ||
- | |- | ||
- | ! action when "stop" | ||
- | | none | ||
- | |- | ||
- | ! example | ||
- | | ''PROC:java:WAIT'' | ||
- | |} | ||
- | |||
- | === !PROC == | ||
- | |||
- | Start only if specific processes are not running. | ||
- | |||
- | {| | ||
- | ! definition | ||
- | | ''!PROC:<expression>'' | ||
- | |- | ||
- | ! action when "start" | ||
- | | It is checked, whether one or more certain processes are **not** running. | ||
- | The used command is ''ps -efa | grep <expression>''. | ||
- | |- | ||
- | ! action when "stop" | ||
- | | none | ||
- | |- | ||
- | ! example | ||
- | | ''!PROC:backup'' | ||
- | |} | ||
- | |||
- | === RAW === | ||
- | |||
- | A raw partition. | ||
- | |||
- | {| | ||
- | ! definition | ||
- | | ''RAW:<partition>'' | ||
- | |- | ||
- | ! action when "start" | ||
- | | The unlocked RAW-partition is marked locked within the cluster. | ||
- | |- | ||
- | ! action when "stop" | ||
- | | The locked RAW-partition is marked unlocked within the cluster. | ||
- | |- | ||
- | ! examples | ||
- | | ''RAW:/dev/raw1'' | ||
- | |} | ||
- | |||
- | |||
- | === FS === | ||
- | |||
- | Mount a file system. | ||
- | |||
- | {| | ||
- | ! definition | ||
- | | ''FS:<file_system>[:FSCK]'' | ||
- | |- | ||
- | ! action when "start" | ||
- | | The file system is mounted (mount). It only can be mounted on | ||
- | one cluster node at a time. The <file_system> must be present | ||
- | in the /etc/fstab. The optional FSCK will perform a file system check | ||
- | before mounting it. | ||
- | |- | ||
- | ! action when "stop" | ||
- | | The file system is unmounted (umount). | ||
- | |- | ||
- | ! examples | ||
- | | ''FS:/u01/data'' | ||
- | |} | ||
- | |||
- | |||
- | === FSG === | ||
- | |||
- | Mount a file system group. | ||
- | |||
- | This resource type is rarely used as it needs a file system group definition | ||
- | based on specific remarks in the ''/etc/fstab'' file. | ||
- | |||
- | {| | ||
- | ! definition | ||
- | | ''FSG:<file_system_group>[:FSCK]'' | ||
- | |- | ||
- | ! action when "start" | ||
- | | All file systems belonging to the <file_system_group> are mounted (mount). | ||
- | They only can be mounted on one cluster node at a time. | ||
- | The <file_system_group> must be defined in the /etc/fstab. | ||
- | The optional FSCK will perform a file system check before mounting any file system. | ||
- | |- | ||
- | ! action when "stop" | ||
- | | All file systems of the <file_system_group> are unmounted (umount). | ||
- | |- | ||
- | ! example | ||
- | | ''FSG:allsan'' | ||
- | |} | ||
- | |||
- | |||
- | === NFS === | ||
- | |||
- | Mount an NFS file system. | ||
- | |||
- | {| | ||
- | ! definition | ||
- | | ''NFS:<nfs_file_system>'' | ||
- | |- | ||
- | ! action when "start" | ||
- | | The NFS file system is mounted (mount). It can be mounted on | ||
- | more than one cluster node at a time. The <nfs_file_system> must be present | ||
- | in the /etc/fstab. | ||
- | |- | ||
- | ! action when "stop" | ||
- | | The NFS file system is unmounted (umount). | ||
- | |- | ||
- | ! example | ||
- | | ''NFS:/backup/central'' | ||
- | |} | ||
- | |||
- | === NFSG === | ||
- | |||
- | Mount a group of NFS file systems. | ||
- | |||
- | This resource type is rarely used as it needs a file system group definition based on specific remarks in the ''/etc/fstab'' file. | ||
- | |||
- | {| | ||
- | ! definition | ||
- | | ''NFSG:<nfs_file_system_group>'' | ||
- | |- | ||
- | ! action when "start" | ||
- | | All NFS file systems of the file system group are mounted (mount). | ||
- | They can be mounted on more than one cluster node at a time. | ||
- | The <nfs_file_system_group> must be defined in the /etc/fstab. | ||
- | |- | ||
- | ! action when "stop" | ||
- | | All NFS file system of the <nfs_file_system_group> are unmounted (umount). | ||
- | |- | ||
- | ! example | ||
- | | ''NFSG:allsapfs'' | ||
- | |} | ||
- | |||
- | |||
- | === RS === | ||
- | |||
- | The sub-package (resource) will be started when needed by the first package | ||
- | and it is stopped when the last package, that the sub-package is used by, is stopped. | ||
- | |||
- | {| | ||
- | ! definition | ||
- | | ''RS:<subpackage>'' | ||
- | |- | ||
- | ! action when "start" | ||
- | | All resources of the sub-packages are activated (left to right/forward). | ||
- | |- | ||
- | ! action when "stop" | ||
- | | All resources of the sub-packages are deactivated (right to left/backwards). | ||
- | |- | ||
- | ! example | ||
- | | ''RS:kerberos'' | ||
- | |} | ||
- | |||
- | === PRG === | ||
- | |||
- | Execute a script to start or stop the package. | ||
- | |||
- | {| | ||
- | ! definition | ||
- | | ''PRG[:<path>]'' | ||
- | |- | ||
- | ! action when "start" | ||
- | | By default, when no <path> is given, the script ''/etc/sccl/scripts/<package>_startstop'' is executed. | ||
- | If a <path> is given, then that script is executed. | ||
- | If the <path> only contains a base file name (no slashes), the script ''/etc/sccl/scripts/<path>'' is executed. | ||
- | All scripts are executed with parameter "start". | ||
- | |- | ||
- | ! action when "stop" | ||
- | | The appropriate script is executed with parameter "stop". | ||
- | |- | ||
- | ! examples | ||
- | | ''PRG'', ''PRG:/u01/scripts/kerberos.sh'', ''PRG:webserver.sh'' | ||
- | |} | ||
- | |||
- | === CPKG === | ||
- | |||
- | A specific cluster packages must be active in the cluster. | ||
- | |||
- | {| | ||
- | ! definition | ||
- | | ''CPKG:<other_package>[:WAIT[:<m>]'' | ||
- | |- | ||
- | ! action when "start" | ||
- | | Only if the cluster package <other_package> is started on any node in the cluster | ||
- | then this package is started. | ||
- | If WAIT is specified, this package waits for a default time of <m> or 5 minutes. | ||
- | |- | ||
- | ! action when "stop" | ||
- | | none | ||
- | |- | ||
- | ! definition | ||
- | | ''CPKG:<other_package>[:START]'' | ||
- | |- | ||
- | ! action when "start" | ||
- | | If the cluster package <other_package> is not active on any node in the cluster then the <other_package> | ||
- | is started on the first cluster node defined for <other_package> in the PACKAGES file. | ||
- | |- | ||
- | ! action when "stop" | ||
- | | none | ||
- | |- | ||
- | ! definition | ||
- | | ''CPKG:<other_package>[:WAITSTART[:<m>]'' | ||
- | |- | ||
- | ! action when "start" | ||
- | | If the cluster package <other_package> is not active on any node in the cluster | ||
- | then wait for <m> or 5 minutes. if it is still not active after that delay, | ||
- | start <other_package> on the first cluster node defined for it in the PACKAGES file. | ||
- | |- | ||
- | ! action when "stop" | ||
- | | none | ||
- | |- | ||
- | ! examples | ||
- | | ''CPKG:database:WAIT'', ''CPKG:appserver:START'', ''CPKG:appserver:WAITSTART:10'' | ||
- | |} | ||
- | |||
- | |||
- | === !CPKG === | ||
- | |||
- | To start this package, another specific package must not be active in the cluster. | ||
- | |||
- | {| | ||
- | ! definition | ||
- | | ''!CPKG:<other_package>[:STOP]'' | ||
- | |- | ||
- | ! action when "start" | ||
- | | If package <other_package> is active on any cluster node, then this package is not started. | ||
- | If STOP is specified, the <other_package> is stopped and this package is started | ||
- | (the processing of the resource definition is continued). | ||
- | |- | ||
- | ! action when "stop" | ||
- | | none | ||
- | |- | ||
- | ! example | ||
- | | ''!CPKG:disturber:STOP'' | ||
- | |} | ||
- | |||
- | |||
- | === PKG === | ||
- | |||
- | To start this package, another specific package must be active on **the current** cluster node. | ||
- | |||
- | {| | ||
- | ! definition | ||
- | | ''PKG:<other_package>[:WAIT[:<m>]]'' | ||
- | |- | ||
- | ! action when "start" | ||
- | | Start the package only if the <other_package> is active on the current | ||
- | cluster node. If WAIT is specified, wait for <m> or 5 minutes for the | ||
- | <other_package> to become active. | ||
- | |- | ||
- | ! action when "stop" | ||
- | | none | ||
- | |- | ||
- | ! example | ||
- | | ''PKG:apache2'', ''PKG:apache2:WAIT:3'' | ||
- | |} | ||
- | |||
- | |||
- | === SPKG === | ||
- | |||
- | Start a sub-package. | ||
- | |||
- | {| | ||
- | ! definition | ||
- | | ''SPKG:<sub_package>:<node>'' | ||
- | |- | ||
- | ! action when "start" | ||
- | | Start the <sub_package> on <node>. | ||
- | |- | ||
- | ! action when "stop" | ||
- | | none | ||
- | |- | ||
- | ! example | ||
- | | ''SPKG:apache:webhost1'' | ||
- | |} | ||
- | |||
- | === X === | ||
- | |||
- | {| | ||
- | ! definition | ||
- | | '' '' | ||
- | |- | ||
- | ! action when "start" | ||
- | | | ||
- | |- | ||
- | ! action when "stop" | ||
- | | | ||
- | |- | ||
- | ! example | ||
- | | '' '' | ||
- | |} | ||