SmartTUBE Server Installation
The initial deployment of the SmartTUBE server is usually carried out by SmartLabs specialists during the project commissioning phase. This document serves as a reference guide for advanced users who intend to set up a distributed component structure, where each component is installed on a separate machine. It also provides information on integrating with your existing databases and configurations.
SmartTUBE installation requires manual configuration from a repository. Please follow the steps outlined below to successfully install SmartTUBE.
- Connect the repository (for the repository details contact the SmartLabs official representative).
- Install Java JDK from the repository:
# yum -y install smartlabs-java8-stub |
Alternatively, you can download the rpm-package from the official source http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and install it:
# rpm -ivh <package_name> |
- Install and run Elasticsearch (reference guide: https://www.elastic.co/guide/en/elasticsearch/reference/7.8/rpm.html):
- Import the Elasticsearch PGP Key:
# rpm –import https://artifacts.elastic.co/GPG-KEY-elasticsearch |
- Create a file called elasticsearch.repo in the /etc/yum.repos.d/ directory:
[elasticsearch] name=Elasticsearch repository for 7.8 packages |
- Install Elasticsearch:
sudo yum install –enablerepo=elasticsearch elasticsearch-7.8.1 |
- The RPM for Elasticsearch v7.8.1 can be downloaded from the website and installed as follows:
# yum -y install wget |
This command compares the SHA of the downloaded RPM and the published checksum, which should output elasticsearch-7.8.1-x86_64.rpm: OK.
# yum localinstall elasticsearch-7.8.1-x86_64.rpm |
- Start the Elasticsearch service:
# systemctl start elasticsearch.service |
- Add these settings in the configuration file /etc/elasticsearch/elasticsearch.yml:
cluster.name: smartlabs_cache_client |
- Restart the Elasticsearch service:
# systemctl restart elasticsearch.service |
- Set the password for built-in users:
# /usr/share/elasticsearch/bin/elasticsearch-setup-passwords auto |
- Follow the on-screen instructions.
- Remember the password for the elastic user. It will be needed in the SmartTUBE Cache client configuration.
- After you install Elasticsearch, enable the service autorun
RHEL7: # systemctl enable elasticsearch.service
and run the service:
RHEL7: # systemctl start elasticsearch.service
- Install PostgreSQL (reference guide: https://wiki.postgresql.org/wiki/YUM_Installation)
- Install the ps-rpm file corresponding to your OS version and the required version of the package (https://yum.postgresql.org/repopackages.php), for example:
# yum localinstall https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-centos96-9.6-2.noarch.rpm |
- Check the packages available for installation: # yum list postgres*
- Install PostgreSQL (the command depends on the package version you are installing):
# yum -y install postgresql96-server |
- Initialize the database
RHEL7:
# su – postgres |
- Enable the service autorun
RHEL7: # systemctl enable postgresql-9.6.service
- Run the service
RHEL7: # systemctl start postgresql-9.6.service
- Download the database dump: # yum -y install postgresql-initial
- Install SmartTUBE from the repository
# yum -y install smarttube5-mod-dataserver smarttube5-mod-cacheserver smarttube5-mod-datacore smarttube5-aui5 smartlabs-nginx smarttube5-mod-reports |
- Make the following changes to the configuration file /opt/smartlabs/smarttube5/conf/modules/cache-server.conf:
elasticsearch { |
Where elastic_user_password — password for elastic user generated in Step 3.
- Make the following changes to the configuration file /opt/smartlabs/smarttube5/conf/modules/data-server.conf:
- Find the database section;
- Change the IP and PORT and DB reference in the connection-string parameter;
- Add the password for DB access;
Example of the correct section configuration:
database { |
- Open the configuration file /opt/smartlabs/nginx/conf/nginx.conf. It should contain the following:
user nginx; error_log /var/log/smartlabs/nginx/error.log; pid /var/run/nginx.pid; events { timer_resolution 1ms; http { log_format main ‘$remote_addr [$http_x_forwarded_for] – $http_x_smartlabs_mac_address [$time_local] $upstream_cache_status $request “$status” $body_bytes_sent “$http_referer” “$http_user_agent” “$upstream_addr” $server_port “$http_host” $request_time $req uest_send_time “$upstream_response_time” $gzip_ratio’; access_log /var/log/smartlabs/nginx/access.log main; sendfile on; proxy_next_upstream error timeout http_500 http_502 http_503 http_504 ; push_stream_shared_memory_size 128M; include “http.d/*.conf”; server { location /sla_status { location /sla_purge { location / { location = /nginx_status { location /push_stream_admin { |
- Configure the /opt/smartlabs/smarttube5/conf/modules/report.conf file with the IP, port and DB name. It should look like this:
component = { description = “SmartTUBE5 Report” properties = { datasources = [ |
- If you need to apply other changes to configuration files, see their description in the Configuration files part. Normally, you can work with default settings.
- Add the rule to iptables (# vi /etc/sysconfig/iptables)
-A INPUT -p tcp -m tcp –dport 8084 -j ACCEPT |
Restart the service
RHEL7: # systemctl restart iptables.service
If the service is not set for the RHEL 7 iptables (you can see it by the empty file /etc/sysconfig/iptables), do the following:
- Disable firewalld
# systemctl stop firewalld |
- Delete it from autorun
# systemctl disable firewalld |
- Install the package with utilities
# yum -y install iptables-services |
- Add iptables to autorun
# systemctl enable iptables.service |
- Run the service
# systemctl start iptables.service |
- Add the rule from above and restart the service
- Run the smarttube5 service:
RHEL7: # systemctl start smarttube5.service - Check the operability:
# wget –header “Content-Type:application/json” -O – ” http://localhost:8084/sdpapi?metacontentingenre=list “ |
The response must be 200 OK.