How to configure a rails application to use both Couchbase and RDB(MySql2) together

#1

I am trying to make a rails application that uses both Couchbase and MySql2.
Currently, I have set up both database.yml and couchbase.yml.

And I have both ActiveRecord::Base and Couchbase::Model in models folders.
When I start the server I get the following error.

=> Booting Thin
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Connecting to database specified by database.yml
Exiting
/Users/DynamicScope/.rvm/gems/ruby-2.1.2/gems/couchbase-1.3.10/lib/couchbase.rb:63:in `initialize': failed to create libcouchbase instance, The administrative account can no longer be used for data access (error=0x26) (Couchbase::Error::InvalidUsername)
	from /Users/DynamicScope/.rvm/gems/ruby-2.1.2/gems/couchbase-1.3.10/lib/couchbase.rb:63:in `new'
	from /Users/DynamicScope/.rvm/gems/ruby-2.1.2/gems/couchbase-1.3.10/lib/couchbase.rb:63:in `connect'
	from /Users/DynamicScope/.rvm/gems/ruby-2.1.2/gems/couchbase-1.3.10/lib/couchbase.rb:138:in `bucket'
  1. Is it even possible to use both CouchBase and MySql2 together?
  2. If so, how should I configure my rails application?
#2

Yes, it is possible to use couchbase with mysql2.

What are you using as credentials for couchbase connection? You should not use Administrator account there. Use bucket name and password.

failed to create libcouchbase instance, The administrative account can no longer be used for data access (error=0x26) (Couchbase::Error::InvalidUsername)
1 Like
#3

Now I can connect to CouchBase server, but when I tried to get design docs, I always get Couchbase::Error::Timeout.

ddoc = client.design_docs["my_design"]
Couchbase::Error::Timeout: failed to execute HTTP request, Client-Side timeout exceeded for operation.
...

What could be the problem for this issue??

#4

Shooting in the dark: did you publish you design document?

#5

Yes, I published “my_design” from CouchBase web console.

It looks like public vs private IP issue.
I connected to public IP, but server returned with its private IP.
Someone told me this could be the problem.

#6

The best way to solve it is to assign nodes some dns names

1 Like
#7

Is there a reason why I do not need an username entered?

#8

What do you mean? At the moment, you might omit username, because it matches bucket name, but in future releases there probably will be possible to use single account to access different buckets

1 Like