For older version SQLFlow under Linux¶
This page is for SQLFlow 5.x.x.x¶
Please refer to the latest install manual if you are using the latest SQFlow(version > 6.0.0.0):
Linux Installation
You can check this page for the SQLFlow berfore version
Old version installation
Installation Guide - Linux (YouTube)
Prerequisites¶
- SQLFlow on-premise version
- A linux server with at least 8GB memory (ubuntu 20.04 is recommended).
- Java 8
- Nginx web server.
- Port needs to be opened. (80, 8761,8081,8083. Only 80 port need to be opened if you setup the nginx reverse proxy as mentioned in the below)
Setup Environment (Ubuntu for example)¶
1 2 3 |
|
CentOS
Upload Files¶
create a directory :
1 2 |
|
upload your zip file including backend and frontend file to sqlflow
folder, and unzip like this :
1 |
|
You should get files organized like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
set folder permissions :
1 |
|
Nginx Reverse Proxy¶
1. Config Nginx
open your nginx configuration file ( at /etc/nginx/sites-available/default
under ubuntu ), add a server :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
note that 8081
in proxy_pass http://127.0.0.1:8081/
should be consistent to gspLive.jar's port.
/api
is mapped to http://127.0.0.1:8081
in the above configration. This is useful if you company doesn't allow access 8081
port from the external.
2. modify frontend configuration file config.private.json
- Open the configration file "/wings/sqlflow/frontend/config.private.json"
- Modify the ApiPrefix attribute
1 |
|
Customize the port¶
If you don't want to change the default service port you can just ignore this section. Otherwise this section will show you how to customize the port.
1. Default port¶
- Web port is
80
- SQLFlow backend service port:
File | Port |
---|---|
eureka.jar | 8761 |
gspLive.jar | 8081 |
sqlservice.jar | 8083 |
2. Modify the web port¶
Change the default web port from 80
to 9000
(or any port you like).

3. Modify java service port¶
Change the default gspLive port from 8081
to 9001
(or any port you like).
Step 1: Change the port in nginx config file

Step 2: Change the port in gspLive.sh(gspLive.bat)

Start Backend Services¶
start service in background:
1 |
|
please allow 3-5 minutes to start the service.
use ps -ef|grep java
to check those 3 processing are running.
1 2 3 |
|
Start Frontend Services¶
start your nginx :
1 |
|
or reload :
1 |
|
open http://yourdomain.com/ to see the SQLFlow.
open http://yourdomain.com/api/gspLive_backend/doc.html?lang=en to see the Restful API documention. OR
open http://yourdomain.com:8081/gspLive_backend/doc.html?lang=en to see the Restful API documention.
Gudu SQLFlow License file¶
If this is the first time you setup the Gudu SQLFlow on a new machine, then, you will see this license UI:

- You send us the Gudu SQLFlow Id (6 characters in red).
- We will generate a license file for you based on this id.
- You upload the license file by click the "upload license file" link.
Backend Services Configuration¶
sqlflow provides several optioins to control the service analysis logic. Open the sqlservice configuration file(conf/gudu_sqlflow.conf)
- relation_limit: default value is 1000. When the count of selected object relations is greater than relation_limit, sqlflow will fallback to the simple mode, ignore all the record sets. If the relations of simple mode are still greater than relation_limit, sqlflow will only show the summary information.
- big_sql_size: default value is 4096. If the sql length is greater than big_sql_size, sqlflow submit the sql in the work queue and execute it. If the work queue is full, sqlflow throws an exception and return error message "Sorry, the service is busy. Please try again later."
Sqlflow client api call¶
-
Get userId from gudu_sqlflow.conf
-
Open the configration file "/wings/sqlflow/backend/conf/gudu_sqlflow.conf"
- The value of anonymous_user_id field is webapi userId
1 |
|
-
Note: on-promise mode, webapi call doesn't need the token parameter
-
Test webapi by curl
- test sql:
1
select name from user
- curl command:
1
curl -X POST "http://yourdomain.com/api/gspLive_backend/sqlflow/generation/sqlflow" -H "accept:application/json;charset=utf-8" -F "userId=YOUR USER ID HERE" -F "dbvendor=dbvoracle" -F "sqltext=select name from user"
- response:
1 2 3 4 5 6 7 8 9 10 11 12 13
{ "code": 200, "data": { "dbvendor": "dbvoracle", "dbobjs": [ ... ], "relations": [ ... ] }, "sessionId": ... }
- If the code returns 401, please check the userId is set or the userId is valid.
Enable Regular Job¶
If you need to enable regular job feature on your sqlflow on-premiser, you will also need to install Clickhouse on your server. Check here for Clickhouse installation:
Clickhouse Installation