用spark调用janusgraph 会有一个小问题,在此记录下,如果对读者有帮助那最好了。
1.图已经创建并写入了数据,通过spark 找不到图,或者GraphComputer,图形是空的。Caused by: com.netflix.astyanax.connectionpool.exceptions.BadRequestException
背景: 官方文档建议建议用cql来连接Janusgraph存储后端,但用spark读取时会找不到图或报错
官方配置文件示例
janusgraphmr.ioformat.conf.storage.backend=cassandra
janusgraphmr.ioformat.conf.storage.hostname=localhost
janusgraphmr.ioformat.conf.storage.port=9160
janusgraphmr.ioformat.conf.storage.cassandra.keyspace=janusgraph
修改为
janusgraphmr.ioformat.conf.storage.backend=cassandra
janusgraphmr.ioformat.conf.storage.cql.keyspace=janusgraph
janusgraphmr.ioformat.conf.storage.hostname=192.168.xx.xx
janusgraphmr.ioformat.conf.storage.connection-timeout=240000