STUDIO远程连接时配置数据库失败

graph版本:v2.0.0
studio版本:v2
部署方式:docker

graph和studio服务都已经启动,zai服务端可以通过命令行与graph交互,访问的端口没有改变,是9669

错误信息:Fail to initialize the connection pool

cat docker-compose.yml

version: '3.4'
services:
  client:
    image: vesoft/nebula-http-gateway:v2
    environment:
      USER: root
    ports:
      - 8080
    networks:
      - nebula-web
  web:
    image: vesoft/nebula-graph-studio:v2
    environment:
      USER: root
      UPLOAD_DIR: ${MAPPING_DOCKER_DIR}
    ports:
      - 7001
    depends_on:
      - client
    volumes:
      - ${UPLOAD_DIR}:${MAPPING_DOCKER_DIR}:rw
    networks:
      - nebula-web
  importer:
    image: vesoft/nebula-importer:v2
    networks:
      - nebula-web
    ports:
      - 5699
    volumes:
      - ${UPLOAD_DIR}:${MAPPING_DOCKER_DIR}:rw
    command:
      - "--port=5699"
      - "--callback=http://nginx:7001/api/import/finish"
  nginx:
    image: nginx:alpine
    volumes:
      - ./nginx/nginx.conf:/etc/nginx/conf.d/nebula.conf
      - ${UPLOAD_DIR}:${MAPPING_DOCKER_DIR}:rw
    depends_on:
      - client
      - web
    networks:
      - nebula-web
    ports:
      - 31098:7001

安装包名是nebula-graph-studio-v2,直接cd然后用docker-compose pull安装的

请问在 studio 填的 host 是什么?如果studio/nebula graph 是同一台机器,可以用第一个网卡的非 loop back IP:9669。

可以打一个 docker ps 么?

是同一台机器,而且ip用的就是非loop back IP

