Setup OS Requirements MacOS

This section describes how to perform the setup for MacOS (previously OSX).

Please read through all of the documentation before commencing the installation procedure.

Installation Objective

This Installation Guide contains specific Mac 10.12 Sierra 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:

  • Xcode (from the app store)
  • Oracle JDK
  • Homebrew
  • Python 3.6.x
  • Postgres 12.x

Optional Software

  • Oracle 12c 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.

Installation Guide

Follow the remaining section in this document to prepare your macOS operating system to run the Peek Platform.

The instructions on this page don’t install the peek platform, that’s done later.

Safari Open Safe Files

If you’re using safari on the mac (which you probably are), make sure Open “Safe” files after downloading is turned off.

This will cause Safari to unzip files that have been downloaded, and invalidate some of the install steps.

In Safari, press Command + , to bring up preferences.

Uncheck the Open “Safe” files after downloading checkbox.


Close safari preferences.

Create Peek Platform OS User

Alternatively to creating a peek user, if you are developing with peek you might want to Symlink the /Users/*developerAccount* to /Users/peek. If doing this run: sudo ln -s /Users/*developerAccount*/ /Users/peek then skip to the next step Install Xcode.

Create a user account for peek with admin rights.

sudo ln -s /Users/*developerAccount*/ /Users/peek

Account Type:Administrator

Sign in to the peek account.


All steps after this point assume you’re logged in as the peek user.

Install Xcode

From the app store, install Xcode.

Run Xcode and accept ‘Agree’ to the license. Xcode will then install components.

Exit Xcode

Run Terminal

Apple’s Command Line Developer Tools can be installed on recent OS versions by running this command in the Terminal:

xcode-select --install

A popup will appear, select ‘Install’ then ‘Agree’ to the license.

Agree to the Xcode license in Terminal run:

sudo xcodebuild -license

Type q, type agree and hit ‘Enter’

Install Homebrew

Edit ~/.bash_profile and insert the following:

# Set PATH to gnu tools
export PATH="`echo ~/bin:$PATH`"

To install Homebrew, run the following command in terminal:

/usr/bin/ruby -e "$(curl -fsSL"

Install gnu-sed for the build scripts

brew install gnu-sed

Install wget, needed for python download

brew install wget

Create the symlinks to prefer the GNU tools

mkdir ~/bin
ln -s `which gsed` ~/bin/sed

Install the dev libs that the python packages will need to compile

brew install openssl@1.1 zlib openldap

Install Python 3.6

Edit ~/.bash_profile and insert the following:

# Setup the variables for PYTHON
export PEEK_PY_VER="3.6.8"
export PATH="/Users/peek/cpython-${PEEK_PY_VER}/bin:$PATH"

# Set the variables for the platform release
# These are updated by the deploy script
export PEEK_ENV=""
export PATH="${PEEK_ENV}/bin:$PATH"


Restart your terminal you get the new environment.

Download and unarchive the supported version of Python

cd ~
source .bashrc
wget "${PEEK_PY_VER}/Python-${PEEK_PY_VER}.tgz"
tar xzf Python-${PEEK_PY_VER}.tgz

Configure the build

cd Python-${PEEK_PY_VER}

export LDFLAGS="-L/usr/local/opt/openssl/lib -L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include -I/usr/local/opt/zlib/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:/usr/local/opt/zlib/lib/pkgconfig"

./configure --prefix=/Users/peek/cpython-${PEEK_PY_VER}/ --enable-optimizations --enable-shared

Make and Make install the software

make install

Cleanup the download and build dir

rm -rf Python-${PEEK_PY_VER}*

Symlink the python3 commands so they are the only ones picked up by path.

cd /Users/peek/cpython-${PEEK_PY_VER}/bin
ln -s pip3 pip
ln -s python3 python

Open a new terminal and test that the setup is working

[ "`which python`" == "$pass" ] && echo "Success" || echo "FAILED"

pass="Python 3.6.8"
[ "`python --version`" == "$pass" ] && echo "Success" || echo "FAILED"

[ "`which pip`" == "$pass" ] && echo "Success" || echo "FAILED"

pass="pip 18.1 from /Users/peek/cpython-3.6.8/lib/python3.6/site-packages/pip (python 3.6)"
[ "`pip --version`" == "$pass" ] && echo "Success" || echo "FAILED"

Upgrade pip:

pip install --upgrade pip

The following packages are required to package/deploy the macOS release.


This is required for the pymysql

pip install Cython

synerty-peek is deployed into python virtual environments. Install the virtualenv python package

pip install virtualenv

The Wheel package is required for building platform and plugin releases

pip install wheel

Install PostgreSQL

Peek requires the PostgreSQL extension plpython3u. This section will install PostgreSQL from homebrew with the extensions Peek needs.


If you have an old version of PostgreSQL installed with brew, you will need to first upgrade that installation.

Reset and date the homebrew-core configuration

echo "First reset any edits we have"
(cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula && git reset --hard)

echo "Update Brew"
brew update

Create the patch script

echo "Create a file to edit the postgresql.rb file"
cat <<'EOF' >

if grep -q 'with-python' $1; then
    echo "Exiting, the changes are already there"
    exit 0

sed '/ENV.prepend "CPPFLAGS"/r'<(
    echo '    ENV.prepend "PATH", "/Users/peek/cpython-3.6.8/bin:"'
    echo '    ENV.prepend "PYTHONPATH", "/Users/peek/cpython-3.6.8"'
) -i -- $1

sed '/--with-perl/r'<(
    echo '      --with-python'
) -i -- $1

