HP UX System Adstration manual Manually Configuring a Standalone Synchronization Server

Page 27

NOTE: You can use csshsetup to configure a trust relationship between the master server and the managed clients. This will allow you to use command fanout commands such as cexec and ccp (see cexec(1) and ccp(1)). Using these commands can simplify the configuration steps described below when files need to be distributed to managed clients.

2.3.2.1 Manually Configuring a Standalone Synchronization Server

Perform the following one-time steps to configure a standalone system as a cfengine master server:

1.Start by creating the master copies of the cfengine configuration files. These files are placed in a well known directory and are distributed to each managed client. The default directory is /var/opt/dsau/cfengine_master/inputs, referenced in the default templates.

Start by creating the directory:

#mkdir -p /var/opt/dsau/cfengine_master/inputs

2.Copy the default template files to the following directories:

#cd /var/opt/dsau/cfengine_master/inputs

#cp /opt/dsau/share/cfengine/templates/cf.main.template cf.main

#cp /opt/dsau/share/cfengine/templates/update.conf.template update.conf

#cp /opt/dsau/share/cfengine/templates/cfagent.conf.template cfagent.conf

#cp /opt/dsau/share/cfengine/templates/cfrun.hosts.template cfrun.hosts

#cp /opt/dsau/share/cfengine/templates/cfservd.conf.template cfservd.conf

3.Next, edit update.conf. This file has a format similar to cfengine’s main configuration file cfagent.conf. It is used to transfer and update cfengine binaries and any updated configuration definitions files (for example, cfagent.conf) to the managed clients. It is critical to keep this file very simple and avoid errors. Errors in this file will require manually copying a new version to each managed client.

The file contains tokens in the form <%token-name%> that are replaced by the

csync_wizard with the administrator’s answers to questions. Replace the tokens as follows:

a.Replace the <%POLICYHOST_NAME%> token with the fully qualified domain name of the master server. Note that it is critical that this be a fully qualified domain name. This file is copied to and evaluated on the managed clients. If a managed client is in a different DNS domain from the master server, the client will be unable to communicate with the master server if the hostname is not fully qualified.

b.Note that the cfengine domain variable is set as follows:

domain = ( ExecResult(/bin/sh -c ${dblquote}nslookup ‘hostname‘ awk ${quote}/Name:/ {print $2}${quote} cut -d . -f 2-${dblquote}) )

The domain variable is used by cfagent’s “resolve” action. The ExecResult command above assumes that the client’s /etc/resolve.conf and /etc/nsswitch.conf are already appropriately configured. The command expects to get a fully qualified hostname when using nslookup of the client’s own hostname. If this assumption is not appropriate for your environment, other techniques for setting the domain are possible. For example, the client’s domain could be determined based on the client’s IP address or subnet, as follows:

classes:

#host in these ip address ranges xyz_domain = ( IPRange(10.0.0.1-15) ) abc_domain = ( IPRange(192.0.0.1-254) )

control: xyz_domain::

domain = ( “xyz.example.com” ) abc_domain::

domain = ( “abc.example.com”)

2.3 Configuring cfengine

27

