-
Notifications
You must be signed in to change notification settings - Fork 86
.JanusGraphException: A JanusGraph graph with the same instance id is already open #64
Comments
Instance ids are in default case automatically generated.
Does it this help? |
@farodin91 This worked for me |
With statefulset your hostname might be the same after re-deployment. In case you didn't properly close you JanusGraph instance and simply forced restart the pod then the instance id won't be removed from opened instances set. Thus, you will need to remove zombie instance. You can use the next approach to force close zombie instance (Never close non-zombie instances):
That said, in your situation, as you are using a statefulset it might be easier for you to use the next configuration:
With this configuration you won't need to manually force close your zombie instances when you stop your pod non-gracefully. If your pod has the same hostname (or |
@farodin91 Your suggestion to set use config I just had to experiment a little to figure how to use your option in a multi-container environment that is set up with a docker-compose file. Here is what that section in my docker-compose file looks like. Perhaps share this helps others resolve this issue faster: version: '3.7'
services:
janusgraph:
container_name: optarix-janusgraph
hostname: janusgraph.local
image: janusgraph/janusgraph:0.6.1
# Last check of version number on 23 Apr 2022
# More recent images may be available at https://hub.docker.com/r/janusgraph/janusgraph/tags?page=1&ordering=last_updated
ports:
- 8182:8182
environment:
# Configuration options for JanusGraph desribed at:
# https://docs.janusgraph.org/configs/configuration-reference
- graph.replace-instance-if-exists=true # addresses error described at The complete set of JanusGraph config variables that can be passed as environment variables as illustrated in this docker-compose file snipped can be found at https://docs.janusgraph.org/configs/configuration-reference Note that I didn't always see the reported issue. It showed as an intermittent issue. My hypothesis is that when the docker container shut down, JanusGraph / TinkerPop didn't shut down correctly in all cases. It could be caused by a race condition. Note that I let Docker to initiate the shutdown. In this cases I used I'm wondering if the setting Update 05 June 2022: When providing config parameters as environment variables in a docker-compose file, it's necessary to prefix the environment variable names with "janusgraph." See my later answer with an example of providing such an environment variable correctly. |
I tried the same, however, according to the documentation at https://github.com/JanusGraph/janusgraph-docker#configuration you need to use an outer namespace services:
janusgraph:
container_name: optarix-janusgraph
hostname: janusgraph.local
image: janusgraph/janusgraph:0.6.1
# Last check of version number on 23 Apr 2022
# More recent images may be available at https://hub.docker.com/r/janusgraph/janusgraph/tags?page=1&ordering=last_updated
ports:
- 8182:8182
environment:
# Configuration options for JanusGraph desribed at:
# https://docs.janusgraph.org/configs/configuration-reference
- janusgraph.graph.replace-instance-if-exists=true With that in place I can then use a terminal into the janusgraph container and then cat the file with the generated properties: cat /etc/opt/janusgraph/janusgraph.properties In my case this then yields the following content for that file:
Notice the very last entry in this file which is what is configured in the docker-compose file. |
I deployed Janusgraph:latest container into kubernetes using statefulset.
it worked fine in kubernetes Pod, but sometimes it fails without being able to recover, in the below exception I found the line saying:
I have no idea from where is this instance id comes from.
I can't understand why this is happening out of nowhere, my guess is that the pod got restarted or the container crashed maybe, and that made this happend.
this is the startup of Janus log and also the exception during it:
The text was updated successfully, but these errors were encountered: