Daniel,

On Sun, Oct 9, 2011 at 11:45 PM, doubleagent <doubleagen...@gmail.com> wrote:
> I don't understand.
>
> I thought that 'neo4j start' "ran the server database" instead of "wrapping
> an embedded database", but the gremlin console in the webadmin service shows
> that g is bound to an instance of "EmbeddedGraphDatabase".
Yes, what you are seeing is the internal database instance the server
is exposing over REST. If this was a High Availability installation,
you would see a "HighlyAvailableGraphDatabase" instance being injected
into the Gremlin scripting environment.

>
>> REST is right now the best way to interact with the server. Alas, there is
>> the Neo4j Shell (not Gremlin, but you can execute Cypher remotely) that
>> communicates with RMI instead, see ...
>
> Actually, the REST api isn't as bad as I thought it was originally, because
> it turns out I can still take advantage of Gremlin's laziness (I had missed
> "17.14.5. Set script variables" in the docs).  I just have to be clever
> about it.
Exactly, that is what the Gremlin and Cypher plugins are about -
pushing more complex chunks of work to the server close to the DB.
However, be aware that exposing a Groovy console is a security risk in
the Gremlin case. Secure it.

>
>>"g = new Neo4jGraph('/tmp/neo4j')" is what you would do from Java or an
> empty Groovy shell to get hold of a new Neo4j graph database instance. In
> the Neo4j server case that is already done for you.
>
> Right.  What if the server is sitting on an internal network at
> 192.168.1.14, and I want to connect to it from 192.168.1.12.  On .12 I might
> say...
>
> (import '(??))
> (def g (Neo4jGraph. "192.168.1.14:7474/..."))
>
Well, there is a Java-REST binding that exposes exactly this, see
https://github.com/neo4j/neo4j-java-rest-binding if you want to try.
We are working on moving this onto Par with the Embedded API so it is
usable through e.g. Blueprints.

> Or, if it didn't fully support URI's, I might just mount it.  Then,
>
> (def g (Neo4jGraph. "/mnt/db-srv/..."))
>
>
> But either way, I still need to know what to import, and what jar file needs
> to be on the classpath.
>
Yes, as with all scripting langs, that is a bit of trial-error :) If
you need more stuff on the classpath, the server is picking up
anything under /plugins and exposes it ...

/peter
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to