Skip to content
veny edited this page Nov 2, 2012 · 9 revisions

Home

Connect

# create client for http://localhost:2480 by default
client = Orientdb4r.client 
# or
client = Orientdb4r.client :host => 'any.host.com', :port => 2480, :ssl => false

client.connect :database => 'temp', :user => 'admin', :password => 'admin'

Connect to Distributed Cluster

client = Orientdb4r.client :nodes => [{:host => '1.domain.com'}, {:host => '2.domain.com', :port => 2481}]
# or with RoundRobin load balancing and Recover Time
client = Orientdb4r.client :nodes => [{}, {:port => 2481}], :load_balancing => :round_robin, :lb_recover_time => 2

Load Balancing

  • default mode is :sequence which calls cluster nodes in the order of nodes defined by the client initialization (next node will be used if the current one fails)
  • :round_robin assigns work in round-robin order per nodes defined by the client initialization.

Recover Time

  • when a server node is down due to maintenance or a crash, load balancer will use the recover-time as a delay before retrying the downed server node

Disconnect

client.disconnect

Server Info

# additional authentication to the server with a user that has rights to 'server.info' resource
client.server :user => 'root', :password => 'root'
 => {"connections"=>[{"connectionId"=>"9", "remoteAddress"=>"/127.0.0.1:49546", "db"=>"-", "user"=>"-", ...

Clone this wiki locally