Connecting to Gremlin Server and Executing Management Commands

542 просмотра
Перейти к первому непрочитанному сообщению

Manjunath Sindagi

не прочитано,
13 мар. 2017 г., 14:28:3913.03.2017
– Gremlin-users
Hi,

I am trying to connect to remote gremlin server and trying to execute the commands. The commands are the management commands of reindexing. However, when I run below commands it works for couple of them and then the following error is thrown..any suggestion how to resolve?

gremlin> :remote connect tinkerpop.server conf/remote.yaml
gremlin> :> graph = TitanFactory.open("DYNAMODBPROPERTIES_PATH")
==>standardtitangraph[com.amazon.titan.diskstorage.dynamodb.DynamoDBStoreManager:[127.0.0.1]]
gremlin> :> mgmt = graph.openManagement()
==>com.thinkaurelius.titan.graphdb.database.management.ManagementSystem@1da11278
gremlin> :> desc = mgmt.makePropertyKey("desc").dataType(String.class).make()
No such property: mgmt for class: groovysh_evaluate
Type ':help' or ':h' for help.
Display stack trace? [yN]Y
groovy.lang.MissingPropertyException: No such property: mgmt for class: groovysh_evaluate
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:307)
at groovysh_evaluate.run(groovysh_evaluate:3)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:70)
at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:190)
at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.super$3$execute(GremlinGroovysh.groovy)
at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:72)
at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:152)
at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:152)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:83)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:152)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:455)

Florian Hockmann

не прочитано,
13 мар. 2017 г., 14:48:1713.03.2017
– Gremlin-users
Hi Manjunath,

the Gremlin Console connects by default in a sessionless mode which means that no state can be shared between different requests. So your mgmt variable isn't present anymore when you want to use it. You can however use a session simply by adding the session keyword when connecting. See the documentation for more information:


But I am note sure if this was already implemented in the version of TinkerPop that was included in Titan (especially when you are running Titan 1.0). In that case, you can try it with a newer version of the Gremlin Console anyway, version 3.1.0 could work here.

Another option would be of course to create a bigger request that includes all your commands in a single script that you can then send to the Gremlin Server at once.

Manjunath Sindagi

не прочитано,
15 мар. 2017 г., 08:04:4615.03.2017
– Gremlin-users

Thanks Florian. Able to run the commands and execute it. Reindexing is working locally with cassandra backend , however its throwing scriptevaluation time out error . Tried changing the time to 180 seconds, still the issue persists. Have shared another post on the same. 

Manjunath Sindagi

не прочитано,
15 мар. 2017 г., 08:05:5515.03.2017
– Gremlin-users
Just to add, dynamodb is used as backend remotely.
Ответить всем
Отправить сообщение автору
Переслать
0 новых сообщений