echo "Patching complete"


chmod +x

Patch the postgresql brew file

echo "Patch the postgresql file."
export HOMEBREW_EDITOR=`pwd`/
brew edit postgresql

echo "Cleanup"

Tap the keg for timescale

echo "Tap the timescale keg"
brew tap timescale/tap

Uninstall the old software if it exists

echo "Uninstall PostgreSQL if it exists."
brew uninstall postgresql || true
brew uninstall timescaledb || true

Install timescale and PostgreSQL

echo "Install timescale"
brew install --build-from-source postgresql
brew install timescaledb

Finish setting up timescale

echo "Tune the postgresql.conf"
timescaledb-tune --quiet --yes

echo "Move it into place"

Start postgresql and create start at login launchd service:

brew services start postgresql

Allow the peek OS user to login to the database as user peek with no password

cat | sudo tee $F <<EOF
# TYPE  DATABASE        USER            ADDRESS                 METHOD
local   all             postgres                                peer
local   all             peek                                    trust

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all               md5
# IPv6 local connections:
host    all             all             ::1/128                 md5

Create Postgres user

createuser -d -r -s peek

Create the database

createdb -O peek peek


If you already have a database, you may now need to upgrade the timescale extension.

psql peek <<EOF

Set the PostgreSQL peek users password

psql -d postgres -U peek <<EOF

# Set the password as "PASSWORD" for development machines
# Set it to a secure password from for production

Cleanup traces of the password

[ ! -e ~/.psql_history ] || rm ~/.psql_history

Finally, Download pgAdmin4 - A graphically PostgreSQL database administration tool.

Download the latest version of pgAdmin4 for macOS from the following link

Install Worker Dependencies

Install the parallel processing queue we use for the peek-worker tasks.


Install Redis via Homebrew with the following command:

brew install redis

Start redis and create a start at login launchd service:

brew services start redis

Open new terminal and test that Redis setup is working

[ "`which redis-server`" == "$pass" ] && echo "Success" || echo "FAILED"

Increase the size of the redis client queue

BEFORE="client-output-buffer-limit pubsub 64mb 16mb 90"
AFTER="client-output-buffer-limit pubsub 32mb 8mb 60"
sed -i "s/${BEFORE}/${AFTER}/g" /usr/local/etc/redis.conf

brew services restart redis


Install RabbitMQ via Homebrew with the following command:

brew install rabbitmq

Start rabbitmq and create a start at login launchd service:

brew services start rabbitmq

Edit ~/.bash_profile and insert the following:

##### SET THE RabbitMQ ENVIRONMENT #####
# Set PATH to include RabbitMQ
export PATH="/usr/local/sbin:$PATH"

Open new terminal and test that RabbitMQ setup is working

[ "`which rabbitmq-server`" == "$pass" ] && echo "Success" || echo "FAILED"

Enable the RabbitMQ management plugins:

rabbitmq-plugins enable rabbitmq_mqtt
rabbitmq-plugins enable rabbitmq_management

Install Oracle Client (Optional)

The oracle libraries are optional. Install them where the agent runs if you are going to interface with an oracle database.

Make the directory where the oracle client will live

mkdir ~/oracle

Download the following from oracle.

The version used in these instructions is


Oracle version 18.1 is not available for macOS.

  1. Download the “Basic Package” from
  2. Download the “SDK Package” from

Copy these files to ~/oracle on the peek server.

Extract the files.

cd ~/oracle

Add links to $HOME/lib to enable applications to find the libraries:

mkdir ~/lib
ln -s ~/oracle/instantclient_18_1/libclntsh.dylib ~/lib/

Edit ~/.bash_profile and insert the following:

# Set PATH to include oracle
export ORACLE_HOME="`echo ~/oracle/instantclient_18_1`"


Install FreeTDS (Optional)

FreeTDS is an open source driver for the TDS protocol, this is the protocol used to talk to the MSSQL SQLServer database.

Peek needs a installed if it uses the pymssql python database driver, which depends on FreeTDS.


FreeTDS 1.x doesn’t work, so be sure to install @0.91

Install FreeTDS via Homebrew:

brew install freetds@0.91
brew link --force freetds@0.91

Edit ~/.bash_profile and insert the following:

# Set PATH to include fink
export PATH="/usr/local/opt/freetds@0.91/bin:$PATH"

Confirm the installation

tsql -C

You should see something similar to:

Compile-time settings (established with the "configure" script)
                            Version: freetds v0.91.112
             freetds.conf directory: /usr/local/Cellar/freetds@0.91/0.91.112/etc
     MS db-lib source compatibility: no
        Sybase binary compatibility: no
                      Thread safety: yes
                      iconv library: yes
                        TDS version: 7.1
                              iODBC: no
                           unixodbc: no
              SSPI "trusted" logins: no
                           Kerberos: no

Change Open File Limit on macOS

macOS has a low limit on the maximum number of open files. This becomes an issue when running node applications.

Make sure the sudo password timer is reset

sudo echo "Sudo is done, lets go"

Run the following commands in terminal:

echo kern.maxfiles=65536 | sudo tee -a /etc/sysctl.conf
echo kern.maxfilesperproc=65536 | sudo tee -a /etc/sysctl.conf
sudo sysctl -w kern.maxfiles=65536
sudo sysctl -w kern.maxfilesperproc=65536

Edit ~/.bash_profile and insert the following:

##### Open File Limit #####
ulimit -n 65536 65536

Restart the terminal

What Next?

Refer back to the How to Use Peek Documentation guide to see which document to follow next.