Giter Site home page Giter Site logo

couchbase's People

Contributors

atom-disney avatar carmstrong avatar cgriego avatar chrisputonen avatar citruspi avatar enalmada avatar estahn avatar joebalancio avatar juliandunn avatar korishev avatar kplimack avatar lishim avatar majuscule avatar montn060 avatar mrloop avatar nickm4062 avatar talla014 avatar unhuman avatar whisller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

couchbase's Issues

Cluster converging WIP

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

client install issue on debian

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.

Upgrade to 2.1.1

Couchbase Community 2.1.1 is now available. We should upgrade this cookbook to support that.

Ignore unsigned CouchBase packages

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.

Nodes cannot join an existing cluster

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.

When couchbase deb package download fail, it will result in the file as empty file.

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

Couchbase processes get restarted every chef run

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:

  • couchbase_node[self] action modify
  • couchbase_node[self] action modify

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?

Overrides not respected

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.

Chef logs out user logged into UI with every chef run.

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...

server recipe fails when cluster changes credentials

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.

rspec 3 doesn't support the nested format

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.

Error executing action `modify` on resource 'couchbase_node[self]'

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

Error executing action modify on resource 'couchbase_node[self]'

Errno::ECONNREFUSED

Connection refused - connect(2)

Cookbook Trace:

/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:innode_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:inload_current_resource'

Resource Declaration:

In /tmp/vagrant-chef-2/chef-solo-1/cookbooks/couchbase/recipes/server.rb

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:

Compiled Resource:

Declared in /tmp/vagrant-chef-2/chef-solo-1/cookbooks/couchbase/recipes/server.rb:127:in `from_file'

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)

Redefinition of constants when using Chefspec

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

Recipe behaves differently depending on versions of chef-client (Breaking Change)

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:

  • :install (default) - performs install OR upgrade.
  • :upgrade - performs ONLY upgrade (will not install)

In chef-client 12.3.0:

  • :install (default) - performs ONLY install (will not upgrade).
  • :upgrade - performs install OR upgrade.

cut the new release?

seems like it has been a year since the "preparing for release 1.5.0" thing... :P

rspec test cases don't work

The changes made to use proper authentication header instead of deprecated URI credentials broke the rspec tests.

Couchbase v3.0.0 does not install properly

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.