Пример #1
0
func configureClusterStore(node, kvstore *host.Host, opt machine.Options) (machine.Options, string, error) {
	opts := opt.StringSlice("engine-opt")

	r := machine.Runner(*kvstore)
	storeUrl, err := r.FindContainerByImage(map[string]int{
		"consul":    8500,
		"zookeeper": 2181,
		// TODO etcd
	})
	if err != nil {
		return nil, "", err
	}

	opts = append(opts, "cluster-store "+storeUrl)
	ip, err := node.Driver.GetIP()
	if err != nil {
		return nil, "", err
	}

	opts = append(opts, "cluster-advertise "+ip+":2376")
	opt["engine-opt"] = opts

	return opt, storeUrl, nil
}
Пример #2
0
func removeAllContainers(h *host.Host) error {
	r := machine.Runner(*h)
	return r.RemoveAllContainers()
}