我也有同样的问题
@Lukas
的回答为我解决了这个问题。
以下是我的配置文件的内容:
# Connect securely to remote Cosmos DB via Gremlin API
# Use .gremlin.cosmosdb.azure.com to avoid infinite stack trace
hosts:
- <account-name>.gremlin.cosmosdb.azure.com
port: 443
# Find your database name and collection ID in the Azure portal
username: /dbs/<db>/colls/<coll>
# Pick read-write or read-only key
password: <key from Cosmos DB account>
connectionPool:
enableSsl: true
# Add cert file to avoid this error:
# WARN org.apache.tinkerpop.gremlin.driver.Cluster - SSL configured without a trustCertChainFile and thus trusts all certificates without verification (not suitable for production)
trustCertChainFile: /etc/ssl/certs/Baltimore_CyberTrust_Root.pem
serializer:
className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0
config:
serializeResultToString: true
此外,我正在使用这个Docker图像启动Gremlin控制台:
cruftlab/gremlin-console
(其中包含在
connectionPool.trustCertChainFile
).
我创建了两个文件夹:
gremlin-data/{conf,data}
,并将配置(我在上面粘贴的配置)存储在
gremlin-data/conf/cosmosdb.yaml
. 然后我用这个命令启动了Gremlin控制台:
docker run --rm -it \
-v $(pwd)/gremlin-data/conf:/opt/gremlin/conf/extra \
-v $(pwd)/gremlin-data/data:/opt/gremlin/data \
cruftlab/gremlin-console
现在,您加载的配置文件应该可以在映像中访问(在
conf/extra
gremlin> :remote connect tinkerpop.server conf/extra/cosmosdb.yaml
==>Configured <account-name>.gremlin.cosmosdb.azure.com/<ip address>:443
gremlin>
你来了!
还有,你
应该
能够在Cosmos DB和
data
体积,但到目前为止,我只在本地进行了测试。:)
信用: