ShinobiCE/Installation
(→Requirements) |
|||
(16 intermediate revisions by one user not shown) | |||
Line 4: | Line 4: | ||
=Ubuntu 20.04= | =Ubuntu 20.04= | ||
+ | '''UPDATE:''' I had a lot of issues installing Shinobi on Ubuntu, part of which was the installation scripts, but the other part was just Ubuntu issues with my TrueNAS iSCSI connection to ESXi 6. Ubuntu was not happy with the iSCSI and had alot of read/write errors to SDA, causing massive stability problems. I ended up abandoning Ubuntu and using CentOS 7 and is always works flawlessly with my TrueNAS iSCSI to ESXi 6. | ||
==Requirements== | ==Requirements== | ||
[https://shinobi.video/estimate estimate]<br> | [https://shinobi.video/estimate estimate]<br> | ||
Line 33: | Line 34: | ||
<nowiki>~$ cd /opt/Shinobi | <nowiki>~$ cd /opt/Shinobi | ||
~$ chmod +x INSTALL/ubuntu.sh && INSTALL/ubuntu.sh</nowiki> | ~$ chmod +x INSTALL/ubuntu.sh && INSTALL/ubuntu.sh</nowiki> | ||
+ | Update pm2 so there are no autostart issues with the pm2-root service. | ||
+ | <nowiki>~$ pm2 unstartup | ||
+ | ~$ npm install pm2@latest -g | ||
+ | ~$ pm2 startup</nowiki> | ||
+ | |||
==Troubleshooting== | ==Troubleshooting== | ||
Verify services are running.<br> | Verify services are running.<br> | ||
;MariaDB | ;MariaDB | ||
<nowiki>~$ systemctl status mariadb.service</nowiki> | <nowiki>~$ systemctl status mariadb.service</nowiki> | ||
+ | ;NodeJS | ||
+ | <nowiki>~$ systemctl status pm2-root.service | ||
+ | |||
+ | ~$ sudo pm2 list | ||
+ | ... | ||
+ | ┌──────────┬────┬──────┬──────┬────────┬─────────┬────────┬──────┬───────────┬──────┬──────────┐ | ||
+ | │ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │ | ||
+ | ├──────────┼────┼──────┼──────┼────────┼─────────┼────────┼──────┼───────────┼──────┼──────────┤ | ||
+ | │ camera │ 0 │ fork │ 5821 │ online │ 0 │ 55s │ 0.5% │ 99.3 MB │ root │ disabled │ | ||
+ | │ cron │ 1 │ fork │ 5932 │ online │ 0 │ 41s │ 0.2% │ 50.2 MB │ root │ disabled │ | ||
+ | └──────────┴────┴──────┴──────┴────────┴─────────┴────────┴──────┴───────────┴──────┴──────────┘</nowiki> | ||
+ | <br> | ||
+ | Remove and re-add nodeJS services to PM2 for auto start on boot.<br>It is '''CRITICAL''' that you start the JS processes from within the directory they live. Unfortunately the JS processes rely on other dependencies that are called from the relative directory you are launching them from, not the folder the JS file lives in. | ||
+ | <nowiki>~$ cd /opt/Shinobi | ||
+ | ~$ sudo pm2 start /opt/Shinobi/camera.js | ||
+ | ~$ sudo pm2 start /opt/Shinobi/cron.js | ||
+ | ~$ sudo pm2 startup | ||
+ | ~$ sudo pm2 save</nowiki> | ||
+ | |||
+ | |||
+ | =CentOS7= | ||
+ | ==Requirements== | ||
+ | [https://shinobi.video/estimate estimate]<br> | ||
+ | Base Installation w/o cameras | ||
+ | * CPU - 2 core opteron 6380 @ 2.5GHZ | ||
+ | * RAM - 1024 GB | ||
+ | |||
+ | Each additional 5MP IP camera @ 30FPS 5000 bitrate (full resolution) with motion detection and recording | ||
+ | * CPU .5 core opteron 6380 @ 2.5GHZ | ||
+ | * RAM - 500 GB | ||
+ | * 72 GB per day. | ||
+ | |||
+ | These estimates are based on testing I did with a single camera vs with 3 cameras after bumping the system specs a little.<br> | ||
+ | 1 camera | ||
+ | * CPU 2 core @ 2.5GHZ = 90% utilization | ||
+ | * RAM 2GB = 50% utilization | ||
+ | 3 cameras | ||
+ | * CPU 4 core @ 2.5GHZ = 60% utilization | ||
+ | * RAM 4GB = 50% utilization | ||
+ | |||
+ | ==Installation== | ||
+ | Installation needs to be done as root | ||
+ | <nowiki>~$ sudo su</nowiki> | ||
+ | ===Dependencies=== | ||
+ | <nowiki>~$ yum update -y | ||
+ | ~$ yum install -y epel-release | ||
+ | ~$ yum update -y | ||
+ | ~$ yum install -y curl wget net-tools git vim gcc gcc-c++ cmake make zip dos2unix</nowiki> | ||
+ | NodeJS | ||
+ | <nowiki>~$ curl --silent --location https://rpm.nodesource.com/setup_12.x | bash - | ||
+ | ~$ yum install -y nodejs npm</nowiki> | ||
+ | |||
+ | ===Clone Project=== | ||
+ | Place the project in the <code>opt</code> directory | ||
+ | <nowiki>~$ cd /opt/ | ||
+ | ~$ git clone https://gitlab.com/Shinobi-Systems/Shinobi.git Shinobi</nowiki> | ||
+ | ===Install Shinobi=== | ||
+ | <nowiki>~$ cd /opt/Shinobi | ||
+ | ~$ chmod +x ./INSTALL/centos.sh && ./INSTALL/centos.sh</nowiki> | ||
+ | ===Open port on firewalld=== | ||
+ | <nowiki>~$ firewall-cmd --zone=public --add-port=8080/tcp --permanent | ||
+ | ~$ firewall-cmd --reload</nowiki> | ||
+ | ===Verify pm2-root.service is running=== | ||
+ | <nowiki>~$ systemctl status pm2-root.service | ||
+ | ~$ systemctl start pm2-root.service</nowiki> |
Latest revision as of 00:37, 26 April 2022
Installation
Contents |
[edit] Overview
Node.JS Zoneminder CCTV alternative
[edit] Ubuntu 20.04
UPDATE: I had a lot of issues installing Shinobi on Ubuntu, part of which was the installation scripts, but the other part was just Ubuntu issues with my TrueNAS iSCSI connection to ESXi 6. Ubuntu was not happy with the iSCSI and had alot of read/write errors to SDA, causing massive stability problems. I ended up abandoning Ubuntu and using CentOS 7 and is always works flawlessly with my TrueNAS iSCSI to ESXi 6.
[edit] Requirements
estimate
per 5MP IP camera @ 30FPS 5000 bitrate (full resolution)
- CPU - unknown
- RAM - unknown
- Disk - 72GB per day
[edit] Installation
Installation needs to be done as root
~$ sudo su
[edit] Dependencies
~$ add-apt-repository universe ~$ apt install -y wget curl git software-properties-common net-tools dos2unix make zip ffmpeg
NodeJS
~$ curl -fsSL https://deb.nodesource.com/setup_12.x | bash - ~$ apt update -y && apt install -y nodejs
[edit] Clone Project
Place the project in the opt
directory
~$ cd /opt/ ~$ git clone https://gitlab.com/Shinobi-Systems/Shinobi.git Shinobi
[edit] Update SQL Scripts
I had issues with the default installation scripts so I had to make a few changes.
~$ vim /opt/Shinobi/sql/user.sql CREATE USER 'majesticflame'@'%' IDENTIFIED BY ''; GRANT ALL PRIVILEGES ON ccio.* TO 'majesticflame'@'%'; FLUSH PRIVILEGES;
[edit] Install Shinobi
~$ cd /opt/Shinobi ~$ chmod +x INSTALL/ubuntu.sh && INSTALL/ubuntu.sh
Update pm2 so there are no autostart issues with the pm2-root service.
~$ pm2 unstartup ~$ npm install pm2@latest -g ~$ pm2 startup
[edit] Troubleshooting
Verify services are running.
- MariaDB
~$ systemctl status mariadb.service
- NodeJS
~$ systemctl status pm2-root.service ~$ sudo pm2 list ... ┌──────────┬────┬──────┬──────┬────────┬─────────┬────────┬──────┬───────────┬──────┬──────────┐ │ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │ ├──────────┼────┼──────┼──────┼────────┼─────────┼────────┼──────┼───────────┼──────┼──────────┤ │ camera │ 0 │ fork │ 5821 │ online │ 0 │ 55s │ 0.5% │ 99.3 MB │ root │ disabled │ │ cron │ 1 │ fork │ 5932 │ online │ 0 │ 41s │ 0.2% │ 50.2 MB │ root │ disabled │ └──────────┴────┴──────┴──────┴────────┴─────────┴────────┴──────┴───────────┴──────┴──────────┘
Remove and re-add nodeJS services to PM2 for auto start on boot.
It is CRITICAL that you start the JS processes from within the directory they live. Unfortunately the JS processes rely on other dependencies that are called from the relative directory you are launching them from, not the folder the JS file lives in.
~$ cd /opt/Shinobi ~$ sudo pm2 start /opt/Shinobi/camera.js ~$ sudo pm2 start /opt/Shinobi/cron.js ~$ sudo pm2 startup ~$ sudo pm2 save
[edit] CentOS7
[edit] Requirements
estimate
Base Installation w/o cameras
- CPU - 2 core opteron 6380 @ 2.5GHZ
- RAM - 1024 GB
Each additional 5MP IP camera @ 30FPS 5000 bitrate (full resolution) with motion detection and recording
- CPU .5 core opteron 6380 @ 2.5GHZ
- RAM - 500 GB
- 72 GB per day.
These estimates are based on testing I did with a single camera vs with 3 cameras after bumping the system specs a little.
1 camera
- CPU 2 core @ 2.5GHZ = 90% utilization
- RAM 2GB = 50% utilization
3 cameras
- CPU 4 core @ 2.5GHZ = 60% utilization
- RAM 4GB = 50% utilization
[edit] Installation
Installation needs to be done as root
~$ sudo su
[edit] Dependencies
~$ yum update -y ~$ yum install -y epel-release ~$ yum update -y ~$ yum install -y curl wget net-tools git vim gcc gcc-c++ cmake make zip dos2unix
NodeJS
~$ curl --silent --location https://rpm.nodesource.com/setup_12.x | bash - ~$ yum install -y nodejs npm
[edit] Clone Project
Place the project in the opt
directory
~$ cd /opt/ ~$ git clone https://gitlab.com/Shinobi-Systems/Shinobi.git Shinobi
[edit] Install Shinobi
~$ cd /opt/Shinobi ~$ chmod +x ./INSTALL/centos.sh && ./INSTALL/centos.sh
[edit] Open port on firewalld
~$ firewall-cmd --zone=public --add-port=8080/tcp --permanent ~$ firewall-cmd --reload
[edit] Verify pm2-root.service is running
~$ systemctl status pm2-root.service ~$ systemctl start pm2-root.service