Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to get metad servers's address #202

Closed
jiangpeng12345 opened this issue Feb 22, 2022 · 11 comments
Closed

how to get metad servers's address #202

jiangpeng12345 opened this issue Feb 22, 2022 · 11 comments
Labels
type/question Type: question about the product

Comments

@jiangpeng12345
Copy link

scan vertex and edge code, there is a line MetaCache([('XXX', 9669),('XXX', 9669),('XXX', 9669)], 50000),how to get the three XXX address?

@jiangpeng12345
Copy link
Author

always get TTransportException error

@jiangpeng12345
Copy link
Author

image

@wey-gu
Copy link
Contributor

wey-gu commented Feb 22, 2022

Please refer to my post here: https://www.siwei.io/nebula-python-storage-docker-guide/

@jiangpeng12345
Copy link
Author

我没有使用Jupyter啊,我用的是anaconda下的spyder,这种方式怎么获取metad地址呢?
ps:运行simple sample是正常的哦。

@wey-gu
Copy link
Contributor

wey-gu commented Feb 22, 2022

啊,关键的问题在于,docker compose 这个部署方式默认只暴露 graphD 给外边,如果你要从外边能够访问,需要

  1. 配置 metaD 的 外部的随机地址到 metaClient 里
  2. 配置 storageD 的外部随机地址到 storageClient 里

怎么获取这个地址呢? docker ps 应该可以看到
比如

docker ps | grep metad0

ce5bc829f88c   vesoft/nebula-metad:v2.6.0                               "/usr/local/nebula/b…"   2 months ago   Up 4 weeks (healthy)   9560/tcp, 0.0.0.0:49175->9559/tcp, :::49175->9559/tcp, 0.0.0.0:49174->19559/tcp, :::49174->19559/tcp, 0.0.0.0:49173->19560/tcp, :::49173->19560/tcp                  nebula-docker-compose_metad0_1

得到 49175->9559 是metad0外部端口

meta_cache = MetaCache([('<主机的非localhost ip>', <meta0的外部端口>),
                        ('如上', 如上),
                        ('如上', 如上)],
                       50000)

# manually specify the storage address,下边 storaged 的地址方式同上
storage_addrs = [HostAddr(host='172.28.1.4', port=9779),
                 HostAddr(host='172.28.1.5', port=9779),
                 HostAddr(host='172.28.1.6', port=9779)]
graph_storage_client = GraphStorageClient(meta_cache, storage_addrs)

@wey-gu
Copy link
Contributor

wey-gu commented Feb 22, 2022

如果不指定 storaged 的地址,client 会从 metaD 里边去获取它服务发现得到的地址,就是域名形式的,这样容器网络之外没法访问得到 storageD

@jiangpeng12345
Copy link
Author

得到 49175->9559 是metad0外部端口 到这里是看懂的。
主机的非localhost ip哪里查看?
<meta0的外部端口>是9559对吗?

@wey-gu
Copy link
Contributor

wey-gu commented Feb 22, 2022

我这个例子给您参考哈

$ docker ps | grep nebula
21d450c071bf   vesoft/nebula-graphd:v2.6.0                              "/usr/local/nebula/b…"   2 months ago   Up 4 weeks (healthy)   0.0.0.0:9669->9669/tcp, :::9669->9669/tcp, 0.0.0.0:49180->19669/tcp, :::49180->19669/tcp, 0.0.0.0:49179->19670/tcp, :::49179->19670/tcp                              nebula-docker-compose_graphd_1
f98fc5e1adfc   vesoft/nebula-graphd:v2.6.0                              "/usr/local/nebula/b…"   2 months ago   Up 4 weeks (healthy)   0.0.0.0:49183->9669/tcp, :::49183->9669/tcp, 0.0.0.0:49182->19669/tcp, :::49182->19669/tcp, 0.0.0.0:49181->19670/tcp, :::49181->19670/tcp                            nebula-docker-compose_graphd1_1
ab251a15c0a0   vesoft/nebula-graphd:v2.6.0                              "/usr/local/nebula/b…"   2 months ago   Up 4 weeks (healthy)   0.0.0.0:49160->9669/tcp, :::49160->9669/tcp, 0.0.0.0:49159->19669/tcp, :::49159->19669/tcp, 0.0.0.0:49158->19670/tcp, :::49158->19670/tcp                            nebula-docker-compose_graphd2_1
2945b3726be1   vesoft/nebula-storaged:v2.6.0                            "/usr/local/nebula/b…"   2 months ago   Up 4 weeks (healthy)   9777-9778/tcp, 9780/tcp, 0.0.0.0:49163->9779/tcp, :::49163->9779/tcp, 0.0.0.0:49162->19779/tcp, :::49162->19779/tcp, 0.0.0.0:49161->19780/tcp, :::49161->19780/tcp   nebula-docker-compose_storaged1_1
83896069ac51   vesoft/nebula-storaged:v2.6.0                            "/usr/local/nebula/b…"   2 months ago   Up 4 weeks (healthy)   9777-9778/tcp, 9780/tcp, 0.0.0.0:49166->9779/tcp, :::49166->9779/tcp, 0.0.0.0:49165->19779/tcp, :::49165->19779/tcp, 0.0.0.0:49164->19780/tcp, :::49164->19780/tcp   nebula-docker-compose_storaged2_1
a5e3001873f2   vesoft/nebula-storaged:v2.6.0                            "/usr/local/nebula/b…"   2 months ago   Up 4 weeks (healthy)   9777-9778/tcp, 9780/tcp, 0.0.0.0:49169->9779/tcp, :::49169->9779/tcp, 0.0.0.0:49168->19779/tcp, :::49168->19779/tcp, 0.0.0.0:49167->19780/tcp, :::49167->19780/tcp   nebula-docker-compose_storaged0_1
773dc8d929fa   vesoft/nebula-metad:v2.6.0                               "/usr/local/nebula/b…"   2 months ago   Up 4 weeks (healthy)   9560/tcp, 0.0.0.0:49172->9559/tcp, :::49172->9559/tcp, 0.0.0.0:49171->19559/tcp, :::49171->19559/tcp, 0.0.0.0:49170->19560/tcp, :::49170->19560/tcp                  nebula-docker-compose_metad1_1
ce5bc829f88c   vesoft/nebula-metad:v2.6.0                               "/usr/local/nebula/b…"   2 months ago   Up 4 weeks (healthy)   9560/tcp, 0.0.0.0:49175->9559/tcp, :::49175->9559/tcp, 0.0.0.0:49174->19559/tcp, :::49174->19559/tcp, 0.0.0.0:49173->19560/tcp, :::49173->19560/tcp                  nebula-docker-compose_metad0_1
ce4ad7ba5cfc   vesoft/nebula-metad:v2.6.0                               "/usr/local/nebula/b…"   2 months ago   Up 4 weeks (healthy)   9560/tcp, 0.0.0.0:49178->9559/tcp, :::49178->9559/tcp, 0.0.0.0:49177->19559/tcp, :::49177->19559/tcp, 0.0.0.0:49176->19560/tcp, :::49176->19560/tcp                  nebula-docker-compose_metad2_1
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 1e:f4:3b:aa:18:d2 brd ff:ff:ff:ff:ff:ff
    inet 192.168.8.127/24 brd 192.168.8.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::1cf4:3bff:feaa:18d2/64 scope link
       valid_lft forever preferred_lft forever
