Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
Signed-off-by: Sijie Shen <[email protected]>
  • Loading branch information
ds-ssj committed May 17, 2024
1 parent b667a39 commit c3fb1ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 134 deletions.
137 changes: 4 additions & 133 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ GART is a graph extension that includes an interface to an RDBMS and a dynamic g
- [Features](#features)
- [Transparent Data Model Conversion](#transparent-data-model-conversion)
- [Efficient Dynamic Graph Storage](#efficient-dynamic-graph-storage)
- [Deployment](#deployment)
- [Requirements](#requirements)
- [Building](#building)
- [Service-Oriented Deployment Model](#service-oriented-deployment-model)
- [Getting Started](#getting-started)
- [Configure Data Source](#configure-data-source)
- [Configure Log Capturer](#configure-log-capturer)
- [Requirements](#requirements)
- [Run GART](#run-gart)
- [Mirco Demo: Graph Analysis on Data from MySQL](#mirco-demo-graph-analysis-on-data-from-mysql)
- [License](#license)
Expand Down Expand Up @@ -85,7 +82,7 @@ When pulled up as a service on its own, users can try out the full power of GART
At the same time, GART also provides a front-end, used as a database plug-in, currently supported as PostgreSQL extension.
Users can invoke GART's functions in the database client, such as RGMapping definitions, graph computation on the graph store, etc.

## Deployment
## Getting Started

### Requirements

Expand All @@ -97,135 +94,9 @@ Users can invoke GART's functions in the database client, such as RGMapping defi
- [Apach Kafka](https://kafka.apache.org/quickstart)
- [Debezium](https://github.com/debezium/debezium) (preferred) or [Maxwell](https://github.com/zendesk/maxwell)

### Building
```shell
git clone https://github.com/GraphScope/GART.git gart
cd gart

mkdir -p build; cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j
sudo make install
```

The dependencies can be installed by [scripts/install-deps.sh](scripts/install-deps.sh) in a proper directory.
```
cd /path/to/deps
. path/to/gart/scripts/install-deps.sh
```

To build GART by Docker, we provide a [Dockerfile](./Dockerfile):
```
docker image rm gart; docker build -t gart .
docker run -it --name gart0 gart
```

## Getting Started

### Configure Data Source

Before running GART, we need to configure the data source to capture its logs.
Currently, we have supported PostgreSQL and MySQL as the relational data source.

#### PostgreSQL
- The PostgreSQL configuration file is in the directory `/etc/postgresql/$PSQL_VERSION/main/`

- Modify the configuration file `postgresql.conf` to enable WAL as follows:
```
wal_level = logical
max_replication_slots = 1 # larger than 0
max_wal_senders = 1 # larger than 0
```
- Create a PostgreSQL user (`dbuser`) for the log capture Debezium:
```
CREATE USER dbuser WITH PASSWORD '123456';
ALTER USER dbuser REPLICATION;
ALTER USER dbuser LOGIN;
GRANT pg_read_server_files TO dbuser; -- For loading CSV files
CREATE DATABASE ldbc;
GRANT ALL ON DATABASE ldbc TO dbuser;
\c ldbc
GRANT ALL ON SCHEMA public TO dbuser;
```
- Modify the configuration file `/etc/postgresql/$PSQL_VERSION/main/pg_hba.conf` to [trust the user](https://debezium.io/documentation/reference/stable/postgres-plugins.html#:~:text=pg_hba.conf%20%2C%20configuration%20file%20parameters%20settings) `dbuser`
```
local replication dbuser trust
host replication dbuser 127.0.0.1/32 trust
host replication dbuser ::1/128 trust
```
- Finally, we restart PostgreSQL
```
sudo /etc/init.d/postgresql restart
```
#### MySQL
- MySQL configuration file `/etc/mysql/my.cnf`:
```
[mysqld]
# Prefix of the binlogs
log-bin=mysql-bin
# Binlog Format: row-based logging, only maxwell needs binlog_format=row
binlog_format=row
binlog_row_image=full
# The databases captured. GART will capture all databases if not specified.
binlog-do-db=ldbc # change the name to your database
binlog-do-db=... # change the name to your database
```
- Create a MySQL user for the log capture ([Maxwell](https://github.com/zendesk/maxwell/blob/master/docs/docs/quickstart.md) or [Debezium](https://debezium.io/documentation/reference/stable/connectors/mysql.html#mysql-creating-user)):
```
# Create a user call "dbuser" with password "123456"
# The host name part of the account name, if omitted, defaults to '%'.
CREATE USER 'dbuser'@'localhost' IDENTIFIED BY '123456';
# Grant necesarry privileges
# PrivilegesRELOAD and SHOW DATABASES are only used for Debezium
GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'dbuser'@'localhost';
# Grant privileges on the database "dbuser", only used for Maxwell
GRANT ALL ON maxwell.* TO 'dbuser'@'localhost';
```
#### User-defined Data Source
Please refer to [Usage of GART Storage](./docs/documentation/tutorials/data-source-config/storage.md).
### Configure Log Capturer
Configure Kafka (`$KAFKA_HOME/config/server.properties`) as follows:
```
delete.topic.enable=true
```
If we use Debezium as the log capture, we also need to set up a configuration of Debezium. Please replace the fields in the configuration file (`$KAFKA_HOME/config/connect-debezium-{mysql,postgresql}.properties`) that have sharp brackets (`<>`) with the actual contents (e.g., `database.user`, `database.password`).
### Run GART

You can launch GART by the `gart` script under the `build` directory, like:
```
export KAFKA_HOME=/path/to/kafka
export MAXWELL_HOME=/path/to/maxwell # if you use Maxwell as log capturer
./gart --user dbuser --password 123456
```
The arguments of `--user` and `--password` are the user name and the password in the database.
The full usage of `gart` can be shown as:
```
./gart --help
```
You can stop GART by:
```
./stop-gart
```
Please to refer our [documentation](https://graphscope.github.io/GART/documentation/getting-started/quick-start.html).

### Mirco Demo: Graph Analysis on Data from MySQL
- Topology of the demo
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/tutorials/data-source-config/mysql.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ MySQL configuration file ``/etc/mysql/my.cnf``:
# Prefix of the binlogs
log-bin=mysql-bin
# Binlog Format: row-based logging, only maxwell needs binlog_format=row
# Binlog Format: row-based logging, only Maxwell needs binlog_format=row
binlog_format=row
binlog_row_image=full
Expand Down

0 comments on commit c3fb1ef

Please sign in to comment.