Binary Deployment
About 2 min
Binary Deployment
For single node deployment, the gorse-in-one single binary can be used.
Note
For the multi-node scenario, binary deployment is not recommended.
Prerequisites
Gorse depends on the following software:
- Cache storage database, one of MySQL, PostgreSQL, MongoDB or Redis.
- Data storage database, one of MySQL, PostgreSQL, ClickHouse or MongoDB.
The minimal versions of dependent software are as follows:
Software | Minimal Version | Compatible Product |
---|---|---|
Redis | 5.0 | |
MySQL | 5.7 | MariaDB >= 10.2 |
PostgresSQL | 10.0 | |
ClickHouse | 21.10 | |
MongoDB | 4.0 |
Run Gorse-in-one
- Download Gorse-in-one from GitHub Release.
# For amd64 CPU:
wget -O gorse.zip https://github.com/gorse-io/gorse/releases/latest/download/gorse_linux_amd64.zip
# For arm64 CPU:
wget -O gorse.zip https://github.com/gorse-io/gorse/releases/latest/download/gorse_linux_arm64.zip
# For amd64 CPU:
wget -O gorse.zip https://github.com/gorse-io/gorse/releases/latest/download/gorse_darwin_amd64.zip
# For arm64 CPU:
wget -O gorse.zip https://github.com/gorse-io/gorse/releases/latest/download/gorse_darwin_arm64.zip
# For amd64 CPU:
Invoke-WebRequest https://github.com/gorse-io/gorse/releases/latest/download/gorse_windows_amd64.zip -OutFile gorse.zip
# For arm64 CPU:
Invoke-WebRequest https://github.com/gorse-io/gorse/releases/latest/download/gorse_windows_arm64.zip -OutFile gorse.zip
- Install Gorse-in-one.
sudo unzip gorse.zip -d /usr/local/bin
sudo unzip gorse.zip -d /usr/local/bin
# Create install directory
New-Item -Type Directory -Path $env:ProgramFiles/Gorse/bin
# Extract binaries
Expand-Archive gorse.zip -DestinationPath $env:ProgramFiles/Gorse/bin
Create a configuration file
config.toml
based on the configuration template.Run Gorse-in-one.
gorse-in-one -c config.toml
gorse-in-one -c config.toml
& $env:ProgramFiles/Gorse/bin/gorse-in-one -c config.toml
Flags of Gorse-in-one
There are command line flags for Gorse-in-one:
Flag | Default Value | Description | |
---|---|---|---|
-c | -c,--config | Configuration file path. | |
--debug | Debug log mode. | ||
-h | --help | Help for gorse-in-one. | |
--log-path | Path of log file. | ||
--log-max-size | Maximum size in megabytes of the log file. | ||
--log-max-age | Maximum number of days to retain old log files. | ||
--log-max-backups | Maximum number of old log files to retain. | ||
--master-cache-path | master_cache.data | Master node cache path. | |
--playground | Playground mode. | ||
-v | --version | Gorse version. | |
--worker-cache-path | worker_cache.data | Worker node cache path. | |
--worker-jobs | 1 | Worker node working jobs. |
Setup Systemd (Linux)
- Create directories for the log file and the cache file.
sudo mkdir -p /etc/gorse/
sudo mkdir -p /var/log/gorse/
sudo mkdir -p /var/lib/gorse/
- Copy the configuration file to
/etc/gorse
:
sudo mv config.toml /etc/gorse/
- Create the systemd configuration file at
/etc/systemd/system/gorse.service
:
[Unit]
Description=Gorse, an open source recommender system service written in Go.
After=network.target
[Service]
Type=simple
Restart=always
ExecStart=/usr/local/bin/gorse-in-one -c /etc/gorse/config.toml \
--log-path /var/log/gorse/gorse.log \
--cache-path /var/lib/gorse/gorse.data
[Install]
WantedBy=multi-user.target
- After that you're supposed to reload systemd:
sudo systemctl daemon-reload
- Launch Gorse-in-one on system startup with:
sudo systemctl enable gorse
- Launch Gorse-in-one immediately with:
sudo systemctl start gorse
- Check the health and logs of Gorse-in-one with:
systemctl status gorse
Setup Service (Windows)
Note
Gorse service on Windows requires NSSM installed.
- Create directories for the log file and the cache file.
New-Item -Type Directory -Path $env:ProgramFiles/Gorse/log
New-Item -Type Directory -Path $env:ProgramFiles/Gorse/data
- Copy the configuration file to
C:/Program Files/Gorse/bin
:
Move-Item config.toml -Destination $env:ProgramFiles/Gorse/bin
- Create service using NSSM.
nssm install Gorse $env:ProgramFiles\Gorse\bin\gorse-in-one.exe
nssm set Gorse AppParameters -c bin\config.toml --cache-path data\gorse.data
nssm set Gorse AppDirectory $env:ProgramFiles\Gorse
nssm set Gorse AppStdout $env:ProgramFiles\Gorse\log\gorse.log
nssm set Gorse AppStderr $env:ProgramFiles\Gorse\log\gorse.log
nssm start Gorse