.. _setup_os_requirements_rhel7: ============================ Setup OS Requirements RHEL 7 ============================ This section describes how to perform the setup for Red Hat Linux Server 7.7. The Peek platform is designed to run on Linux. Please read through all of the documentation before commencing the installation procedure. Installation Objective ---------------------- This Installation Guide contains specific Red Hat Linux Server 7.4 operating system requirements for the configuring of synerty-peek. Required Software ````````````````` Some of the software to be installed requires internet access. For offline installation some steps are required to be installed on another online server for the files to be packaged and transferred to the offline server. Below is a list of all the required software: * Python 3.9.x * Postgres 12.x Suggested Software `````````````````` The following utilities are often useful. * rsync * git * unzip Optional Software ````````````````` - Oracle Client Installing Oracle Libraries is required if you intend on installing the peek agent. Instruction for installing the Oracle Libraries are in the Online Installation Guide. - FreeTDS FreeTDS is an open source driver for the TDS protocol, this is the protocol used to talk to the MSSQL SQLServer database. .. _rhel_install_prerequisites: Installation Guide ------------------ Follow the remaining section in this document to prepare your RHEL operating system for to run the Peek Platform. The instructions on this page don't install the peek platform, that's done later. Install Red Hat Linux Server 7.7 OS ----------------------------------- This section installs the Red Hat Linux Server 7.7 64bit operating system. Create VM ````````` Create a new virtual machine with the following specifications * 4 CPUs * 8gb of ram * 60gb of disk space Install OS `````````` Download the RHEL ISO **Red Hat Enterprise Linux 7.7 Binary DVD** from: `Download RHEL `_ ---- Mount the ISO in the virtual machine and start the virtual machine. .. note:: Run through the installer manually, do not let your virtual machine software perform a wizard or express install. Staring Off ~~~~~~~~~~~ At the **Red Hat Enterprise Linux 7.7 installer boot menu** screen, select: :: Install Red Hat Enterprise Linux 7.7 ---- At the language selection screen, select: :: English ---- Next you will see a screen that lets you jump to any area to configure. The areas that need attention are numbered and explained in the following sections. .. image:: config_menu1.png .. image:: config_menu2.png ---- #1 Goto the **DATE & TIME** screen, select the appropriate time location. .. image:: rhel_date_and_time.jpg ---- #2 Goto the **SOFTWARE SELECTION** screen, select **Minimal Install** or **Server with GUI** if you'd like a GUI. .. image:: rhel_software_selection.jpg ---- #3 Goto the **INSTALLATION DESTINATION** screen The following partitioning is recommended for DEV peek virtual machines. Select: :: I will configure partitioning. .. image:: rhel_installation_destination.jpg Select Done. Partition Table ~~~~~~~~~~~~~~~ We'll be creating three partitions, `/boot`, `/` and `swap`. For a heavily used production server you may want to create more virtual disks and separate out `/var`, `/home`, and `/tmp`. With one file system per disk. Having one file system per disk allows VM software to easily expand the disk and filesystem as required. ---- Select **Standard Partition** Again, This is to allow the virtual machine software to expand the DEV server disks more easily. .. image:: rhel_standard_partitioning.png ---- Add the partitions, for each partition, click the plus. .. image:: rhel_new_partition.png ---- Set the Mount Point to **/boot** Set the size to **1g** Click **Add mount point** .. image:: rhel_new_mount_boot.png ---- Set the Mount Point to **swap** Set the size to **8g** Click **Add mount point** .. image:: rhel_new_mount_swap.png ---- Set the Mount Point to **/** Set the size to **100%** Click **Add mount point** .. image:: rhel_new_mount_root.png ---- You should have a partition layout as follows, Click **Done** .. image:: rhel_example_partition.png ---- Click **Accept Changes** .. image:: rhel_confrm_partition.png ---- #4 Goto **NETWORK & HOST NAME** screen, .. image:: rhel_network_hostname.jpg 1. Enter your desired hostname, for example :: peek.localdomain ---- 2. Turn on the Ethernet connection, this will get a DHCP IP Address. .. note:: Make note of the DHCP IP Address Otherwise, Configure a static IP address, a. Goto IPv4 Settings tab, b. Set Method to `Manual`, c. Add static IP address, d. Save. .. image:: rhel_network_static_ip.jpg ---- Select **DONE** review the **SUMMARY OF CHANGES** ---- Click **BEGIN INSTALLATION** .. image:: rhel_begin_installation.png ---- While RHEL is installing, further installation steps need to be completed. Configure the **ROOT PASSWORD** and the **USER CREATION** .. image:: rhel_installing_root_user_config.png ---- Configure the root password of the new RHEL VM. Enter the root password twice, then click **Done** .. image:: rhel_config_root_pass.png ---- Create the **peek** user as follows. .. image:: rhel_create_user.png ---- Click **Finish configuration** .. image:: rhel_finish_configuration.png ---- Click **Reboot** .. image:: rhel_install_reboot.png ---- After the server has rebooted, disconnect and remove the RHEL ISO from DVD drive in the VM software. ---- The OS installation is now complete. Login as Peek ------------- Login to the RHEL VM as the :code:`peek` user, either via SSH, or the graphical desktop if it's installed. .. important:: All steps after this point assume you're logged in as the peek user. Registering RHEL ---------------- The RHEL server must have access to the redhat repositories at rhn.redhat.com to install the required packages. This section describes one way of registering a new RHEL server to a Redhat subscription. This is a paid subscription. ---- Run the following command to register the system. Replace MY_RHN_USERNAME with your redhat network username. :: sudo date # enter the password for peek sudo subscription-manager register --username MY_RHN_USERNAME # Enter the password for the RHN account ---- List the subscriptions, and select a pool. :: sudo subscription-manager list --available | grep Pool Subscribe to the pool. Replace POOL_ID_FROM_ABOVE_COMMAND with the Pool ID from the last command. :: sudo subscription-manager subscribe --pool=POOL_ID_FROM_ABOVE_COMMAND ---- Test the subscription with a yum update, this will apply the latest updates. :: sudo yum update -y .. note:: If you want to remove the server from the pool, and unregister it, run the following. :: sudo subscription-manager remove --all sudo subscription-manager unregister Removing IPv6 Localhost ----------------------- Run the following command to ensure that localhost does not resolve to ::1 as this effects the PostgreSQL connection. :: F=/etc/sysctl.conf cat | sudo tee $F < $F [Unit] Description=PostgreSQL 12 database server After=syslog.target After=network.target [Service] Type=forking User=peek Group=peek # Location of database directory Environment=PGDATA=$HOME/pgdata/12 # Disable OOM kill on the postmaster OOMScoreAdjust=-1000 Environment=PG_OOM_ADJUST_FILE=/proc/self/oom_score_adj Environment=PG_OOM_ADJUST_VALUE=0 ExecStart=$HOME/opt/bin/pg_ctl -D ${PGDATA} start ExecStop=$HOME/opt/bin/pg_ctl -D ${PGDATA} stop ExecReload=/bin/kill -HUP $MAINPID KillMode=mixed KillSignal=SIGINT # Do not set any timeout value, so that systemd will not kill postmaster # during crash recovery. TimeoutSec=0 [Install] WantedBy=multi-user.target EOF sudo mv $F /usr/lib/systemd/system/postgresql-12.service ---- Reload the daemon :: systemctl daemon-reload Install CMake ````````````` Download CMake source code :: PEEK_CMAKE_VER=3.19.2 SRC_DIR="$HOME/CMake-${PEEK_CMAKE_VER}" wget https://github.com/Kitware/CMake/archive/v${PEEK_CMAKE_VER}.zip unzip v${PEEK_CMAKE_VER}.zip cd ${SRC_DIR} Compile CMake from source :: ./configure --prefix=$HOME/opt make -j6 install # Remove the src dir and install file cd rm -rf ${SRC_DIR}* rm v${PEEK_CMAKE_VER}.zip Install PostgreSQL Timescaledb `````````````````````````````` Next install timescaledb, this provides support for storing large amounts of historical data. `www.timescale.com `_ ---- Download the timescaledb source code :: PEEK_TSDB_VER=1.7.4 cd wget https://github.com/timescale/timescaledb/archive/${PEEK_TSDB_VER}.zip unzip ${PEEK_TSDB_VER}.zip cd timescaledb-${PEEK_TSDB_VER} ---- Install the packages: :: export CPPFLAGS=`pg_config --cppflags` export LDFLAGS=`pg_config --ldflags` # Bootstrap the build system ./bootstrap -DAPACHE_ONLY=1 # To build the extension cd build && make # To install make install # Cleanup the source code cd rm -rf ${PEEK_TSDB_VER}.zip rm -rf timescaledb-${PEEK_TSDB_VER} ---- Add the timescale repository: :: curl -s https://packagecloud.io/install/repositories/timescale/timescaledb/script.rpm.sh | sudo bash ---- Install timescaledb-tune: :: sudo yum install -y timescaledb-tools-0.10.0-0.el7.x86_64 ---- Tune the database: :: PGVER=12 FILE="$HOME/pgdata/${PGVER}/postgresql.conf" timescaledb-tune -quiet -yes -conf-path ${FILE} -pg-version ${PGVER} ---- Start PostgreSQL: :: systemctl enable postgresql-12 --now Finish PostgreSQL Setup ```````````````````````` Finish configuring and starting PostgreSQL. ---- Allow the peek OS user to login to the database as user peek with no password :: F=$HOME/pgdata/12/pg_hba.conf cat | sudo tee $F < ~/freetds/freetds.conf <