Installation

Gorse can be setup via Docker Compose or maually.

Setup Gorse with Docker Compose

The best practice to manage Gorse nodes is using orchestration tools such as Docker Compose, etc.. There are Docker images of the master node, the server node and the worker node.

Docker ImageImage Size
gorse-master
gorse-server
gorse-worker

There is an example docker-compose.yml consists of a master node, a server node and a worker node, a Redis instance, and a MySQL instance.

  • Create a configuration file config.toml (Docker Compose version) in the working directory.
  • Setup the Gorse cluster using Docker Compose.
docker-compose up -d
  • Download the SQL file github.sql and import to the MySQL instance.
mysql -h 127.0.0.1 -u root -proot_pass gorse < github.sql
  • Restart the master node to apply imported data.
docker-compose restart

These images tagged with latest tag are built from the master branch. The tag should be fixed to a specified version in production.

Setup Gorse Manually

Binary distributions have been provided for 64-bit Windows/Linux/Mac OS on the release page. Due to the demand on large memories, 64-bit machines are highly recommended to deploy Gorse.

Gorse depends on following softwares:

SoftwareRole
Redisused to store caches.
MySQL/MongoDBused to store data.
  • Install Gorse

Option 1: Download binary distributions (Linux)

wget https://github.com/zhenghaoz/gorse/releases/latest/download/gorse_linux_amd64.zip
unzip gorse_linux_amd64.zip

For Windows and MacOS (Intel Chip or Apple Silicon), download gorse_windows_amd64.zip, gorse_darwin_amd64.zip or gorse_darwin_arm64.zip respectively.

Option 2: Build executable files via go get

go get github.com/zhenghaoz/gorse/...

Built binaries locate at $(go env GOPATH)/bin.

  • Configuration

Create a configuration file config.toml in the working directory. Set cache_store and data_store in the configuration file config.toml.

# This section declares settings for the database.
[database]

# database for caching (support Redis only)
cache_store = "redis://localhost:6379"

# database for persist data (support MySQL/MongoDB)
data_store = "mysql://root@tcp(localhost:3306)/gorse?parseTime=true"
  • Download the SQL file github.sql and import to the MySQL instance.
mysql -h 127.0.0.1 -u root gorse < github.sql
  • Start the master node
./gorse-master -c config.toml

-c specify the path of the configuration file.

  • Start the server node and worker node
./gorse-server --master-host 127.0.0.1 --master-port 8086 \
    --http-host 127.0.0.1 --http-port 8087

--master-host and --master-port are the RPC host and port of the master node. --http-host and --http-port are the HTTP host and port for RESTful APIs and metrics reporting of this server node.

./gorse-worker --master-host 127.0.0.1 --master-port 8086 \
    --http-host 127.0.0.1 --http-port 8089 -j 4

--master-host and --master-port are the RPC host and port of the master node. --http-host and --http-port are the HTTP host and port for metrics reporting of this worker node. -j is the number of working threads.

Play with Gorse:

There are HTTP entries provided by Gorse:

EntryLink
Master Dashboardhttp://127.0.0.1:8088/
Server RESTful APIhttp://127.0.0.1:8087/apidocs
Server Prometheus Metricshttp://127.0.0.1:8087/metrics
Worker Prometheus Metricshttp://127.0.0.1:8089/metrics

Master Dashboard

Server RESTful API