Example Script for Installing on SELinux

Example script for installing on SELinux.

The following script can be used as an example of how to automate the installation of OpenText™ Analytics Database on a SELinux server in enforcing mode.


/tmp/selinux/gen_httpstls_json.sh

DBADMIN=$(id -un)
DBADMIN_GROUP=$(id -gn)

ROOT_DIR=/vertica

hosts=(192.168.0.50 192.168.0.51 192.168.0.52)
hostlist=
for h in $hosts; do
    if [ -z "$hostlist" ]; then
        hostlist=$h
    else
        hostlist="$hostislt,$h"
    fi

    scp vertica-latest.rhel.x86_64.rpm $h:/tmp
    scp -r selinux $h:/tmp
    scp httpstls.json *.pem $h:/tmp

    ssh $h sudo DBADMIN=$DBADMIN DBADMIN_GROUP=$DBADMIN_GROUP ROOT_DIR=$ROOT_DIR /tmp/selinux/pre-install_sepolicy.sh
    ssh $h sudo rpm -Uvh /tmp/vertica-latest.rhel.x86_64.rpm
    # if needed:
    # ssh $h sudo DBADMIN=$DBADMIN DBADMIN_GROUP=$DBADMIN_GROUP ROOT_DIR=$ROOT_DIR /tmp/selinux/post-install_sepolicy.sh

    ssh $DBADMIN@$h ROOT_DIR=$ROOT_DIR /tmp/selinux/seinstall.sh
done

ssh ${hosts[1]} vcluster create_db --db-name selinux_vdb --hosts $hostlist --catalog-path $ROOT_DIR/catalog --data-path $ROOT_DIR/data --depot-path $ROOT_DIR/depot --password pw --depot-size 80%  --communal-storage-location s3://vertica-fleeting/selinux_vdb --shard-count 8

for h in $hosts; do
    ssh $h ps xfZ | grep unconfined && echo "warning: dbadmin processes are running unconfined"
done