Skip to content

Commit a89bb5d

Browse files
authored
Merge pull request #195 from json-scada/master
Install script for Ubuntu 24.04, improvements to other install scripts.
2 parents 0f729ef + b8598c2 commit a89bb5d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+6093
-1278
lines changed

docs/install.md

+31
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ Execute commands below for scripted installation:
8181
sudo passwd jsonscada
8282
sudo su - jsonscada
8383

84+
# if necessary, add the below line to the end of the file /etc/sudoers.
85+
jsonscada ALL=(ALL) ALL # Change the user name before you issue the commands
86+
8487
# next, clone the json-scada repo
8588

8689
sudo dnf -y install git
@@ -97,6 +100,34 @@ Execute commands below for scripted installation:
97100
# to compile and install Inkscape+SAGE, run the following command:
98101
sudo sh ./inkscape-plus-sage.sh
99102

103+
## Ubuntu 24.04, scripted installation
104+
105+
Execute commands below for scripted installation:
106+
107+
# firstly create a user named "jsonscada" that can do "sudo". Login as "jsonscada".
108+
109+
sudo adduser jsonscada
110+
sudo usermod -aG wheel jsonscada
111+
sudo usermod -aG docker jsonscada
112+
sudo passwd jsonscada
113+
sudo su - jsonscada
114+
115+
# if necessary, add the below line to the end of the file /etc/sudoers.
116+
jsonscada ALL=(ALL) ALL # Change the user name before you issue the commands
117+
118+
# next, clone the json-scada repo
119+
120+
sudo dnf -y install git
121+
cd /home/jsonscada
122+
git clone https://github.com/riclolsen/json-scada --config core.autocrlf=input
123+
cd json-scada/platform-ubuntu-2404
124+
125+
# on x86-64 or ARM64 platform run
126+
sudo sh ./json-scada-install.sh
127+
128+
# to compile and install Inkscape+SAGE, run the following command:
129+
sudo sh ./inkscape-plus-sage.sh
130+
100131
## Manual Installation
101132

102133
To install JSON-SCADA manually, it is required to install all the requirements first. There is no point reproducing original installation instructions for each upstream project. Here are links and relevant information specific to JSON-SCADA.

platform-linux/export_project.sh

+8-6
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ MONGOBIN=/usr/bin
88
JAVAPATH=/usr/bin
99
TARPATH=/usr/bin
1010
SVGPATH=$JSPATH/svg
11-
mongoConnectionString=mongodb://127.0.0.1/json_scada?tls=false&directConnection=true
12-
database=json_scada
13-
1411
# read JSON config file
12+
mongoConnectionString=$(jq -r '.mongoConnectionString' $JSPATH/conf/json-scada.json)
13+
database=$(jq -r '.mongoDatabaseName' $JSPATH/conf/json-scada.json)
14+
1515