Image 27
Contents Distributed Systems Administration Utilities Users Guide Copyright 2009 Hewlett-Packard Development Company, L.P Table of Contents HP-Supported Open Source pdsh Options Index List of Figures Syslog-ngLog-Forwarding ConfigurationConsolidated Logging Commands Target Node Error MessagesList of Tables Related Information About this DocumentIntended Audience Typographic ConventionsProduct Support HP Encourages Your Comments Introduction Command Fanout Commands Distributed Systems Administration Utilities CommandsConfiguration Synchronization Command Consolidated Logging CommandsOpen Source Components Utility Setup CommandOpen Source cfengine Commands Open Source pdsh CommandsDistributed Systems Administration Utilities Manual Pages Open Source syslog-ng CommandDsau Manual Page Sections Cfengine Overview Configuration SynchronizationConfiguration Synchronization Cfengine Daemons and CommandsCfengine Overview Cfengine Master Server Deployment ModelsUsing the Configuration Synchronization Wizard Configuring cfengineConfiguration Data for csyncwizard # /opt/dsau/sbin/csyncwizardWizard displays the following introductory screen Wizard proceeds to configure the system as a master server # /opt/dsau/sbin/csyncwizard Configuration Synchronization Configuring cfengine Would you like to manage clients? N Serviceguard Automation Features Cluster Configuration Notes for cfengineVar/opt/dsau/cfengine/inputs directory Opt/dsau/bin/csyncdispatcher Memberadded newhost Using the Wizard to Configure a Synchronization ClientWhen prompted, enter the name of the client to add Manual ConfigurationManually Configuring a Standalone Synchronization Server Start by creating the directory# mkdir -p /var/opt/dsau/cfenginemaster/inputs # cp localhost.pub root-10.0.0.5.pub # /opt/dsau/sbin/cfkey # /var/opt/dsau/cfengine/ppkeys# cfrun -v -- --verbose # /sbin/init.d/cfservd start# cfagent --no-lock --verbose --no-splay # cfrun -- --inform# mkdir -p /csync/dsau/cfenginemaster/masterfiles Initial Serviceguard Package PreparationList Managed Clients in cfrun.hosts Policyhost = csync.abc.xyz.com# /opt/dsau/sbin/cfkey Edit the cfservd.conf File# cexec /sbin/init.d/cfservd start # ccp /etc/rc.config.d/cfservd /etc/rc.config.d/cfservd# cp localhost.pub root-192.10.25.12.pub # ccp * /var/opt/dsau/cfengine/ppkeys# cmapplyconf -P csync.conf # cmmodpkg -e csync Test the configuration by performing the following steps# ccp csync csync.conf /etc/cmcluster/csync Apply the package and start itOn a managed client, use the command Configuring a Synchronization Managed ClientChoosing a Synchronization Invocation Method Security NotesEncryption Checksum alerts Key ExchangeCsync Network Port Usage Encryption# /sbin/init.d/cfservd stop Disabling Use of cfengineLogging Options Checksum AlertsUnable to connect to a cfengine client or master Cfengine TroubleshootingSyntax error due to missing or superfluous spaces #cfagent -KCfagent -d, -d1, -d2, or -d3 cfservd Cfrun 2describes syslog Facilities Messages Consolidated LoggingIntroduction to syslog Syslog Message FormatLog Consolidation Overview Message FilteringImproved Log Consolidation Syslog Co-existence Etc/cmcluster/package-name/package-name.log Syslog-ng Log Consolidator Configuration Log Consolidation ConfigurationUsing the Log Consolidation Wizard Configuration Data for clogwizardOpt/dsau/sbin/clogwizard Where N is the expected number of clients Answer yes y or press Enter. The next question isAnswer yes y. The wizard then prompts If these choices are correct, continue Next prompt is Log files that reside on this cluster can be consolidated Consolidated package logs would be located here Cluster Configuration Notes for clog Minimizing Message Loss During Failover Or press Enter. The next question is Configuring a Log Forwarding Client Using clogwizardEnter the ssh port to be used for port forwarding Manually Configuring a Standalone Log Consolidation Server Manually Configuring Log Consolidation# /sbin/init.d/syslogd stop # /sbin/init.d/syslogd start Replace the %UDPLOOPBACKLOG% token withFor example, for TCP Add the following lines Create the following symbolic linkChange the Clogconfigured line to If using the TCP protocol, addLog Consolidation Configuration SYSLOGDOPTS=-D -N KEEPALIVE% tokens with appropriate values UDPLOOPBACKSOURCE% and %UDPLOOPBACKLOG% tokens Creating the clog Package If consolidating package logs of this cluster, addIf using VxVM, comment out the LVM Volume Group line Testing and Starting the clog Package Distribute it cluster-wideThen use cmviewcl to make sure it is running Manually Configuring Log Forwarding Clients Using VxVM Instead of LVMManually Configuring a Standalone Log Forwarding Client Ln -sf /etc/syslog-ng.conf.client /etc/syslog-ng.conf # /sbin/init.d/syslog-ng start # cpp /etc/rc.config.d/syslogd /etc/rc.config.d Destination dsyslog%TYPE% %TYPE%%IP%port%PORT% Create the following symbolic link on each cluster member If using the TCP protocol, add the following linesIf using ssh port forwarding, add Otherwise, if using the UDP protocol, addForwarding Ascii Log Data Start syslog-ngon all cluster members usingFor the filter line For the destination lineFor the log line Consolidating Package Logs on the Log Consolidation Server#/sbin/init.d/syslogd stop Perform the following steps to disable log consolidationDisabling Log Consolidation Disabling a Standalone Log Consolidation System# /sbin/init.d/syslog-ng stop Disabling a Serviceguard Cluster Log Consolidation SystemDisabling a Standalone Log Forwarding Client #/sbin/init.d/syslogd start#/sbin/init.d/syslogd stop #/sbin/init.d/syslogd start Disabling a Serviceguard Cluster Log Forwarding ClientSecuring Consolidated Logs Log File ProtectionsSsh Port Forwarding Using Bastille to Harden the System Clog Network Port Usage# cd /opt/ssh/etc # ccp sshhost* /opt/ssh/etc To log in to the System Management Homepage, navigate to Using the System and Consolidated Log ViewerViewing System and Consolidated Logs Starting System Management HomepageViewing System and Consolidated Logs Page Parallel Distributed Shell Command FanoutCwall displays a wall1M broadcast message on multiple hosts Pdsh Utility WrappersAll nodes Systems# csshsetup -r -f memberslist.txt Security ConfigurationRemote Shell Security Setup Ssh Security SetupTarget Node Error Messages Command Fanout TroubleshootingSsh Command Messages Rsh Command MessagesHP-Supported Open Source pdsh Options Page Cfanouthosts IndexLVM UDP