CONTAINER ID   IMAGE                              COMMAND                  CREATED       STATUS                 PORTS                                                                                                  NAMES
06105bc5122b   nginx:alpine                       "/docker-entrypoint.…"   2 hours ago   Up 2 hours             80/tcp, 0.0.0.0:31098->7001/tcp                                                                        graphstudiov2_nginx_1
9d8a6cd28976   vesoft/nebula-graph-studio:v2      "docker-entrypoint.s…"   2 hours ago   Up 2 hours             0.0.0.0:49305->7001/tcp                                                                                graphstudiov2_web_1
416250f2ebae   vesoft/nebula-importer:v2          "nebula-importer --p…"   2 hours ago   Up 2 hours             0.0.0.0:49303->5699/tcp                                                                                graphstudiov2_importer_1
ecaa3cb781a3   vesoft/nebula-http-gateway:v2      "./nebula-http-gatew…"   2 hours ago   Up 2 hours             0.0.0.0:49304->8080/tcp                                                                                graphstudiov2_client_1
0235277e312e   d97718c69437                       "/bin/bash"              2 hours ago   Up 2 hours                                                                                                                    great_stonebraker
e06881216cbe   vesoft/nebula-storaged:v2.0.0      "./bin/nebula-storag…"   3 hours ago   Up 3 hours (healthy)   9777-9778/tcp, 9780/tcp, 0.0.0.0:49285->9779/tcp, 0.0.0.0:49284->19779/tcp, 0.0.0.0:49283->19780/tcp   nebuladockercompose_storaged0_1
f2961fac26ab   vesoft/nebula-graphd:v2.0.0        "/usr/local/nebula/b…"   3 hours ago   Up 3 hours (healthy)   0.0.0.0:49299->9669/tcp, 0.0.0.0:49298->19669/tcp, 0.0.0.0:49297->19670/tcp                            nebuladockercompose_graphd1_1
ef506e89452d   vesoft/nebula-graphd:v2.0.0        "/usr/local/nebula/b…"   3 hours ago   Up 3 hours (healthy)   0.0.0.0:9669->9669/tcp, 0.0.0.0:49296->19669/tcp, 0.0.0.0:49295->19670/tcp                             nebuladockercompose_graphd_1
4793a0a53848   vesoft/nebula-storaged:v2.0.0      "./bin/nebula-storag…"   3 hours ago   Up 3 hours (healthy)   9777-9778/tcp, 9780/tcp, 0.0.0.0:49288->9779/tcp, 0.0.0.0:49287->19779/tcp, 0.0.0.0:49286->19780/tcp   nebuladockercompose_storaged1_1
dd4252536483   vesoft/nebula-graphd:v2.0.0        "/usr/local/nebula/b…"   3 hours ago   Up 3 hours (healthy)   0.0.0.0:49294->9669/tcp, 0.0.0.0:49293->19669/tcp, 0.0.0.0:49292->19670/tcp                            nebuladockercompose_graphd2_1
cc9f47e6ac05   vesoft/nebula-storaged:v2.0.0      "./bin/nebula-storag…"   3 hours ago   Up 3 hours (healthy)   9777-9778/tcp, 9780/tcp, 0.0.0.0:49291->9779/tcp, 0.0.0.0:49290->19779/tcp, 0.0.0.0:49289->19780/tcp   nebuladockercompose_storaged2_1
4801e0caca6e   vesoft/nebula-metad:v2.0.0         "./bin/nebula-metad …"   3 hours ago   Up 3 hours (healthy)   9560/tcp, 0.0.0.0:49276->9559/tcp, 0.0.0.0:49275->19559/tcp, 0.0.0.0:49274->19560/tcp                  nebuladockercompose_metad0_1
30129c1464ed   vesoft/nebula-metad:v2.0.0         "./bin/nebula-metad …"   3 hours ago   Up 3 hours (healthy)   9560/tcp, 0.0.0.0:49279->9559/tcp, 0.0.0.0:49278->19559/tcp, 0.0.0.0:49277->19560/tcp                  nebuladockercompose_metad2_1
fff9842f0df5   vesoft/nebula-metad:v2.0.0         "./bin/nebula-metad …"   3 hours ago   Up 3 hours (healthy)   9560/tcp, 0.0.0.0:49282->9559/tcp, 0.0.0.0:49281->19559/tcp, 0.0.0.0:49280->19560/tcp                  nebuladockercompose_metad1_1
33355bd735a3   vesoft/nebula-console:v2-nightly   "/bin/sh"                5 days ago    Up 5 days                                                                                                                     quirky_hopper
80f26baee9a6   a6eb2a334a9f                       "/docker-entrypoint.…"   5 days ago    Up 5 days              80/tcp, 0.0.0.0:13099->13099/tcp                                                                       nebulagraphstudiov2_nginx_1
881d4fb638b6   vesoft/nebula-http-gateway:v2      "./nebula-http-gatew…"   5 days ago    Up 5 days              8080/tcp, 0.0.0.0:49191->13099/tcp                                                                     nebulagraphstudiov2_client_1
d285089eaf5a   vesoft/nebula-console:v2-nightly   "/bin/sh"                7 days ago    Up 7 days                                                                                                                     clever_gagarin
7a6d406b7319   vesoft/nebula-console:v2-nightly   "/bin/sh"                9 days ago    Up 9 days                                                                                                                     charming_shannon
bac1eba2c2a3   vesoft/nebula-console:v2-nightly   "/bin/sh"                9 days ago    Up 9 days                                                                                                                     nice_chebyshev
d588e5d3639b   vesoft/nebula-console:v2-nightly   "/bin/sh"                10 days ago   Up 10 days                                                                                                                    hopeful_merkle
96206f64cd06   vesoft/nebula-console:v2-nightly   "/bin/sh"                10 days ago   Up 10 days                                                                                                                    thirsty_williamson
34183a5c7773   vesoft/nebula-console:v2-nightly   "/bin/sh"                10 days ago   Up 10 days                                                                                                                    beautiful_merkle
2765c02a28cf   vesoft/nebula-console:v2-nightly   "/bin/sh"                10 days ago   Up 10 days                                                                                                                    charming_fermi
aa671c894ca3   vesoft/nebula-console:v2-nightly   "/bin/sh"                11 days ago   Up 11 days                                                                                                                    admiring_shtern
a36034111c55   vesoft/nebula-console:v2-nightly   "/bin/sh"                11 days ago   Up 11 days                                                                                                                    confident_black
da691e86957e   vesoft/nebula-console:v2-nightly   "/bin/sh"                11 days ago   Up 11 days                                                                                                                    gracious_leavitt

从您这里边看,跑了两套studio。

CONTAINER ID   IMAGE                              COMMAND                  CREATED       STATUS                 PORTS                                                                                                  NAMES
06105bc5122b   nginx:alpine                       "/docker-entrypoint.…"   2 hours ago   Up 2 hours             80/tcp, 0.0.0.0:31098->7001/tcp                                                                        graphstudiov2_nginx_1
9d8a6cd28976   vesoft/nebula-graph-studio:v2      "docker-entrypoint.s…"   2 hours ago   Up 2 hours             0.0.0.0:49305->7001/tcp                                                                                graphstudiov2_web_1
416250f2ebae   vesoft/nebula-importer:v2          "nebula-importer --p…"   2 hours ago   Up 2 hours             0.0.0.0:49303->5699/tcp                                                                                graphstudiov2_importer_1
ecaa3cb781a3   vesoft/nebula-http-gateway:v2      "./nebula-http-gatew…"   2 hours ago   Up 2 hours             0.0.0.0:49304->8080/tcp                                                                                graphstudiov2_client_1

