Puppet: A New drbd experience

Source: Internet
Author: User

First, I wrote this article to record my learning history and share it with others. I hope to provide better suggestions and help me improve my learning experience.

1. Because managing puppet requires DNS configuration, I will not introduce it too much here.

2. For certificate authentication between puppetmaster and puppetclient, I will not introduce it too much here. Next I will go to the topic.

Debian)

First, you need to change the configuration files in puppetmaster.

First, go to the puppet directory:

/Etc/puppet/fileserver. conf

[files]   path /etc/puppet   allow *.supcorp.lan#  deny *.evil.example.com#  allow 192.168.0.0/24[plugins]   allow *.supcorp.lan#  deny *.evil.example.com#  allow 192.168.0.0/24

In this way, our puppetmaster can be used as a file server.

The following is the template I created, which is written in etc \ puppet \ modules \ drbd \ manifests \ init. pp.

Create a drbd class drbd {ensure that the installation package of the drbd package {'drbd-utils': Ensure => installed} is enabled to ensure that the drbd Service {'drbd ': ensure => running, enable => true, hasstatus => false, hasrestart => true, require => package ['drbd-utils ']} file {mode => '123', owner => 'root', group => 'root ', require => package ['drbd-utils']} file {'/etc/drbd. d': Ensure => directory, mode => '000000', purge => true, require => package ['drbd-utils ']} file {'/etc/drbd. d/first-storage.res ': content => template ("drbd/first-storage.res.erb"), require => service ['drbd']} file {'/etc/drbd. d/second-storage.res ': content => template ("drbd/second-storage.res.erb"), require => service ['drbd']} exec {Path => ["/usr/bin ", "/usr/sbin", "/bin", "/sbin"],} exec {"drbdadm create-MD $ {storage }": command => "drbdadm create-MD $ {storage}", refreshonly => true, subscribe => file ["/etc/drbd. d/$ {storage }. res "], require => file ["/etc/drbd. d/$ {storage }. res "]} exec {" drbdadm up $ {storage} ": command =>" drbdadm up $ {storage} ", refreshonly => true, subscribe => exec ["drbdadm create-MD $ {storage}"], require => file ["/etc/drbd. d/$ {storage }. res "]} exec {'drbd _ make_primary ': command =>" drbdadm -- overwrite-data-of-peer primary all ", refreshonly => true, subscribe => exec ["drbdadm up $ {storage}"], require => service ['drbd ']} exec {'drbdadm secondary all ': command => "drbdadm secondary all", refreshonly => true, subscribe => service ['drbd '], before => exec ['drbd _ make_primary ']} exec {"drbdadm primary -- Force $ {storage}": command => "drbdadm primary -- Force $ {storage }", require => package ['drbd-utils']} exec {"mkfs. ext3 $ {Dev} ": command =>" mkfs. ext3 $ {Dev} ", Path => ["/usr/bin ","/usr/sbin ","/bin ","/sbin "], require => exec ["drbdadm primary -- Force $ {storage}"]}


Puppet: A New drbd experience

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.