Overview

  • This guide describes the installation steps for the SQream SQL Editor.

  • SQream SQL Editor is a web-based database editor for the SQream database and currently supports the Chrome browser only.

  • Operation System must be Centos 7.3 or Ubuntu 16.04.

1. Prerequisites

1.1. Install Node.js

Node.js is an open source server framework. It allows you to run JavaScript on the server.

1.1.1. Centos 7.3

If your PC has internet access you can install it directly from there (Option 1). If your PC doesn’t have internet access you have to first download it and then install it (Option 2).

Option 1 - with Internet access

If your PC has internet access perform the following:

curl -sL https://rpm.nodesource.com/setup_8.x | sudo bash -
sudo yum install -y nodejs
Option 2 – no Internet access

Download the latest version of node.js and then copy it onto the machine you want to install the Editor.

Install:

tar xzvf node-v8.9.3.tar.gz && cd node-v8.9.3
./configure
make
sudo make install
Verify Node 8.x is installed
node --version

In case you still have a lower version of node installed make sure to completely uninstall and install node 8.x.

1.1.2. Ubuntu 16.04

Install Node 8.x
cd ~
curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get install -y nodejs
Verify Node 8.x is installed
node --version

In case you still have a lower version of node installed make sure to completely uninstall and install node 8.x.

1.2. Install PM2 - Node Daemon Manager

1.2.1. Centos 7.3

Install the Node Daemon Manager for centos 7.3:

sudo yum update openssl
sudo npm install pm2 -g

1.2.2. Ubuntu 16.04

Install the Node Daemon Manager for ubuntu 16.04:

sudo apt-get upgrade openssl
sudo npm install pm2 -g

1.3. Disable the Firewall

If the SQream SQL Editor is installed on another machine than the SQream server, you must ensure that no firewall is configured. To check and disable the fireball configuration run:

sudo systemctl status firewalld
sudo systemctl stop firewalld
sudo systemctl disable firewalld

2. Deployment Steps

2.1. Install the SQL Editor application

From this step onward, use the sqream user on your system:

su - sqream
cd ~

Copy the application tar file to the folder you would like to install the SQream SQL Editor to. Typically, this would be /home/sqream

Untar (extract) the package into the user home directory. This opens the application into the sqream_editor directory. Typically, this would be /home/sqream/sqream_editor

For example:

tar -xvf sqream_editor_v1.1.0.tar.gz

2.2. Copy the SQL Editor configuration file

The editor configuration file is part of the installation package. Location: ~sqream_editor/config/default/uiEditorConfig.json

Copy the uiEditorConfig.json file into the /etc/sqream directory. This is the folder where typically all SQream related configuration files are stored.

For example:

sudo cp ~/sqream_editor/config/default/uiEditorConfig.json /etc/sqream/

2.3. Setup the SQL Editor configuration file

Edit the uiEditorConfig.json and configure the following setting to match your local system:

  • disabledSetSessionTag - If this flag is set to true, internal DB statements performed by the SQL Editor are not written to the statement log of the SQream server.

  • remoteLoginAvail - Allows remote login of SQL Editor to SQream DB. If set to false, the SQL Editor can logon to a local SQream DB only (SQream DB and SQL Editor on same machine). If true, the SQL Editor performs logon to a dedicated SQream server (remote), using the host, port and cluster configuration parameters of the file.

  • treeCatalogDisplay - possible values: “everybody” or “nobody”. Allows to display or hide the System Views (sqream_catalog) from the left tree.

3. Test the installation

After the installation, test the SQL Editor application by starting it manually:

NODE_ENV=production node ~/sqream_editor/server.js

Using Chrome browse to:

http://{server_ip}:3000

Make sure the logon screen appears and you can log on to the editor application using user sqream, password sqream (this is the built-in user for the SQream DB).

4. Start or stop the SQL Editor application as a service

To start the node server as a service run the following command:

NODE_ENV=production pm2 start ~/sqream_editor/server.js --name sqream_editor

To stop the node server run the following command:

NODE_ENV=production pm2 stop ~/sqream_editor/server.js --name sqream_editor

5. Add the Node Daemon Manager (PM2) to the startup script after boot

To setup the startup script for the Node Daemon Manager, run the following command:

pm2 startup

Then copy the received command line and run it.

For example:

sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u sqream --hp /home/sqream

To remove from startup :

pm2 unstartup

6. Upgrade Instructions

6.1. Stop the SQL Editor application

To stop the node server run the following command:

NODE_ENV=production pm2 stop ~/sqream_editor/server.js --name sqream_editor

6.2. Remove the current sqream_editor folder

To remove the sqream_editor folder run the following command:

rm -r /home/sqream/sqream_editor

6.3. Untar (extract) the package into the user home directory.

This opens the application into the sqream_editor directory. Typically, this would be /home/sqream/sqream_editor

For example:

tar -xvf sqream_editor_v1.1.0.tar.gz

6.4. Start the new SQL Editor application

To start the node server run the following command:

NODE_ENV=production pm2 start ~/sqream_editor/server.js --name sqream_editor

6.5. Test the new SQL Editor application

Using Chrome browse to:

http://{server_ip}:3000

Make sure you can log on to the editor application using user sqream, password sqream (this is the built-in user for the SQream DB).

Copyright © 2010-2018. All rights reserved.

This document is provided for information purposes only and the contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchant- ability or fitness for a particular purpose.

We specifically disclaim any liability with respect to this document and no contractual obligations are formed either directly or indirectly by this document.

This document may not be reproduced in any form, for any purpose, without our prior written permission.