vesoft-inc / nebula

A distributed, fast open-source graph database featuring horizontal scalability and high availability
https://nebula-graph.io
Apache License 2.0
10.6k stars 1.18k forks source link

connected to Nebulagraph using Docker Desktop but still getting connection refusal #5768

Open andysingal opened 9 months ago

andysingal commented 9 months ago

Connected to Nebulagraph with Docker Desktop:

Screenshot 2023-11-21 at 4 44 13 PM

further clicked on Jupyter notebook and wanted to integrate llama index with Nebulagraph: https://gpt-index.readthedocs.io/en/latest/examples/query_engine/knowledge_graph_query_engine.html#optional-build-the-knowledge-graph-with-llamaindex

graph_store = NebulaGraphStore(
    space_name=space_name,
    edge_types=edge_types,
    rel_prop_names=rel_prop_names,
    tags=tags,
)
storage_context = StorageContext.from_defaults(graph_store=graph_store)

gives error:

WARNING:nebula3.logger:Connect 127.0.0.1:9669 failed: socket error connecting to host 127.0.0.1, port 9669 (('127.0.0.1', 9669)): ConnectionRefusedError(111, 'Connection refused')
Connect 127.0.0.1:9669 failed: socket error connecting to host 127.0.0.1, port 9669 (('127.0.0.1', 9669)): ConnectionRefusedError(111, 'Connection refused')
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In [17], line 1
----> 1 graph_store = NebulaGraphStore(
      2     space_name=space_name,
      3     edge_types=edge_types,
      4     rel_prop_names=rel_prop_names,
      5     tags=tags,
      6 )
      7 storage_context = StorageContext.from_defaults(graph_store=graph_store)

File /opt/conda/lib/python3.9/site-packages/llama_index/graph_stores/nebulagraph.py:145, in NebulaGraphStore.__init__(self, session_pool, space_name, edge_types, rel_prop_names, tags, tag_prop_names, include_vid, session_pool_kwargs, **kwargs)
    143 self._session_pool: Any = session_pool
    144 if self._session_pool is None:
--> 145     self.init_session_pool()
    147 self._vid_type = self._get_vid_type()
    149 self._tags = tags or ["entity"]

File /opt/conda/lib/python3.9/site-packages/llama_index/graph_stores/nebulagraph.py:234, in NebulaGraphStore.init_session_pool(self)
    226 session_pool = SessionPool(
    227     os.environ["NEBULA_USER"],
    228     os.environ["NEBULA_PASSWORD"],
    229     self._space_name,
    230     [(graphd_host, int(graphd_port))],
    231 )
    233 seesion_pool_config = SessionPoolConfig()
--> 234 session_pool.init(seesion_pool_config)
    235 self._session_pool = session_pool
    236 return self._session_pool

File /opt/conda/lib/python3.9/site-packages/nebula3/gclient/net/SessionPool.py:103, in SessionPool.init(self, configs)
    101 ok_num = self.get_ok_servers_num()
    102 if ok_num < len(self._addresses):
--> 103     raise RuntimeError(
    104         'The services status exception: {}'.format(self._get_services_status())
    105     )
    107 # iterate all addresses and create sessions to fullfil the min_size
    108 for i in range(self._configs.min_size):

RuntimeError: The services status exception: [services: ('127.0.0.1', 9669), status: BAD]
wey-gu commented 9 months ago

could you access with studio? Click the studio and follow the get started to see how healthy it is?

Or check via the resources tab.

andysingal commented 9 months ago

I was able to access using Studio , but issue is with using local host: port, now I am getting error space -name : llamaindex does not exist

On Tue, Nov 21, 2023 at 21:08 Wey Gu @.***> wrote:

could you access with studio? Click the studio and follow the get started to see how healthy it is?

Or check via the resources tab.

— Reply to this email directly, view it on GitHub https://github.com/vesoft-inc/nebula/issues/5768#issuecomment-1821976617, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4LJNPJ2E5H76ES2V2BM7TYFVNDHAVCNFSM6AAAAAA7VIATUGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRRHE3TMNRRG4 . You are receiving this because you authored the thread.Message ID: @.***>

wey-gu commented 9 months ago

now I am getting error space -name : llamaindex does not exist

This means we could access NebulaGraph, but there is no space that we will refer to:

https://gpt-index.readthedocs.io/en/latest/examples/query_engine/knowledge_graph_query_engine.html#prepare-for-nebulagraph

# If not, create it with the following commands from NebulaGraph's console:
# CREATE SPACE llamaindex(vid_type=FIXED_STRING(256), partition_num=1, replica_factor=1);
# :sleep 10;
# USE llamaindex;
# CREATE TAG entity(name string);
# CREATE EDGE relationship(relationship string);
# :sleep 10;
# CREATE TAG INDEX entity_index ON entity(name(256));

This could be done via Studio's console.

andysingal commented 9 months ago

Thanks for your instant reply, additionally I have the following: ‘’’

%pip install nebula3-python os.environ["NEBULA_USER"] = "root"os.environ[ "NEBULA_PASSWORD"] = "" # replace with your password, by default it is "nebula"os.environ[ "NEBULA_ADDRESS"] = "127.0.0.1:9669" # assumed we have NebulaGraph 3.5.0 or newer installed locally

Assume that the graph has already been created# Create a NebulaGraph