meta_cache = MetaCache([('192.168.8.127', 49175),
                        ('192.168.8.127', 49172),
                        ('192.168.8.127', 49178)],
                       50000)

# manually specify the storage address
storage_addrs = [HostAddr(host='192.168.8.127', port=49169),
                 HostAddr(host='192.168.8.127', port=49163),
                 HostAddr(host='192.168.8.127', port=49166)]
graph_storage_client = GraphStorageClient(meta_cache, storage_addrs)

@porscheme
Copy link

@wey-gu

Its bit confusing what IP Address/port combination to use for metad and storage.
Can you help to clarify?

Thanks

  • We deployed Nebula to our PoC K8S cluster using Helm Charts
  • Below is the output of 'kubectl get svc -n graph -o wide'
nebula-cluster-graphd-svc            ClusterIP      10.0.229.78    <none>         9669/TCP,19669/TCP,19670/TCP                     9d
nebula-cluster-metad-headless        ClusterIP      None           <none>         9559/TCP,19559/TCP,19560/TCP                     9d
nebula-cluster-metad-loadbalancer    ClusterIP      10.0.129.219   <none>         19559/TCP,19560/TCP,9559/TCP                     9d
nebula-cluster-storaged-headless     ClusterIP      None           <none>         9779/TCP,19779/TCP,19780/TCP,9778/TCP            9d
  • Below is the output of 'kubectl get pods -n graph -o wide'
nebula-cluster-graphd-0                                          1/1     Running   0          9d    10.155.48.77   aks-graphd-23670862-vmss000009     <none>           <none>
nebula-cluster-graphd-1                                          1/1     Running   0          9d    10.155.48.28   aks-graphd-23670862-vmss000007     <none>           <none>
nebula-cluster-graphd-2                                          1/1     Running   0          9d    10.155.48.43   aks-graphd-23670862-vmss000008     <none>           <none>
nebula-cluster-metad-0                                           1/1     Running   0          9d    10.155.50.12   aks-metad-24303736-vmss00000c      <none>           <none>
nebula-cluster-storaged-0                                        1/1     Running   0          9d    10.155.52.68   aks-storaged-27113300-vmss00000d   <none>           <none>
nebula-cluster-storaged-1                                        1/1     Running   0          9d    10.155.52.20   aks-storaged-27113300-vmss00000b   <none>           <none>
nebula-cluster-storaged-2                                        1/1     Running   0          9d    10.155.52.57   aks-storaged-27113300-vmss00000c   <none>           <none>

@wey-gu
Copy link
Contributor

wey-gu commented Aug 8, 2022

@porscheme

For GraphD/Graph Client, any endpoint/ip you can network-wise access is ok to be used for your clients.

For MetaD and StorageD, it's similar as we talked in vesoft-inc/nebula#4231 (for spark-connector), that is, the client access MetaD from the endpoint you gave to it, and then it dynamically fetches list of storageD endpoints and access with that, that is, it assumed the same address(that nebula graph internal network) configured in storageD's configuration.

@Sophie-Xie Sophie-Xie added the type/question Type: question about the product label Nov 30, 2022
@QingZ11
Copy link

QingZ11 commented Dec 9, 2022

We have noticed that the issue you created hasn’t been updated for nearly a month, so we have to close it for now. If you have any new updates, you are welcome to reopen this issue anytime. Thanks a lot for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/question Type: question about the product
Projects
None yet
Development

No branches or pull requests

5 participants