disney / couchbase Goto Github PK
View Code? Open in Web Editor NEWThis project forked from getaroom/chef-couchbase
Chef cookbook to install and configure Couchbase Server
This project forked from getaroom/chef-couchbase
Chef cookbook to install and configure Couchbase Server
This is restrictive on the kinds of characters that can be used.
Should use CGI::escape() on the Username + password.
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
The apt repository components line is incorrect, it should be:
components ["#{node[:lsb][:codename]}/main"]
It's a simple fix, but if you want a proper pull request let me know.
Couchbase Community 2.1.1 is now available. We should upgrade this cookbook to support that.
This appears upon "kitchen test" with version 12.4
CouchBase doesn't sign its RPMs so they won't install on certain distros that are paranoid about such things.
Not sure if this is the greatest thing to do, so let's make it a configurable attribute.
A limitation of the cookbook is that using any of the LWRPs for buckets or clusters only checks the local node. So, installing Couchbase and setting up a cluster with couchbase_cluster
will always result in a new cluster, instead of joining an existing cluster if it already exists. This behavior is commonly desired in environments.
If Chef update fail during the package download of "/var/chef/cache/couchbase-server-community_3.0.0-ubuntu12.04_amd64.deb". The file will end up with empty size.
Then retry chef update won't download the package again and run into below error messages.
[2015-06-13T05:41:24+00:00] INFO: Processing dpkg_package[/var/chef/cache/couchbase-server-community_3.0.0-ubuntu12.04_amd64.deb] action install (couchbase::server line 55)
[0m
================================================================================[0m
[31mError executing action `install` on resource 'dpkg_package[/var/chef/cache/couchbase-server-community_3.0.0-ubuntu12.04_amd64.deb]'[0m
================================================================================[0m
[0mChef::Exceptions::Package[0m
-------------------------[0m
dpkg failed - <Mixlib::ShellOut#44214900: command: 'dpkg -s /var/chef/cache/couchbase-server-community_3.0.0-ubuntu12.04_amd64.deb' process_status: #<Process::Status: pid 8207 exit 2> stdout: '' stderr: 'dpkg-query: error: --status needs a valid package name but '/var/chef/cache/couchbase-server-community_3.0.0-ubuntu12.04_amd64.deb' is not: illegal package name in specifier '/var/chef/cache/couchbase-server-community_3.0.0-ubuntu12.04_amd64.deb': must start with an alphanumeric character
[0m
[0mUse --help for help about querying packages.' child_pid: 8207 environment: {"LC_ALL"=>"C.UTF-8", "LANGUAGE"=>"C.UTF-8", "LANG"=>"C.UTF-8"} timeout: 600 user: group: working_dir: >![0m
[0mResource Declaration:[0m
Travis complained about the version of ruby (2.1 should be 2.2):
https://travis-ci.org/disney/couchbase/builds/137923316
This seems to affect all recent PRs.
so upgraded the version on my PR and it fails for different reasons:
https://travis-ci.org/disney/couchbase/builds/137928096
d2da821#diff-3e8bbb9796e1fb74295ceac72868245b
Did not make it into the 1.3.0 version on the Supermarket. The modification of the node twice with these different attributes is not idempotent and I see the following in the Couchbase runs:
Since these modifications override eachother, they actually cause some of the processes to fail / be restarted.
Could we get a newer version of the cookbook published to the Supermarket?
When I use a wrapper cookbook to override the ['couchbase']['server']['version'] of Couchbase (and other attributes), it is not respected.
This is because the server.rb calculates an URL to get the resource. But, that happens before the wrapper cookbook runs its attributes, so the URL is calculated on version 3.0.0, yet I'm trying to override to install Couchbase 3.0.2.
The workaround for this is to include all the calculation logic from attributes/server.rb in the wrapper cookbook attributes.
how update and download from couchbase
Looks like, in server.rb, re-running:
couchbase_settings "web"
Does something that logs users out, even though everything is being re-set to the same thing.
FIX:
libraries/settings_provider.rb:
CHANGE: @new_resource.settings.all? { |key, value| @current_resource.settings[key.to_s] == value }
TO: @current_resource.settings.all? { |key, value| @new_resource.settings[key.to_s] == value }
Works because current_resource will not contain the password (it's not returned), but if everything else matches, we're good...
In our environment, we use the default username + password to install the node. Couchbase installs just fine.
Subsequent chef-client runs fail because they get access denied when trying to perform couchbase_node. I suspect the other operations that require credentials would fail sequentially.
12 rspec tests are failing after GH-3 was added.
RSpec 3 doesn't support the 'nested' format, and we should use 'documentation' instead.
I'm not a Ruby developer, so I don't know how issues like this are best handled. I'd be tempted on either pinning the Gemfile to force rspec 2 or 3 and have the included .rspec file be appropriate to the version.
When using this cookbook to install couchbase server enterprise 2.5.1 I get an error connection refused on the first attempt to configure the DB using the API. The stack trace is below.
I will submit a pull request shortly with some added retries which supresses the problem.
[2014-09-11T14:22:31+01:00] INFO: *** Chef 11.4.4 ***
[2014-09-11T14:22:32+01:00] INFO: Setting the run_list to ["recipe[my-recipe]"] from JSON
[2014-09-11T14:22:32+01:00] INFO: Run List is [recipe[my-recipe]]
[2014-09-11T14:22:32+01:00] INFO: Run List expands to [my-recipe]
[2014-09-11T14:22:32+01:00] INFO: Starting Chef Run for myhost
[2014-09-11T14:22:32+01:00] INFO: Running start handlers
[2014-09-11T14:22:32+01:00] INFO: Start handlers complete.
[2014-09-11T14:22:40+01:00] INFO: execute[apt-get-update] ran successfully
[2014-09-11T14:22:40+01:00] INFO: directory[/var/cache/local] created directory /var/cache/local
[2014-09-11T14:22:40+01:00] INFO: directory[/var/cache/local] owner changed to 0
[2014-09-11T14:22:40+01:00] INFO: directory[/var/cache/local] group changed to 0
[2014-09-11T14:22:40+01:00] INFO: directory[/var/cache/local] mode changed to 755
[2014-09-11T14:22:40+01:00] INFO: directory[/var/cache/local/preseeding] created directory /var/cache/local/preseeding
[2014-09-11T14:22:40+01:00] INFO: directory[/var/cache/local/preseeding] owner changed to 0
[2014-09-11T14:22:40+01:00] INFO: directory[/var/cache/local/preseeding] group changed to 0
[2014-09-11T14:22:40+01:00] INFO: directory[/var/cache/local/preseeding] mode changed to 755
[2014-09-11T14:22:40+01:00] INFO: node['couchbase']['server']['edition']: enterprise
[2014-09-11T14:22:40+01:00] INFO: node['couchbase']['server']['version']: 2.5.1
[2014-09-11T14:24:06+01:00] INFO: remote_file[/var/chef/cache/couchbase-server-enterprise_2.5.1_x86_64.deb] updated
[2014-09-11T14:24:35+01:00] INFO: directory[/opt/couchbase/var/lib/couchbase/data] mode changed to 755
modify
on resource 'couchbase_node[self]'Connection refused - connect(2)
/tmp/vagrant-chef-2/chef-solo-1/cookbooks/couchbase/libraries/client.rb:19:in get' /tmp/vagrant-chef-2/chef-solo-1/cookbooks/couchbase/libraries/node_provider.rb:32:in
node_data'
/tmp/vagrant-chef-2/chef-solo-1/cookbooks/couchbase/libraries/node_provider.rb:27:in node_database_path' /tmp/vagrant-chef-2/chef-solo-1/cookbooks/couchbase/libraries/node_provider.rb:13:in
load_current_resource'
127: couchbase_node "self" do
128: database_path node['couchbase']['server']['database_path']
129:
130: username node['couchbase']['server']['username']
131: password node['couchbase']['server']['password']
132: end
133:
couchbase_node("self") do
action :modify
retries 0
retry_delay 2
cookbook_name :couchbase
recipe_name "server"
database_path "/opt/couchbase/var/lib/couchbase/data"
username "rateservice"
password "letmein"
id "self"
end
[2014-09-11T14:24:35+01:00] INFO: Running queued delayed notifications before re-raising exception
[2014-09-11T14:24:35+01:00] ERROR: Running exception handlers
[2014-09-11T14:24:35+01:00] ERROR: Exception handlers complete
[2014-09-11T14:24:36+01:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-09-11T14:24:36+01:00] FATAL: Errno::ECONNREFUSED: couchbase_node[self](couchbase::server line 127) had an error: Errno::ECONNREFUSED: Connection refused - connect(2)
libraries/max_memory_quota_calculator.rb should be using ||=
instead of =
on line 3 and 4.
./tmp/d20160504-13085-e9de14/cookbooks/couchbase/libraries/max_memory_quota_calculator.rb:3: warning: already initialized constant Couchbase::MaxMemoryQuotaCalculator::MAX_MEMORY_PERCENT
/tmp/d20160504-13085-e9de14/cookbooks/couchbase/libraries/max_memory_quota_calculator.rb:3: warning: previous definition of MAX_MEMORY_PERCENT was here
/tmp/d20160504-13085-e9de14/cookbooks/couchbase/libraries/max_memory_quota_calculator.rb:4: warning: already initialized constant Couchbase::MaxMemoryQuotaCalculator::RESERVE_BYTES
/tmp/d20160504-13085-e9de14/cookbooks/couchbase/libraries/max_memory_quota_calculator.rb:4: warning: previous definition of RESERVE_BYTES was here
When running a cookbook that installs a different version of Couchbase, the cookbook does not shut down the existing instance, if it exists, before upgrading the binaries.
This causes Couchbase to crash. The upgrade still occurs, but data integrity may be compromised.
See: chef/chef#3292
The code uses the default behavior :install, so chef-client 12.0.3 will upgrade Couchbase as a new version attribute is specified. If you upgrade to chef-client 12.3.0, this behavior won't work anymore (testing should be done for intermediary versions).
If using a newer version of chef-client, the desirable action is :upgrade (recipes/server.rb)
In chef-client 12.0.3:
In chef-client 12.3.0:
seems like it has been a year since the "preparing for release 1.5.0" thing... :P
If you override the attributes for ['couchbase']['server']['edition'] and ['couchbase']['server']['version'] it doesn't change the calculated download path for the RPM.
Passwords should not persist without encryption. https://github.com/disney/couchbase/blob/master/recipes/server.rb#L44 saves the passwords in plain text in the node object.
The changes made to use proper authentication header instead of deprecated URI credentials broke the rspec tests.
attributes/server.rb calculates the path of where couchbase is based on the version. 3.0.0 should be treated like 3.0.1, 3.0.2, ...
Instead, the <= 3.0.0 forces 3.0.0 to behave like preceeding (2.5.x) versions.
Running into an issue where the release packages are giving me a 403 forbidden error, you can see for yourself here:
http://packages.couchbase.com/releases/3.0.0/couchbase-server-community_3.0.0-ubuntu14.04_amd64.deb
Is there anywhere else we to get the community edition? I've tried earlier versions and it seems like they have the same issue.
Here is a method that works for me [0], after stopping & starting the server, we need to wait for the deamon to start real couchbase process and rewrite new pid file.
i have no windows knowledge so it needs a proper fix
[0] isbaran@748d977
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.