path: root/doc/forum
diff options
authorJoey Hess2015-08-31 15:25:14 -0700
committerJoey Hess2015-08-31 15:25:14 -0700
commit743e455569f19dc0de7392a974c51856244a327f (patch)
tree2965cd9fac6c1689d1f67e22b2afae249326cc36 /doc/forum
parentfc380b3ee08a062d0d469c6a8b86704a1b70187b (diff)
Diffstat (limited to 'doc/forum')
1 files changed, 77 insertions, 0 deletions
diff --git a/doc/forum/how_to_install_a_cluster_with_propellor/comment_1_e6860056989da82fd7cd8f374e209548._comment b/doc/forum/how_to_install_a_cluster_with_propellor/comment_1_e6860056989da82fd7cd8f374e209548._comment
new file mode 100644
index 00000000..21a2b80c
--- /dev/null
+++ b/doc/forum/how_to_install_a_cluster_with_propellor/comment_1_e6860056989da82fd7cd8f374e209548._comment
@@ -0,0 +1,77 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2015-08-31T20:55:38Z"
+ content="""
+Don't know that I have an answer to this question. I've never done that. :)
+I think it breaks down into several independant questions,
+although due to lack of experience I could be missing some.
+## Initial installation
+I'm working on getting propellor to be able to
+generate bootable disk images. <>
+Once that works, it might provide a way to generate images to install
+machines in a cluster. But, any method for installing the base system
+and propellor could work too, and there are probably many cluster-specific
+OS installation tools.
+## Expressing the cluster in a propellor config file
+Propellor's config is a list of hosts, and `defaultMain` looks at the hostname
+to determine which host it is provisioning. A cluster might have many hosts
+that are very similar or identical, and you probably want it to be easy to
+add more.
+So, you'll probably want a way to generate a Host from a HostName with the
+desired Properties you want nodes in the cluster to have:
+[[!format haskell """
+clusterNode :: HostName -> Host
+clusterNode hn = host hn
+ & foo
+ & bar
+Then you could feed a list of hostnames to defaultMain to finish the
+config file:
+[[!format haskell """
+main :: IO ()
+main = defaultMain (map clusterNode hostnames)
+ where
+ hostnames =
+ [ "node1"
+ , "node2"
+ -- etc
+ ]
+ -- alternatively...
+ -- hostnames = map (\n -> "node" ++ show n) [1..100]
+Or, you could even look up the current hostname, and feed defaultMain
+a Host containing that hostname; so this single propellor configuration
+could be used on any number of hosts:
+[[!format haskell """
+main = IO ()
+main = do
+ hn <- takeWhile (/= '\n') <$> readProcess "hostname" ["-f"]
+ defaultMain [ clusterNode hn ]
+## Triggering propellor on nodes
+When you change your propellor config.hs, you need a way to trigger the
+nodes to update. Propellor has a couple of different ways to do this;
+you could just use Propellor.Property.Cron.runPropellor to run it periodically
+from cron on all the nodes.
+Or you could run propellor --spin against all the hosts in the
+cluster to push out a change. (It would be a nice enhancement to make
+propellor be able to --spin multiple hosts concurrently; there's nothing
+really preventing it but the output would be a mess.)
+There's certianly room for improvement here. Also you'll probably want some
+monitoring, which propellor doesn't provide in itself, etc.