1616
mkdir -c $TMPPATH
1717
rm -rf $TMPPATH/*.*
@@ -28,9 +28,11 @@ mongoexport.exe --uri "$mongoConnectionString" --db $database --collection roles
2828
# mongoexport.exe --uri "$mongoConnectionString" --db $database --collection soeData --out $TMPPATH\soeData.json
2929
# mongoexport.exe --uri "$mongoConnectionString" --db $database --collection userActions --out $TMPPATH\userActions.json
3030

31-
copy %SVGPATH%\*.svg %TMPPATH%\
32-
copy %SVGPATH%\screen_list.js %TMPPATH%\
31+
copy %SVGPATH%/*.svg %TMPPATH%/
32+
copy %SVGPATH%/screen_list.js %TMPPATH%/
3333
# optional
34-
# copy %JSPATH%\conf\*.* %TMPPATH%\
34+
# copy %JSPATH%\conf/*.* %TMPPATH%/
3535

3636
# zip files
37+
cd %TMPPATH%
38+
tar -a -c -f %TMPPATH%/jsproject.zip -C %TMPPATH% *.json *.js *.svg

platform-linux/import_project.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ MONGOBIN=/usr/bin
88
JAVAPATH=/usr/bin
99
TARPATH=/usr/bin
1010
SVGPATH=$JSPATH/svg
11-
mongoConnectionString=mongodb://127.0.0.1/json_scada?tls=false&directConnection=true
12-
database=json_scada
11+
# read JSON config file
12+
mongoConnectionString=$(jq -r '.mongoConnectionString' $JSPATH/conf/json-scada.json)
13+
database=$(jq -r '.mongoDatabaseName' $JSPATH/conf/json-scada.json)
1314
FLAGS=--mode=upsert
1415

1516
# read JSON config file

platform-nix-idx/mongod.conf

+5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ processManagement:
33
net:
44
bindIp: 127.0.0.1
55
port: 27017
6+
# Where and how to store data. Add more memory if you have more than 4GB of RAM.
67
storage:
78
dbPath: "/home/user/mongodb/var/lib/mongo"
9+
wiredTiger:
10+
engineConfig:
11+
cacheSizeGB: 1
12+
813
systemLog:
914
destination: file
1015
path: "/home/user/mongodb/var/log/mongodb/mongod.log"

platform-nix-idx/supervisord.conf

+41-25
Original file line numberDiff line numberDiff line change
@@ -205,28 +205,44 @@ stdout_logfile_maxbytes=10MB ; max # logfile bytes b4 rotation (default 50MB)
205205
stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10)
206206
stdout_capture_maxbytes=10MB ; number of bytes in 'capturemode' (default 0)
207207

208-
[program:mongowr]
209-
; args: instance# loglevel
210-
command=/usr/bin/node /home/user/json-scada/src/mongowr/index.js
211-
autostart=false
212-
numprocs=1 ; number of processes copies to start (def 1)
213-
directory=/home/user/json-scada/src/mongowr/ ; directory to cwd to before exec (def no cwd)
214-
user=user ; setuid to this UNIX account to run the program
215-
redirect_stderr=true ; redirect proc stderr to stdout (default false)
216-
stdout_logfile=/home/user/json-scada/log/mongowr.log ; stdout log path, NONE for none; default AUTO
217-
stdout_logfile_maxbytes=10MB ; max # logfile bytes b4 rotation (default 50MB)
218-
stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10)
219-
stdout_capture_maxbytes=10MB ; number of bytes in 'capturemode' (default 0)
220-
221-
[program:mongofw]
222-
; args: instance# loglevel
223-
command=/usr/bin/node /home/user/json-scada/src/mongofw/index.js
224-
autostart=false
225-
numprocs=1 ; number of processes copies to start (def 1)
226-
directory=/home/user/json-scada/src/mongofw/ ; directory to cwd to before exec (def no cwd)
227-
user=user ; setuid to this UNIX account to run the program
228-
redirect_stderr=true ; redirect proc stderr to stdout (default false)
229-
stdout_logfile=/home/user/json-scada/log/mongofw.log ; stdout log path, NONE for none; default AUTO
230-
stdout_logfile_maxbytes=10MB ; max # logfile bytes b4 rotation (default 50MB)
231-
stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10)
232-
stdout_capture_maxbytes=10MB ; number of bytes in 'capturemode' (default 0)
208+
;[program:mongowr]
209+
;; args: instance# loglevel
210+
;command=/usr/bin/node /home/user/json-scada/src/mongowr/index.js
211+
;autostart=false
212+
;numprocs=1 ; number of processes copies to start (def 1)
213+
;directory=/home/user/json-scada/src/mongowr/ ; directory to cwd to before exec (def no cwd)
214+
;user=user ; setuid to this UNIX account to run the program
215+
;redirect_stderr=true ; redirect proc stderr to stdout (default false)
216+
;stdout_logfile=/home/user/json-scada/log/mongowr.log ; stdout log path, NONE for none; default AUTO
217+
;stdout_logfile_maxbytes=10MB ; max # logfile bytes b4 rotation (default 50MB)
218+
;stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10)
219+
;stdout_capture_maxbytes=10MB ; number of bytes in 'capturemode' (default 0)
220+
221+
;[program:mongofw]
222+
;; args: instance# loglevel
223+
;command=/usr/bin/node /home/user/json-scada/src/mongofw/index.js
224+
;autostart=false
225+
;numprocs=1 ; number of processes copies to start (def 1)
226+
;directory=/home/user/json-scada/src/mongofw/ ; directory to cwd to before exec (def no cwd)
227+
;user=user ; setuid to this UNIX account to run the program
228+
;redirect_stderr=true ; redirect proc stderr to stdout (default false)
229+
;stdout_logfile=/home/user/json-scada/log/mongofw.log ; stdout log path, NONE for none; default AUTO
230+
;stdout_logfile_maxbytes=10MB ; max # logfile bytes b4 rotation (default 50MB)
231+
;stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10)
232+
;stdout_capture_maxbytes=10MB ; number of bytes in 'capturemode' (default 0)
233+
234+
;[program:metabase]
235+
;command=/usr/bin/java -jar /home/user/json-scada/metabase/metabase.jar
236+
;;process_name=%(program_name)s ; process_name expr (default %(program_name)s)
237+
;numprocs=1 ; number of processes copies to start (def 1)
238+
;environment=MB_JETTY_PORT="3001",MB_DB_TYPE="postgres",MB_DB_DBNAME="metabaseappdb",MB_DB_PORT="5432",MB_DB_USER="postgres",MB_DB_PASS="",MB_DB_HOST="localhost",MB_CHECK_FOR_UPDATES="false"
239+
;directory=/home/user/json-scada/metabase/ ; directory to cwd to before exec (def no cwd)
240+
;user=user ; setuid to this UNIX account to run the program
241+
;stdout_logfile=/home/user/json-scada/log/metabase.log ; stdout log path, NONE for none;
242+
;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
243+
;stdout_logfile_backups=0 ; # of stdout logfile backups (0 means none, default 10)
244+
;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0)
245+
;stderr_logfile=/home/user/json-scada/log/metabase.err ; stderr log path, NONE for none;
246+
;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
247+
;stderr_logfile_backups=0 ; # of stderr logfile backups (0 means none, default 10)
248+
;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0)

platform-rhel9/json-scada-install-aarch64.sh

+16-15
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ sudo dnf remove -y python3-circuitbreaker
3939

4040
sudo update-crypto-policies --set LEGACY
4141

42-
wget --inet4-only https://go.dev/dl/go1.22.3.linux-arm64.tar.gz
43-
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.3.linux-arm64.tar.gz
42+
wget --inet4-only https://go.dev/dl/go1.23.4.linux-arm64.tar.gz
43+
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.23.4.linux-arm64.tar.gz
4444
sudo -u $JS_USERNAME sh -c 'export PATH=$PATH:/usr/local/go/bin'
4545
sudo -u $JS_USERNAME sh -c 'echo "export PATH=\$PATH:/usr/local/go/bin" >> ~/.bashrc'
46+
source ~/.bashrc
4647

4748
# for mongodb
4849
# https://www.mongodb.com/docs/manual/tutorial/transparent-huge-pages/
@@ -105,18 +106,18 @@ EOL
105106
sudo dnf -y update
106107
sudo dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-$(rpm -E %{rhel})-$(arch)/pgdg-redhat-repo-latest.noarch.rpm
107108
sudo cp /etc/yum.repos.d/pgdg-redhat-all.repo.rpmnew /etc/yum.repos.d/pgdg-redhat-all.repo
108-
sudo dnf -y --enablerepo=pgdg16 update
109+
sudo dnf -y --enablerepo=pgdg17 update
109110
curl -s https://packagecloud.io/install/repositories/timescale/timescaledb/script.rpm.sh | sudo bash
110-
sudo dnf -y install timescaledb_16 postgresql16 postgresql16-contrib
111-
sudo dnf -y install timescaledb-toolkit-postgresql-16
112-
# sudo timescaledb-tune -yes --pg-config=/usr/pgsql-16/bin/pg_config
111+
sudo dnf -y install timescaledb_17 postgresql17 postgresql17-contrib
112+
sudo dnf -y install timescaledb-toolkit-postgresql-17
113+
# sudo timescaledb-tune -yes --pg-config=/usr/pgsql-17/bin/pg_config
113114
# config postgresql local connections with trust method
114-
sudo cp pg_hba.conf /var/lib/pgsql/16/data/
115-
sudo chown postgres:postgres /var/lib/pgsql/16/data/pg_hba.conf
116-
sudo cp postgresql.conf /var/lib/pgsql/16/data/
117-
sudo chown postgres:postgres /var/lib/pgsql/16/data/postgresql.conf
118-
sudo systemctl enable postgresql-16
119-
sudo /usr/pgsql-16/bin/postgresql-16-setup initdb
115+
sudo cp pg_hba.conf /var/lib/pgsql/17/data/
116+
sudo chown postgres:postgres /var/lib/pgsql/17/data/pg_hba.conf
117+
sudo cp postgresql.conf /var/lib/pgsql/17/data/
118+
sudo chown postgres:postgres /var/lib/pgsql/17/data/postgresql.conf
119+
sudo systemctl enable postgresql-17
120+
sudo /usr/pgsql-17/bin/postgresql-17-setup initdb
120121

121122
sudo cp json_scada_*.conf /etc/nginx/conf.d/
122123
sudo cp nginx.conf /etc/nginx/
@@ -143,14 +144,14 @@ sudo cp grafana.ini /etc/grafana
143144
sudo systemctl enable grafana-server
144145

145146
sudo -u $JS_USERNAME sh -c 'mkdir ../metabase'
146-
sudo -u $JS_USERNAME sh -c 'wget --inet4-only https://downloads.metabase.com/v0.49.10/metabase.jar -O ../metabase/metabase.jar'
147+
sudo -u $JS_USERNAME sh -c 'wget --inet4-only https://downloads.metabase.com/v0.52.5/metabase.jar -O ../metabase/metabase.jar'
147148

148-
sudo -u $JS_USERNAME sh -c 'curl -fsSL https://rpm.nodesource.com/setup_20.x -o nodesource_setup.sh'
149+
sudo -u $JS_USERNAME sh -c 'curl -fsSL https://rpm.nodesource.com/setup_22.x -o nodesource_setup.sh'
149150
sudo bash nodesource_setup.sh
150151
sudo dnf -y install nodejs
151152

152153
sudo systemctl daemon-reload
153-
sudo systemctl start postgresql-16
154+
sudo systemctl start postgresql-17
154155
sudo systemctl start mongod
155156

156157
psql -U postgres -w -h localhost -f ../sql/create_tables.sql template1

platform-rhel9/json-scada-install.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@ sudo dnf -y install ./potrace-devel-1.16-7.el9.$(arch).rpm
4747

4848
sudo update-crypto-policies --set LEGACY
4949

50-
wget --inet4-only https://go.dev/dl/go1.22.3.linux-amd64.tar.gz
51-
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.3.linux-amd64.tar.gz
50+
wget --inet4-only https://go.dev/dl/go1.23.4.linux-amd64.tar.gz
51+
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.23.4.linux-amd64.tar.gz
5252
sudo -u $JS_USERNAME sh -c 'export PATH=$PATH:/usr/local/go/bin'
5353
sudo -u $JS_USERNAME sh -c 'echo "export PATH=\$PATH:/usr/local/go/bin" >> ~/.bashrc'
54+
source ~/.bashrc
5455

5556
# for mongodb
5657
# https://www.mongodb.com/docs/manual/tutorial/transparent-huge-pages/
@@ -148,9 +149,9 @@ sudo cp grafana.ini /etc/grafana
148149
sudo systemctl enable grafana-server
149150

150151
sudo -u $JS_USERNAME sh -c 'mkdir ../metabase'
151-
sudo -u $JS_USERNAME sh -c 'wget --inet4-only https://downloads.metabase.com/v0.49.10/metabase.jar -O ../metabase/metabase.jar'
152+
sudo -u $JS_USERNAME sh -c 'wget --inet4-only https://downloads.metabase.com/v0.52.5/metabase.jar -O ../metabase/metabase.jar'
152153

153-
sudo -u $JS_USERNAME sh -c 'curl -fsSL https://rpm.nodesource.com/setup_20.x -o nodesource_setup.sh'
154+
sudo -u $JS_USERNAME sh -c 'curl -fsSL https://rpm.nodesource.com/setup_22.x -o nodesource_setup.sh'
154155
sudo bash nodesource_setup.sh
155156
sudo dnf -y install nodejs
156157

platform-rhel9/mongod.conf

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
systemLog:
88
destination: syslog
99

10-
# Where and how to store data.
10+
# Where and how to store data. Add more memory if you have more than 4GB of RAM.
1111
storage:
1212
dbPath: /var/lib/mongo
13+
wiredTiger:
14+
engineConfig:
15+
cacheSizeGB: 1
1316

1417
# how the process runs
1518
processManagement:

0 commit comments

Comments
 (0)