cluster with:# Option 0: curl -fsSL nebula-up.siwei.io/install.sh | bash# Option 1: NebulaGraph Docker Extension https://hub.docker.com/extensions/weygu/nebulagraph-dd-ext# and that the graph space is called "paul_graham_essay"# If not, create it with the following commands from NebulaGraph's console:# CREATE SPACE paul_graham_essay(vid_type=FIXED_STRING(256), partition_num=1, replica_factor=1);# :sleep 10;# USE paul_graham_essay;# CREATE TAG entity(name string);# CREATE EDGE relationship(relationship string);# CREATE TAG INDEX entity_index ON entity(name(256)); space_name = "paul_graham_essay"edge_types, rel_prop_names = ["relationship"], [ "relationship"] # default, could be omit if create from an empty kgtags = ["entity"] # default, could be omit if create from an empty kg

‘’’ When I use the local host with port, it says refusal in connection, where when I user graphd and the port number I get the space name does not exist.

Sorry for the piecemeal queries , but solving this will help me run the following:

‘’’

graph_store = NebulaGraphStore( space_name=space_name, edge_types=edge_types, rel_prop_names=rel_prop_names, tags=tags,) storage_context = StorageContext.from_defaults(graph_store=graph_store)

NOTE: can take a while!index = KnowledgeGraphIndex.from_documents(

documents,
storage_context=storage_context,
max_triplets_per_chunk=2,
service_context=service_context,
space_name=space_name,
edge_types=edge_types,
rel_prop_names=rel_prop_names,
tags=tags,)

‘’’ Looking forward to hearing from you. Best, Ankush Singal

On Tue, Nov 21, 2023 at 21:28 Wey Gu @.***> wrote:

now I am getting error space -name : llamaindex does not exist

This means we could access NebulaGraph, but there is no space that we will refer to:

https://gpt-index.readthedocs.io/en/latest/examples/query_engine/knowledge_graph_query_engine.html#prepare-for-nebulagraph

If not, create it with the following commands from NebulaGraph's console:

CREATE SPACE llamaindex(vid_type=FIXED_STRING(256), partition_num=1, replica_factor=1);

:sleep 10;

USE llamaindex;

CREATE TAG entity(name string);

CREATE EDGE relationship(relationship string);

:sleep 10;

CREATE TAG INDEX entity_index ON entity(name(256));

This could be done via Studio's console.

— Reply to this email directly, view it on GitHub https://github.com/vesoft-inc/nebula/issues/5768#issuecomment-1821990853, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4LJNNURQNMS7R2QEKU6PTYFVPMLAVCNFSM6AAAAAA7VIATUGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRRHE4TAOBVGM . You are receiving this because you authored the thread.Message ID: @.***>

littlebuddha16 commented 7 months ago

I have changed the host to the machine's IP address, now I get below error message. "WARNING:nebula3.logger:Connect :9669 failed: socket error connecting to host , port 9669 (('', 9669)): TimeoutError('timed out')"

Any solution to this?

QingZ11 commented 6 months ago

I have changed the host to the machine's IP address, now I get below error message. "WARNING:nebula3.logger:Connect :9669 failed: socket error connecting to host , port 9669 (('', 9669)): TimeoutError('timed out')"

Any solution to this?

Your configuration file might have some issues. Could you please post the configurations for meta, graph, and storage?

mpourranjbar commented 4 months ago

I am encountering the same issue where the NebulaGraph Studio container can only connect to the Graphd (NebulaGraph) server when they are both within the same Docker network. Despite the containers being configured with bridge networking and having their ports exposed to the host, they remain inaccessible from outside the Docker network (Terminal or Jupyter notebook)

QingZ11 commented 4 months ago

I am encountering the same issue where the NebulaGraph Studio container can only connect to the Graphd (NebulaGraph) server when they are both within the same Docker network. Despite the containers being configured with bridge networking and having their ports exposed to the host, they remain inaccessible from outside the Docker network (Terminal or Jupyter notebook)

If you have two nebula environments installed locally, there might be a situation where both services try to occupy the default graphd port 9669. For example, you might have installed one NebulaGraph instance using Docker and another using the extension.

mpourranjbar commented 4 months ago

Thank you for the quick response. I had two separate Nebula environments installed, and I ensured they didn't interfere with each other. I've removed the Nebula Extension and am now using only the instance installed via the script.

To clarify, on the web interface (127.0.0.1:17001), users are prompted to provide the IP address, username, and password. Connecting to 127.0.0.1:9669 doesn't work, but providing graphd:9669 or 172.18.0.12:9669 (the IP address of the Graphd container) allows successful login.

QingZ11 commented 4 months ago

When connecting to NebulaGraph via the nebula-studio Web client, the IP address used for graphd must be the actual IP address, not a local address like 127.0.0.1. This information may be mentioned in NebulaGraph's documentation.

silviachen46 commented 3 months ago

What should I use for the os.environ["NEBULA_ADDRESS"] = "127.0.0.1:9669" # assumed we have NebulaGraph 3.5.0 or newer installed locally here if I'm using NebulaGraph through docker extension instead of locally?

jezieljones commented 2 months ago

What should I use for the os.environ["NEBULA_ADDRESS"] = "127.0.0.1:9669" # assumed we have NebulaGraph 3.5.0 or newer installed locally here if I'm using NebulaGraph through docker extension instead of locally?

I had a similar setup and had the question you had. Switching to installing locally was useful and made easier to walk through a lot of the examples. There's a nebula-up script that wey wrote which is really useful.