Re: [Pacemaker] Automating Pacemaker Setup
Hey Mate, I have a setup nearly working. Would you be willing to share recipes? I specifically am trying to get haproxy and NginX ssl termination running in groups. 1 node runs ha proxy and the other nodes run nginx for ssl termination. I've set it up with chef. It's not quite working yet, but it's close. Since you've managed to get this working, you may be able to finish these off. I have everything working except the init start/stop hooks for pacemaker to set the Elastic IP automatically and then run chef-client to reconfigure everything on all the other nodes. Todd On Thu, 2011-05-26 at 22:26 +, veghead wrote: > Does anyone have any links to documentation on automating Pacemaker setup > with > tools like Chef or Puppet? > > I have a working two node cluster for HAProxy on EC2, but I'd like to fully > automate the setup process for future nodes. Specifically so I can spin up a > new > instance w/out any manual intervention. > > Thanks. > > > ___ > Pacemaker mailing list: Pacemaker@oss.clusterlabs.org > http://oss.clusterlabs.org/mailman/listinfo/pacemaker > > Project Home: http://www.clusterlabs.org > Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf > Bugs: > http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker ec2_failover.rb Description: application/ruby ec2setip.rb Description: application/ruby #Auto generated ha.conf file for all load balancer nodes udpport 694 use_logd yes autojoin none keepalive 2 warntime 5 deadtime 10 initdead 60 <%node[:haproxy][:peers].each_value do |peer| %> ucast eth0 <%=peer%> <% end %> <%node[:haproxy][:peers].each_key do |peer| %> node <%=peer%> <% end %> crm respawn#Turn off stonith, does not apply to our use case property stonith-enabled=false property no-quorum-policy=ignore #Define all the primitives #primitive haproxy lsb:/etc/init.d/haproxy #primitive nginx lsb:/etc/init.d/nginx primitive ec2setip lsb:/etc/init.d/ec2setip #Group all services together TODO use Collocating to try and offload nginx to other 2 nodes #group proxygroup haproxy nginx ec2setip commit ___ Pacemaker mailing list: Pacemaker@oss.clusterlabs.org http://oss.clusterlabs.org/mailman/listinfo/pacemaker Project Home: http://www.clusterlabs.org Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
[Pacemaker] Help with batch import and resource distribution
Hi all, I'm creating my pacemaker configuration from a script executed by chef and I'm having some issues. I have 3 init scripts that run the following services. haproxy nginx ec2setip chef-client I would like the following distribution. Single Node: haproxy and ec2setip All other Nodes: nginx. All nodes: chef-client Essentially, I use ha proxy for load balancing. I use nginx for ssl decryption and serving static pages, so I want that to run on every node that isn't the ha proxy node. During a failover, I want haproxy to be started, and ec2setip to be run on a single node, and all other nodes to start nginx. I'm not using STONITH on purpose. If one node takes over the IP and another is running, it does not affect my service since none of my clustered services perform any data write. I'm using the following configuration, and importing it with this command. crm configure < /tmp/proxyfailover.txt here is the content of /tmp/proxyfailover.txt BEGIN FILE -- property stonith-enabled=false primitive haproxy lsb:/etc/init.d/haproxy primitive nginx lsb:/etc/init.d/nginx primitive ec2setip lsb:/etc/init.d/ec2setip primitive chefclient lsb:/etc/init.d/chef order nginx-after-haproxy inf: haproxy nginx order ec2setip-after-nginx inf: nginx ec2setip order chefclient-after-ec2setip inf: ec2setip chefclient commit END FILE -- I've read this section, but I'm a bit lost. Any help would be greatly appreciated. http://www.clusterlabs.org/doc/en-US/Pacemaker/1.0/html/Pacemaker_Explained/s-resource-sets-collocation.html#id580996 Thanks, Todd ___ Pacemaker mailing list: Pacemaker@oss.clusterlabs.org http://oss.clusterlabs.org/mailman/listinfo/pacemaker Project Home: http://www.clusterlabs.org Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
[Pacemaker] Help with configuring pacemaker automatically with chef
Hi guys, I'm having a hard time finding the info I need to configure pacemaker from an input file. I've been using Zookeeper a lot in our application tier, so I'm familiar with clusters, however I'm struggling to adapt that knowledge to the pacemaker configuration. Here is an overview of our cluster. OS: Ubuntu 10.10 Server 64 bit Environment: Amazon EC2 Pacemaker Stack: heartbeat using unicast and pacemaker from the Ubuntu package 1 Online node, 2 Standby nodes. All nodes are true peers, so there is no weight should be given to any nodes. I have heartbeat up and running. This is the output from my crm_mon -1 command. Last updated: Thu Jan 13 22:00:55 2011 Stack: Heartbeat Current DC: ip-10-160-58-200 (79170a75-1b64-43c8-80a1-ff4f490149e5) - partition with quorum Version: 1.0.8-042548a451fce8400660f6031f4da6f0223dd5dd 3 Nodes configured, unknown expected votes 0 Resources configured. Online: [ ip-10-160-138-192 ip-10-160-233-27 ip-10-160-58-200 ] Now I need to perform the following. Only 1 node is running these services at a time, the other two do not have these services running. I need to check our public IP, which can be configured from chef. On Start start haproxy start stunnel execute custom script to switch our amazon ec2 ip to the node running on stop stop haproxy stop stunnel Another caveat. I've read the cluster_from_scratch several times. It uses the interactive command line to configure pacemaker. I need to create an xml file directly using my chef recipes. I have no ability to know each node's UUID, only the hostname. Can anyone provide me with an example of how I can configure pacemaker from an xml file to execute several scripts? Thanks, Todd ___ Pacemaker mailing list: Pacemaker@oss.clusterlabs.org http://oss.clusterlabs.org/mailman/listinfo/pacemaker Project Home: http://www.clusterlabs.org Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker