Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cluster converging WIP #15

Open
ProTip opened this issue Dec 17, 2013 · 9 comments
Open

Cluster converging WIP #15

ProTip opened this issue Dec 17, 2013 · 9 comments

Comments

@ProTip
Copy link

ProTip commented Dec 17, 2013

Hello. I've done some work on cluster convergence: https://github.com/ProTip/couchbase/tree/pool_join . Not a lot of testing going on and it's got a gutted gem inside it(somebody already used "recliner"). It works well for my purposes though and was hoping somebody might be willing to lend a hand or advice in getting it ready for integration. Here is an example of using the new functionality:

couchbase_cluster "NewCluster" do
  members_finder Proc.new {
    member_nodes = search(:node, 'tags:couchbase_cluster\:\:session_provider')
    member_nodes.map { |node| node['ipaddress'] }
  }
  username 'Administrator'
  password 'Password'
  exists false
  action :nothing
end.run_action(:converge)

There is a configurable timeout set to 120 by default. If it can't converge in that time it will raise the usual timeout exception. Here is some information about the angle I took: https://github.com/ProTip/recliner

-Cheers

@ghost ghost assigned carmstrong Dec 17, 2013
@juliandunn
Copy link

Awesome! I know @carmstrong has done some work in this area so perhaps he'll be able to look at it.

@carmstrong
Copy link

Awesome indeed. I'll take a look and provide any input.

@carmstrong
Copy link

This is looking pretty good at first glance. This is pretty much the functionality we want, but I'd want to pull the cluster info from an encrypted data bag. We can either do that in a wrapper cookbook or make the stock cookbook read that stuff from elsewhere.

I'm actually wondering if we should modify the default recipe to just setup configuration options, and then have separate recipes for cluster and bucket setup. Those could read from node attributes or data bags, much like the elasticsearch cookbook does.

@ProTip
Copy link
Author

ProTip commented Jan 8, 2014

I ran in to a very unfortunate and frustrating blocker on this current iteration. It appears that chef is not currently uploading sub-directories of the library folder :|

@carmstrong
Copy link

I have some proposed changes in #17 that I think are necessary to make the cookbook more extensible before we add cluster support. @ProTip and @juliandunn , mind taking a look? Some tests aren't passing, and I'm sure I just missed something.

@ProTip
Copy link
Author

ProTip commented Jan 9, 2014

I've updated my fork to move the necessary files out of the sub directory and into the main library folder. I have successfully stood up four 4 node "autoscale" clusters on AWS using CloudFormation and Chef Server with this:

node.set['couchbase']['server']['version'] = "2.1.1"
node.set['couchbase']['server']['password'] = "Password"
include_recipe "couchbase::server"

node.save
couchbase_cluster "NewCluster" do
  members_finder Proc.new {
    member_nodes = search(:node, 'tags:couchbase_cluster\:\:session_provider')
    member_nodes.map { |node| node['ipaddress'] }
  }
  username 'Administrator'
  password 'Password'
  converge_timeout 300
  exists false
  action :converge
end

Currently it working for my needs(aside from the fact that I won't be hard-coding the password ;) ) and I'm just offering it up as POC/WIP; I realize it could use some cleanup and re-work for integration.

In case anyone is wondering about the node.save.. It's so the tags I set in first_run.json as part of my bootstrap process get saved to the server and are searchable during the first run.

@dvinograd
Copy link

Guys, I'm a bit lost on how to go about configuring a cluster with this cookbook. Should I be using this syntax, or the one from README? Both throw errors (Net::HTTPServerException: 401 "Unauthorized" from README syntax (cluster recipe) and undefined method members_finder from the above syntax). The HTTPServerException is coming from response = get "/pools/#{@new_resource.cluster}" of libraries/cluster_data.rb.

@estahn
Copy link

estahn commented Mar 19, 2015

@ProTip I'm getting the following output on both nodes:

==> couchbase02: Top cluster is ["33.33.1.11"]
==> couchbase02: I'm in the top cluster; not moving :P
==> couchbase02: [2015-03-20T10:35:40+11:00] WARN: Converging...
==> couchbase02: Top cluster is ["33.33.1.11"]
==> couchbase02: I'm in the top cluster; not moving :P
==> couchbase02: [2015-03-20T10:35:44+11:00] WARN: Converging...
==> couchbase02: Top cluster is ["33.33.1.11"]
...

The cluster nodes will not be joined. Any ideas?

@akpmp
Copy link

akpmp commented Nov 17, 2016

use of WIP in anyplace project server module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants