Documentation Documentation

Tyk Pump on Redhat (RHEL) / CentOS

Install Tyk Pump on Redhat (RHEL) / CentOS

Tyk has it’s own signed RPMs in a yum repository hosted by the kind folks at packagecloud.io, which makes it easy, safe and secure to install a trusted distribution of the Tyk Gateway stack.

This tutorial will run on an Amazon AWS Red Hat Enterprise Linux 7.1 instance. We will install Tyk Pump with all dependencies stored locally.

We’re installing on a t2.micro because this is a tutorial, you’ll need more RAM and more cores for better performance.

This configuration should also work (with some tweaks) for CentOS.

Pre-requisites:

  • We are assuming that both Redis and MongoDB are installed (these are installed as part of the Tyk Gateway and Dashboard installation guides)

Step 1: Set up yum repositories

First, we need to install some software that allows us to use signed packages:

    sudo yum install pygpgme yum-utils wget

Next, we need to set up the various repository configurations for Tyk and MongoDB:

Create a file named /etc/yum.repos.d/tyk_tyk-pump.repo that contains the repository configuration below.

Make sure to replace el and 7 in the config below with your Linux distribution and version:

    [tyk_tyk-pump]
    name=tyk_tyk-pump
    baseurl=https://packagecloud.io/tyk/tyk-pump/el/7/$basearch
    repo_gpgcheck=1
    enabled=1
    gpgkey=http://keyserver.tyk.io/tyk.io.rpm.signing.key
           https://packagecloud.io/gpg.key
    sslverify=1
    sslcacert=/etc/pki/tls/certs/ca-bundle.crt
    
    [tyk_tyk-pump-source]
    name=tyk_tyk-pump-source
    baseurl=https://packagecloud.io/tyk/tyk-pump/el/7/SRPMS
    repo_gpgcheck=1
    enabled=1
    gpgkey=http://keyserver.tyk.io/tyk.io.rpm.signing.key
           https://packagecloud.io/gpg.key
    sslverify=1
    sslcacert=/etc/pki/tls/certs/ca-bundle.crt

Finally we’ll need to update our local cache, so run:

    sudo yum -q makecache -y --disablerepo='*' --enablerepo='tyk_tyk-pump' info zabbix

Step 2: Install packages

We’re ready to go, you can now install the relevant packages using yum:

    sudo yum install -y tyk-pump

(You may be asked to accept the GPG key for our repos and when the package installs, hit yes to continue.)

Step 3: Configure Tyk Pump

If you don’t complete this step, you won’t see any analytics in your Dashboard, so to enable the analytics service, we need to ensure Tyk Pump is running and configured properly, to configure Tyk Pump is very simple:

    sudo /opt/tyk-pump/install/setup.sh --redishost=localhost --redisport=6379 --mongo=mongodb://127.0.0.1/tyk_analytics

Step 4: Start Tyk Pump

    sudo service tyk-pump start

That’s it, the Pump should now be up and running.

You can verify if Tyk Pump is running and working by tailing the log file:

    sudo tail -f /var/log/tyk-pump.stderr /var/log/tyk-pump.stdout