check for OrientDB up and running/start/stop

904 views
Skip to first unread message

Adolfo Rodriguez

unread,
Feb 24, 2012, 7:02:35 PM2/24/12
to OrientDB
Hi, I was thinking about some strategy to check if OrientDB is up and
running in:
* my applications (even before a connection be open)
* some script to verify continuity (e.g. make a temporized ping)

So far, the ways I have seen for this task are:
* trying to acquire connection and check the returned exception (not a
distinguished error code, I think) or
* isClose() method on a database instance.

Is it possible any cleaner way to this task, e.g. without acquiring a
new connection neither having a database object available.
For example a static method or a WS call.

What are the options here? Any wiki page about this matter or any open
issue? Does it make sense?

On the other hand, would it be possible start/stop the server from the
client app, for example invoking some of the embedded jars,
e.g.orientdb-client.jar?

Thanks.

Nicole

unread,
Feb 26, 2012, 6:26:53 AM2/26/12
to orient-...@googlegroups.com
Adolfo,

This rather depends on where the instance of OrientDb is located. (I'm
assuming here that you're talking of a server instance, not embedded,
where your question would make no sense.)

If the server is located on a remote machine, I can see no other way to
check that to attempt the connection. In any case, you're going to have
to contact the remote machine somehow to determine if OrientDb is running.

It it's on the same Linux machine you could, if you had sufficient
privileges, check for an instance of the server process. I'm not sure
how you do this with Windows, but I recall that there is some kind of
mechanism for this.

It seems to me that there's little advantage in trying to find out if
the server is running. Just try to open the socket. If that succeeds,
the server is running. If that doesn't, the server isn't running and
needs to be started.

I'm not sure that even the most widely-used DBMSs (MySQL, PostgreSQL,
DB2, etc) provide the functionality you're asking for. Even if OrientDb
provided it, you would still have to attempt to open a network
connection to the server because such a feature would have to work with
a server located remotely.

Warmests

Nicole

Adolfo Rodriguez

unread,
Feb 27, 2012, 12:48:10 AM2/27/12
to OrientDB
Thanks Nicole, agree with you.

Just wanted to check if I was missing anything.

Adolfo
>  smime.p7s
> 3KViewDownload

Luca Garulli

unread,
Feb 27, 2012, 4:12:08 AM2/27/12
to orient-...@googlegroups.com
Hi all,
it would be useful having a simple web service that returns the status of a OrientDB server. Something like:


{
  "upSince" : "2012-02-20 10:10:10"
}

By default "guest" user can execute it but if removed only authenticated server users can execute it.

WDYT?

Nicole

unread,
Feb 27, 2012, 7:52:51 AM2/27/12
to orient-...@googlegroups.com
As a web service, this makes sense.

Nicole

On 02/27/2012 09:12 AM, Luca Garulli wrote:
> Hi all,
> it would be useful having a simple web service that returns the status
> of a OrientDB server. Something like:
>
> http://localhost:2480/serverStatus
>
> {
> "upSince" : "2012-02-20 10:10:10"
> }
>
> By default "guest" user can execute it but if removed only authenticated
> server users can execute it.
>
> WDYT?
>
>
>
> On 27 February 2012 06:48, Adolfo Rodriguez <pelly...@yahoo.es

> <mailto:pelly...@yahoo.es>> wrote:
>
> Thanks Nicole, agree with you.
>
> Just wanted to check if I was missing anything.
>
> Adolfo
>
> On Feb 26, 12:26 pm, Nicole <nic...@cats-muvva.net

Message has been deleted

Adolfo Rodriguez

unread,
Feb 27, 2012, 12:47:23 PM2/27/12
to OrientDB
Could after the client API provide also some additional method which
seemly
interface the WS without any extra code?

I think this would remove the necessity of knowing the proper
Exceptions to catch, releasing from the task of opening and closing
connections and so on....

In future it could become a kind of 'monitoring module' for external
auditing, or something like that.

+1

Adolfo


On Feb 27, 10:12 am, Luca Garulli <l.garu...@gmail.com> wrote:
> Hi all,
> it would be useful having a simple web service that returns the status of a
> OrientDB server. Something like:
>
> http://localhost:2480/serverStatus
>
> {
>   "upSince" : "2012-02-20 10:10:10"
>
> }
>
> By default "guest" user can execute it but if removed only authenticated
> server users can execute it.
>
> WDYT?
>

Anton Terekhov

unread,
Feb 28, 2012, 4:59:00 AM2/28/12
to orient-...@googlegroups.com
Such a web-service can be even more usefull.

I'm talking about much more complicated solution - server status can return not only uptime, but also number of clients connected, qps, etc..
Look at http://httpd.apache.org/docs/2.0/mod/mod_status.html for an example....

Anton Terekhov

unread,
Feb 28, 2012, 5:01:47 AM2/28/12
to orient-...@googlegroups.com
Sorry, posted early..

This approach to serverstatus can be used for remote monitoring OrientDB instance with tools like Cacti...
But, for easier configuration (as Orient right now lack of IP access conlrols), this URL should be up on different port.

Luca Garulli

unread,
Feb 28, 2012, 6:16:03 AM2/28/12
to orient-...@googlegroups.com
Hi,

It returns the active connections, profiler, used database, etc.

Lvc@

Anton Terekhov

unread,
Feb 28, 2012, 4:52:54 PM2/28/12
to orient-...@googlegroups.com
Sorry, missed it..

Waldeyr Mendes Cordeiro da Silva

unread,
Sep 26, 2017, 4:11:14 PM9/26/17
to OrientDB
On Linux, you can use a command line:

ps aux | grep "orientdb" | grep -v grep | awk '{print $2}'

It will return the pid of the process.
Reply all
Reply to author
Forward
0 new messages