Skip to main content

Deploy Engine Server service

Clone the Project Repository

First, use Git to clone the Engine Server codebase to your machine

git clone https://github.com/glitternetwork/engine-server
cd engine-server

Install Go dependencies

Engine Server uses Go Modules to manage dependencies. First, make sure you are in the project root directory, and then run the following command to install dependencies:

go mod tidy

Modify the configuration file

Currently we support 3 data sources: bleve, mysql, milvus, for the data source part, please see datasource, you need to configure your data source connection information in the configuration file so that Engine Server can access your data; we provide a configuration example file: /etc/app.example.toml, you can copy this file, and then modify the database configuration item according to your situation

cp etc/app.example.toml etc/app.toml
vim etc/app.toml

Running the Application

Build and run the binary

cd cmd
go build -o engine-server .
cd ..
./cmd/engine-server -config_path=./etc/engine-server/config.toml run

You can also manage engine-server through systemd, create a configuration file /etc/systemd/system/engine-server.service, add the following configuration, then use systemctl start engine-server to start the service

[Unit]
Description=engine server
Requires=network-online.target
After=network-online.target

[Service]
Restart=on-failure
User=root
Group=root
PermissionsStartOnly=true
WorkingDirectory=/root/engine-server
ExecStart=/root/engine-server/cmd/engine-server run
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGTERM
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=engine-server.log
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target