TuGraph Explore is strongly dependent on TuGraph, so before starting Explore, we need to start TuGraph first.
Introduction to TuGraph
TuGraph is a graph database independently developed by Ant Group, which provides graph database engine and graph analysis engine. Its main features are large data storage and computation, and it also supports efficient online transaction processing (OLTP) and Online analysis processing (OLAP).
Install TuGraph
Refer to the official documentation () for more information.
TuGraph needs to be installed via Docker Image, follow these steps to install it locally:
- install local Docker environment: referenceofficial documentation;
$ sudo docker --version
If the above command can print the docker version number successfully, it indicates that the docker environment has been installed.
- To download TuGraph images:Download TuGraph Image
Currently, TuGraph provides an image file based on Ubuntu 16.04 LTS and CenterOS 7.3. The image file is a compressed file named lgraph_x.y.z.ar, where x.y.z is the version number of TuGraph.
- Load the TuGraph image:
// lgraph_lastest.tar.gz 是 TuGraph 镜像文件名
$ docker import lgraph_lastest.tar.gz
// After the loading is complete, a message is displayed indicating that the image has been loaded
- Start Docker
$ docker run -d -v {host_data_dir}:/mnt -p 7090:7090 -it reg.docker.alibaba-inc.com/tugraph/tugraph:x.y.z
$ docker exec -it {container_id} bash
// host_data_dir = /Users/moyee/tugraph
// container_id = xxx
$ docker run -d -v /Users/moyee/tugraph:/mnt -p 7090:7090 -it reg.docker.alibaba-inc.com/tugraph/tugraph:3.1.1
$ docker exec -it xxx bash
Parameter Description
- -v volume mapping
- {host_data_dir} is a directory where the user wants to store data, such as/home/user1/workspace
- -p The function of Docker is port mapping. The example maps Docker's port 7090 to the local port 7090
- {container_id} is the container id of Docker, which can be obtained through docker ps
TuGraph operation
Start TuGraph Service
$ lgraph_server --license /mnt/fma.lic --config ~/demo/movie/lgraph.json
- fma.lic is the authorization file, should be placed in {host_data_dir} folder, mapped to the /mnt directory of docker
- lgraph.json is the configuration file for TuGraph
TuGraph Browser Query
TuGraph Browser Is a visual query tool provided by TuGraph. Users can open the browser, type {IP}:{Port}, enter the default username by 'admin', password by '73@TuGraph' to complete the login. Enter the TuGraph Query page after successful login.
Introduction to TuGraph Explore
TuGraph Explore is a GraphInsight based visual graph analysis platform that provides complete graph exploration and analysis capabilities to help users gain valuable insights from massive graph data.
Start TuGraph Explore
Once TuGraph is installed successfully, you can start installing TuGraph Explore.
- Load TuGraph Explore image:
// lgraph_lastest.tar.gz TuGraph image file name
$ docker import tugraph_explore.tar.gz
// After the loading is complete, a message is displayed indicating that the image has been loaded
- Start Docker
$ docker run -d -p 7091:7091 -it reg.docker.alibaba-inc.com/tugraph-explore:1.0.1
$ docker exec -it {container_id} bash
Parameter Description:
-p The function of Docker is port mapping. In this example, Docker port 7091 is mapped to local port 7091
{container_id} is the id of a Docker container, which can be obtained through docker ps
Start TuGraph Explore
$ cd /usr/src/tugraphexplore
$ npm run dev -- -p 7091
After the TuGraph Explore service started, it can be accessed through **http://localhost:7091/tugraph/explore.html** ,If everything is normal, you will see the following page.
Connect TuGraph
Once TuGraph Explore is up, the first step is to connect to the TuGraph database. Click the "Connect" button to bring up the page for connecting to the Graph database, as shown in the image below.
To connect to TuGraph data, we need to provide the following information:
- Graph database account
- Graph database password
- Address of the graph database: The format is ip:port
The IP address needs to be the container IP address, which can be queried by running the following command。
$ docker run -d -v /Users/xx/tugraph:/mnt -p 7090:7090 -it reg.docker.alibaba-inc.com/tugraph/tugraph:3.3.0
$ docker exec -it 8408b49033bc1698(TuGraph container) bash
$ cat /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.4 8408b543243bc69
As shown above, the address to connect the graph database should be filled in:172.17.0.4:7090。