SCI services management » История » Версия 10
Версия 9 (Владимир Ипатов, 12.11.2012 04:56) → Версия 10/15 (Владимир Ипатов, 06.12.2012 16:37)
{{toc}}
h1. SCI services management
h2. PUPPET
Puppet http://www.puppetlabs.com/) is the open source platform for enterprise systems management.
Puppet is used to deploy the configuration to the cluster instances.
Documentation can be found at http://docs.puppetlabs.com/
Puppet master is installed on the instance 'sci'.
By default you have several modules in puppet:
* Apt config(approx)
* DNS config(bind9)
* DHCP config(dhcpd)
* locale config(locale)
* timezone config(timezone).
Classes pick and providing parameters for it made by /etc/puppet/manifests/nodes.pp:
<pre>
node 'default' {
class { sources_list_local: stage => pre0, }
class { common_profile: stage => pre1, }
class { timezone: zone => "Europe/Moscow", stage => main, }
class { locale: def_locale => "ru_RU.UTF-8", stage => main, }
}
node 'sci' {
class { approx_local: stage => pre0, }
class { sources_list_local: stage => pre0, }
class { common_profile: stage => pre1, }
class { bind9_sci: stage => main, }
class { timezone: zone => "Europe/Moscow", stage => main, }
class { locale: def_locale => "ru_RU.UTF-8", stage => main, }
class { dhcpd: enabled => no, stage => post1, }
}
</pre>
If you don't specify node, default classes will be accepted for this node.
h2. Apt
Apt is configured on the instance 'sci' via puppet.
h3. sources.list
Global distributed sources.list template is resided in @/etc/puppet/modules/approx/templates/sources.list.erb@
h3. Approx
Approx is configured in @/etc/puppet/modules/approx/templates/approx.conf.erb@
To apply your changes quickly you should issue
<pre>
/etc/init.d/puppet restart
</pre>
h2. DNS
DNS is configured on the instance 'sci' via puppet.
The forward zone file is stored as a template at @/etc/puppet/modules/bind9/templates/sci/zone.erb@
in system it will be at @/etc/bind/master/$domain@
The reverse zone file is stored as a template at @/etc/puppet/modules/bind9/templates/sci/in-addr.erb@
in system it will be at @/etc/bind/master/in-addr@
On each update you should set new (growing) zone serial number, initially
<pre>
0000000001 ; Serial
</pre>
to the new growing value. YYYYMMDDNN is recommended (NN - is the change number in one day).
Feel free to modify it to adjust your system.
New names should be placed below the string
<pre>
; here you can put any other records
</pre>
To apply your changes quickly you should issue
<pre>
/etc/init.d/bind9 reload
</pre>
Note that if you using dynamic updates(e.g. from dhcp-server) you must before editing file:
<pre>rndc freeze your.domain</pre>
for forward zone or
<pre>rndc freeze 168.192.in-addr.arpa</pre>
for reverse zone.
And after editing the zone you must:
<pre>rndc unfreeze your.domain</pre>
or
<pre>rndc unfreeze 168.192.in-addr.arpa</pre>
h2. DHCP
isc-dhcp-server is configured on instance sci via puppet, but disabled by default.
If you want to enable it, you must replase string in nodes.pp:
<pre>
class { dhcpd: enabled => no, stage => post1, }
</pre>
to:
<pre>
class { dhcpd: enabled => yes, stage => post1, }
</pre>
If you have LAN segment in yous setup, it will be configured on it, else it will be configured on ganeti bridge.
dynamic dns updates is configured by default.
Default setup looks like this:
<pre>
ddns-update-style interim;
ddns-updates on;
allow-unknown-clients;
autoritative;
ddns-domainname "your.domain";
update-static-leases on;
allow client-updates;
key DHCP_UPDATE {
algorithm HMAC-MD5;
secret secret-generated-md5;
};
subnet 192.168.5.0 netmask 255.255.255.0 {
authoritative;
ddns-updates on;
range 192.168.5.11 192.168.5.254;
option routers 192.168.5.35;
option domain-name-servers 192.168.5.35;
option domain-name "your.domain";
default-lease-time 604800;
max-lease-time 2592000;
}
zone your.domain. {
primary 127.0.0.1;
key DHCP_UPDATE;
}
zone 168.192.in-addr.arpa. {
primary 127.0.0.1;
key DHCP_UPDATE;
}
</pre>
h2. locale
Locale in cluster ruled by puppet. By default it is en_US.UTF-8
If you want to set locale you need, you must set it in @/etc/puppet/manifests/nodes.pp@
<pre>class { locale: def_locale => "ru_RU.UTF-8", stage => main, }</pre>
You must also add locale in @/etc/puppet/modules/locale/templates/locale.gen.erb@ if locale you want isn't in this list:
<pre>en_US ISO-8859-1
en_US UTF-8
ru_RU UTF-8
ru_RU KOI8-R
ru_RU CP1251
ru_RU ISO8859-5</pre>
Note that you must add this locale *BEFORE* last string:
<pre><%= def_locale["."] = " "; def_locale %></pre>
h2. system mail
There are two approaches to system mail delivery.
1) all system mail delivers to one host called mailhub in puppet (sci by default) and stored on it in local mailbox for given user.
2) all system mail delivers to external mailbox via smarthost. It is a more comfortably approach, but requires smarthost that can deliver mail via internet, so the first approach is default.
This module configures by arguments in nodes.pp. In mailhub schema it is:
<pre>
node 'default' {
...........
class { exim4: smarthost => "default", forward_to => 'admin', stage => main, }
}
node 'sci' {
...........
class { exim4: mailhub => yes, forward_to => 'admin', stage => main, }
}
</pre>
All mail delivers to admin(root by default) on sci.
And this is example for external mailbox:
<pre>
node 'default' {
...........
class { exim4: smarthost => "my-smarthost.localdomain", forward_to => 'notify@other.domain', stage => main, }
}
node 'sci' {
...........
class { exim4: smarthost => "my-smarthost.localdomain", forward_to => 'notify@other.domain', stage => main, }
}
</pre>
h1. SCI services management
h2. PUPPET
Puppet http://www.puppetlabs.com/) is the open source platform for enterprise systems management.
Puppet is used to deploy the configuration to the cluster instances.
Documentation can be found at http://docs.puppetlabs.com/
Puppet master is installed on the instance 'sci'.
By default you have several modules in puppet:
* Apt config(approx)
* DNS config(bind9)
* DHCP config(dhcpd)
* locale config(locale)
* timezone config(timezone).
Classes pick and providing parameters for it made by /etc/puppet/manifests/nodes.pp:
<pre>
node 'default' {
class { sources_list_local: stage => pre0, }
class { common_profile: stage => pre1, }
class { timezone: zone => "Europe/Moscow", stage => main, }
class { locale: def_locale => "ru_RU.UTF-8", stage => main, }
}
node 'sci' {
class { approx_local: stage => pre0, }
class { sources_list_local: stage => pre0, }
class { common_profile: stage => pre1, }
class { bind9_sci: stage => main, }
class { timezone: zone => "Europe/Moscow", stage => main, }
class { locale: def_locale => "ru_RU.UTF-8", stage => main, }
class { dhcpd: enabled => no, stage => post1, }
}
</pre>
If you don't specify node, default classes will be accepted for this node.
h2. Apt
Apt is configured on the instance 'sci' via puppet.
h3. sources.list
Global distributed sources.list template is resided in @/etc/puppet/modules/approx/templates/sources.list.erb@
h3. Approx
Approx is configured in @/etc/puppet/modules/approx/templates/approx.conf.erb@
To apply your changes quickly you should issue
<pre>
/etc/init.d/puppet restart
</pre>
h2. DNS
DNS is configured on the instance 'sci' via puppet.
The forward zone file is stored as a template at @/etc/puppet/modules/bind9/templates/sci/zone.erb@
in system it will be at @/etc/bind/master/$domain@
The reverse zone file is stored as a template at @/etc/puppet/modules/bind9/templates/sci/in-addr.erb@
in system it will be at @/etc/bind/master/in-addr@
On each update you should set new (growing) zone serial number, initially
<pre>
0000000001 ; Serial
</pre>
to the new growing value. YYYYMMDDNN is recommended (NN - is the change number in one day).
Feel free to modify it to adjust your system.
New names should be placed below the string
<pre>
; here you can put any other records
</pre>
To apply your changes quickly you should issue
<pre>
/etc/init.d/bind9 reload
</pre>
Note that if you using dynamic updates(e.g. from dhcp-server) you must before editing file:
<pre>rndc freeze your.domain</pre>
for forward zone or
<pre>rndc freeze 168.192.in-addr.arpa</pre>
for reverse zone.
And after editing the zone you must:
<pre>rndc unfreeze your.domain</pre>
or
<pre>rndc unfreeze 168.192.in-addr.arpa</pre>
h2. DHCP
isc-dhcp-server is configured on instance sci via puppet, but disabled by default.
If you want to enable it, you must replase string in nodes.pp:
<pre>
class { dhcpd: enabled => no, stage => post1, }
</pre>
to:
<pre>
class { dhcpd: enabled => yes, stage => post1, }
</pre>
If you have LAN segment in yous setup, it will be configured on it, else it will be configured on ganeti bridge.
dynamic dns updates is configured by default.
Default setup looks like this:
<pre>
ddns-update-style interim;
ddns-updates on;
allow-unknown-clients;
autoritative;
ddns-domainname "your.domain";
update-static-leases on;
allow client-updates;
key DHCP_UPDATE {
algorithm HMAC-MD5;
secret secret-generated-md5;
};
subnet 192.168.5.0 netmask 255.255.255.0 {
authoritative;
ddns-updates on;
range 192.168.5.11 192.168.5.254;
option routers 192.168.5.35;
option domain-name-servers 192.168.5.35;
option domain-name "your.domain";
default-lease-time 604800;
max-lease-time 2592000;
}
zone your.domain. {
primary 127.0.0.1;
key DHCP_UPDATE;
}
zone 168.192.in-addr.arpa. {
primary 127.0.0.1;
key DHCP_UPDATE;
}
</pre>
h2. locale
Locale in cluster ruled by puppet. By default it is en_US.UTF-8
If you want to set locale you need, you must set it in @/etc/puppet/manifests/nodes.pp@
<pre>class { locale: def_locale => "ru_RU.UTF-8", stage => main, }</pre>
You must also add locale in @/etc/puppet/modules/locale/templates/locale.gen.erb@ if locale you want isn't in this list:
<pre>en_US ISO-8859-1
en_US UTF-8
ru_RU UTF-8
ru_RU KOI8-R
ru_RU CP1251
ru_RU ISO8859-5</pre>
Note that you must add this locale *BEFORE* last string:
<pre><%= def_locale["."] = " "; def_locale %></pre>
h2. system mail
There are two approaches to system mail delivery.
1) all system mail delivers to one host called mailhub in puppet (sci by default) and stored on it in local mailbox for given user.
2) all system mail delivers to external mailbox via smarthost. It is a more comfortably approach, but requires smarthost that can deliver mail via internet, so the first approach is default.
This module configures by arguments in nodes.pp. In mailhub schema it is:
<pre>
node 'default' {
...........
class { exim4: smarthost => "default", forward_to => 'admin', stage => main, }
}
node 'sci' {
...........
class { exim4: mailhub => yes, forward_to => 'admin', stage => main, }
}
</pre>
All mail delivers to admin(root by default) on sci.
And this is example for external mailbox:
<pre>
node 'default' {
...........
class { exim4: smarthost => "my-smarthost.localdomain", forward_to => 'notify@other.domain', stage => main, }
}
node 'sci' {
...........
class { exim4: smarthost => "my-smarthost.localdomain", forward_to => 'notify@other.domain', stage => main, }
}
</pre>