How to create a Janusgraph instance within my program to access the custom graph - janusgraph

JanusGraph: I have created a custom graph using ConfiguredGraphFactory and able to access this graph using the gremlin console. How can I access this graph from my Scala code?
Currently I am running a remote gremlin server and connect to this remote server from my code to preform transactions on my custom graph. I am wondering whether there are any ways to create a janusgraph instance in my program and access the graph rather than through remote server.
Janus Graph Version: 0.2.0

Currently, in TinkerPop compliant systems, you cannot instantiate a local graph reference that acts upon a remote graph reference. However, you can use withRemote to instantiate a local graph traversal object backed by a remote graph traversal reference:
gremlin> cluster = Cluster.open('conf/remote-objects.yaml')
==>localhost/127.0.0.1:8182
gremlin> graph = EmptyGraph.instance()
==>emptygraph[empty]
gremlin> g = graph.traversal().withRemote(DriverRemoteConnection.using(cluster, "g"))
==>graphtraversalsource[emptygraph[empty], standard]
gremlin> g.V().valueMap(true)
==>[name:[marko],id:1,label:person,age:[29]]
==>[name:[vadas],id:2,label:person,age:[27]]
==>[name:[lop],id:3,label:software,lang:[java]]
==>[name:[josh],id:4,label:person,age:[32]]
==>[name:[ripple],id:5,label:software,lang:[java]]
==>[name:[peter],id:6,label:person,age:[35]]
==>[name:[matthias],id:13,label:vertex]
gremlin> g.close()
gremlin> cluster.close()
However, since you are using the ConfiguredGraphFactory, I will assume your graphs are created dynamically. This would mean that your graphs and traversal objects are not bound to any variable names on the remote servers since these bindings are traditionally formed during the instantiation of the graphs defined your gremlin-server.yaml graphs {} object. As you can see above, the only way to use withRemote is to supply the name of the variable bound to the graph traversal on the remote server. JanusGraph does not currently support dynamically updating the server's global bindings, but once it does, then you will be able to use the withRemote method to get a local reference to a remote traversal object. If you need to work with local graph objects bound to remote graph references, you would need to work with the TinkerPop community to enable such functionality. For more information on this matter, please see this TinkerPop Jira.
Another solution is to remove the layer of your remote JanusGraph servers. If you are looking to run the graph processing locally, then perhaps you don't need remote JanusGraph servers at all. You could then instantiate graph references using the JanusGraphFactory and perform your queries on local graph references which talk directly to the backend datastores.
Finally, assuming you configured your remote JanusGraph servers and the backend data stores (i.e. you know how the remote JanusGraph servers are configured to talk to the backend datastores -- this would be the configurations saved on your ConfigurationManagementGraph), you could leave your remote JanusGraph servers alone, and instantiate local graph references by using the JanusGraphFactory to open a properties file with the same configuration as that for your graph as defined by the ConfigurationManagementGraph.

Related

connect JanusGraph management API to remote JanusGraph Server

I have a running instance of JanusGraph Server and I can connect using EmptyGraph for read and write. But I cannot use EmptyGraph to create an instance of JanusGraphManagement. I want to use the API to define my schema but the only options I can find are:
use Cluster to create a Client to submit command strings
connect an embedded JanusGraph instance directly to my Cassandra backend
I prefer to do everything through the JanusGraph Server. Is there a way to do this using the Java API? Or am I stuck with only the two above options?
As described in the updated docs of JanusGraph here:
The described connection uses GraphBinary and the janusgraph-driver which doesn't allow accessing the internal JanusGraph components such as ManagementSystem. To access the ManagementSystem, you have to submit java-based scripts, see Submitting Scripts, or directly accessing JanusGraph by local opening a JanusGraph instance.
So for now, no other options exists.

How to configure parse server to use an n-node mongo setup

Migrating to mongo is well documented but I could not find a reference/guidelines for configuring the server to work with an n-node mongo cluster.
Mlabs suggest that if using anything other than single node (aka sandbox) users should run tests to cover primary node failure.
Has anyone configured parse server on let's say a 3-node mongo? How?
Alternatively, what volume of users/requests should prompt an n-node mongo cluster set up?
use the uri you're given by the likes of mlab (mongo labs) - parse server will sort it out...

Dynamic Partionitioning in TazyGrid Cluster

When adding a new server or removing one, does TazyGrid (Open Source) partitions data at runtime or do we have to pre-plan & do some pre-deployement strategies ?
If some pre-deployment planning is required, can some one please link to any resources?
Yes TayzGrid is completely dynamic and no pre-palnning is required.
Simply add a node to the cluster or remove it & data balancing will be done automatically.
Peer to Peer Dynamic Cluster
Runtime Discovery within Cluster
Runtime Discovery by Clients
Failover Support: Add/Remove Servers at Runtime
and more from TayzGrid website
Data distribution map: The data distribution map is provided only if the caching topology is Partitioned Cache or Partition-Replica Cache. This information is useful for clients to determine the location of data in the cluster. The client can therefore directly access the data from the cache server. The data distribution map is provided in two cases:
(1) at the time of the client’s connection to the server and
(2) if when any change occurs in the partitioning map because a new server has been added or removed from the cluster.

How do you provision new node on the cloud with puppet 2?

Every node should have the valid certificate to connect to the puppet-master.
In the past, the nodes are static and setup by the operator and execute the ca-sign by themselves.
Today, the nodes are created dynamically by the api of cloud providers, such as AWS, Azure, etc.
To provision a new node is a problem because we don't know the node's domain or IP, before it is running and attached to an IP.
I found some strategies on the Internet:
Make a pre-sign ca and ship it with node created
Just enable the autosign feature anyway
Leverage the external node classifier
About the pre-sign method, it will be like this:
https://gist.github.com/zipkid/3496753
The related work is
Generate the ca for your node
Put the ca files to the new node
Perhaps you want to change the hostname for the external node classifier.
It is better for the prebuilt image like the ec2 image,
we can build it with the presign ca.
About the enable autosign method, just edit the autosign rules.
I think it is good for a special case like the ec2's vpc, because every node cannot be connected from the Internet.
About the external node classifier method, there are many variations:
Validate the node, if it is a valid node to include the useful classes, or the noop class
Validate the node, if it is a valid node to add the new entry to autosign rule
How do you provision a cloud node with Puppet's ca ? Could you like to share it ?
PS. puppet 3's new feature policy-based-autosigning

Can the Neo4j HA cluster 1.9 configuration be setup so only part of a graph database is part of the cluster

Is it possible to configure and/or code so only parts of the graph database is part of the cluster?. So for instance only nodes with a relationship of a specified type will be part of the HA cluster – enabling that master and slaves can have “private” parts of the graph database and access to a common part.
A Neo4j instance using HA is always completely replicated to the slave instances. If you need to keep parts of your graph private to a single machine, you should use an additional, seperate, non-HA Neo4j instance.

Resources