Storage Client Error

Nebula Service Version: 2.0-rc1

Pom:

    <groupId>com.vesoft</groupId>
    <artifactId>client</artifactId>
    <version>2.0.0-rc1</version>

My Code:

import com.vesoft.nebula.client.storage.StorageClient;
import com.vesoft.nebula.client.storage.scan.ScanVertexResultIterator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.UnsupportedEncodingException;

public class StorageClientExample {

private static final Logger LOGGER = LoggerFactory.getLogger(StorageClientExample.class);

public static void main(String[] args) throws UnsupportedEncodingException {
    StorageClient client = new StorageClient("192.168.11.20", 9779);
    try {
        client.connect();
    } catch (Exception e) {
        LOGGER.error("storage client connect error, ", e);
        System.exit(1);
    }

    ScanVertexResultIterator iterator = client.scanVertex(
            "test",
            "person");
}
}

My console output:

ERROR [main] - Method name listSpaces not found
ERROR [main] - Method name listSpaces not found
Exception in thread "main" java.lang.IllegalArgumentException: Space:test does not exist.
at com.vesoft.nebula.client.meta.MetaManager.getPartsAlloc(MetaManager.java:307)
at com.vesoft.nebula.client.meta.MetaManager.getSpaceParts(MetaManager.java:289)
at com.vesoft.nebula.client.storage.StorageClient.scanVertex(StorageClient.java:272)
at com.vesoft.nebula.client.storage.StorageClient.scanVertex(StorageClient.java:154)
at com.vesoft.nebula.client.storage.StorageClient.scanVertex(StorageClient.java:113)
at com.vesoft.nebula.client.storage.StorageClient.scanVertex(StorageClient.java:80)
at com.xiao.demo.StorageClientExample.main(StorageClientExample.java:30)

Process finished with exit code 1

这里要填metad的端口。

请问,我一开始也出现了同样的问题,查看了nebula里的配置后,把端口修改成了meta的端口(但不知道为什么nebula配置里写的ip是127.0.0.1,所以在java这边就没改ip),运行之后又出现了新的问题,报错:get Storage client error。

Java 和数据库内核部署在一台机器上吗

并不是,nebula统一部署在科室服务器上,java是在自己的电脑上访问的

哦,那就是通信问题,你把两边的 ip 都改成真实的 ip,以及确保你的电脑能访问对应的 ip。

新帖子里回吧。。- -。这个老帖子我先关了。