另一套不完整的。

80f26baee9a6   a6eb2a334a9f                       "/docker-entrypoint.…"   5 days ago    Up 5 days              80/tcp, 0.0.0.0:13099->13099/tcp                                                                       nebulagraphstudiov2_nginx_1
881d4fb638b6   vesoft/nebula-http-gateway:v2      "./nebula-http-gatew…"   5 days ago    Up 5 days              8080/tcp, 0.0.0.0:49191->13099/tcp                                                                     nebulagraphstudiov2_client_1

可以把他们都删掉,重新 compose up 试试么?

谢谢,我去试试,另外还有别的可能吗

暂时想不到,感觉可能是这个干扰了不过。
更往下可以看看从 nebula-web 这个docker网络去 curl http-gateway,参考 GitHub - vesoft-inc/nebula-http-gateway: Gateway to provide HTTP endpoints for the Nebula Graph service. 的 README,看看通不通。

你好,还是没用,把镜像删除了,这是所有服务镜像

nebuladockercompose_graphd1_1 /usr/local/nebula/bin/nebu … Up 0.0.0.0:49365->19669/tcp, 0.0.0.0:49364->19670/tcp,
0.0.0.0:49366->9669/tcp
nebuladockercompose_graphd2_1 /usr/local/nebula/bin/nebu … Up 0.0.0.0:49353->19669/tcp, 0.0.0.0:49352->19670/tcp,
0.0.0.0:49354->9669/tcp
nebuladockercompose_graphd_1 /usr/local/nebula/bin/nebu … Up 0.0.0.0:49351->19669/tcp, 0.0.0.0:49350->19670/tcp,
0.0.0.0:9669->9669/tcp
nebuladockercompose_metad0_1 ./bin/nebula-metad --flagf … Up 0.0.0.0:49342->19559/tcp, 0.0.0.0:49341->19560/tcp,
0.0.0.0:49343->9559/tcp, 9560/tcp
nebuladockercompose_metad1_1 ./bin/nebula-metad --flagf … Up 0.0.0.0:49345->19559/tcp, 0.0.0.0:49344->19560/tcp,
0.0.0.0:49346->9559/tcp, 9560/tcp
nebuladockercompose_metad2_1 ./bin/nebula-metad --flagf … Up 0.0.0.0:49348->19559/tcp, 0.0.0.0:49347->19560/tcp,
0.0.0.0:49349->9559/tcp, 9560/tcp
nebuladockercompose_storaged0_1 ./bin/nebula-storaged --fl … Up 0.0.0.0:49359->19779/tcp, 0.0.0.0:49358->19780/tcp,
9777/tcp, 9778/tcp, 0.0.0.0:49360->9779/tcp,
9780/tcp
nebuladockercompose_storaged1_1 ./bin/nebula-storaged --fl … Up 0.0.0.0:49362->19779/tcp, 0.0.0.0:49361->19780/tcp,
9777/tcp, 9778/tcp, 0.0.0.0:49363->9779/tcp,
9780/tcp
nebuladockercompose_storaged2_1 ./bin/nebula-storaged --fl … Up 0.0.0.0:49356->19779/tcp, 0.0.0.0:49355->19780/tcp,
9777/tcp, 9778/tcp, 0.0.0.0:49357->9779/tcp,
9780/tcp

graphstudiov2_client_1 ./nebula-http-gateway Up 0.0.0.0:49338->8080/tcp
graphstudiov2_importer_1 nebula-importer --port=569 … Up 0.0.0.0:49340->5699/tcp
graphstudiov2_nginx_1 /docker-entrypoint.sh ngin … Up 0.0.0.0:31098->7001/tcp, 80/tcp
graphstudiov2_web_1 docker-entrypoint.sh npm r … Up 0.0.0.0:49339->7001/tcp

您自己尝试 curl gateway 结果如何?

$ curl -i  -X POST -d \
   '{"username":"user","password":"password","address":"<graphd_ip>","port":9669}' \
   http://<gateway_ip>:<gateway_port>/api/db/connect

@hetao @jerry.liang
能帮忙看看么?

我的理解和你一样的,让用户先模拟调用连接看一下,目前看不出是什么具体问题,请求应该是转发到了http-gateway进行了处理,但是建立连接的时候报错了。

1 个赞

这里有个相似的问题,看下你拉取的版本对不对,使用 docker-compose pull 更新下

1 个赞

该话题在最后一个回复创建后30天后自动关闭。不再允许新的回复。

浙ICP备20010487号