Wednesday, May 18, 2016

Configuring Tyk with the Identity Broker in Ubuntu 14.04 LTS

Tyk Dashboard
For the past couple of days, I have been evaluating Tyk with the Identity Broker in Ubuntu. Thanks Martin for helping me in a series of on-going discussion threads, I have managed to make most of it working. This post is a live document. ;)


Add to /etc/hosts file:
127.0.0.1 dashboard.tyk-local.com
127.0.0.1 portal.tyk-local.com

Configure Tyk Gateway
sudo /opt/tyk-gateway/install/setup.sh --dashboard=http://dashboard.tyk-local.com:3000 --listenport=8080 --redishost=localhost --redisport=6379 --domain=""


Configure Tyk Dashboard
sudo /opt/tyk-dashboard/install/setup.sh --listenport=3000 --redishost=localhost --redisport=6379 --mongo=mongodb://127.0.0.1/tyk_analytics --tyk_api_hostname=127.0.0.1 --tyk_node_hostname=http://127.0.0.1 --tyk_node_port=8080 --portal_root=/portal --domain="dashboard.tyk-local.com"


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


sudo service tyk-pump start
sudo service tyk-dashboard start

http://dashboard.tyk-local.com:3000/

Add the license in the prompt.

sudo service tyk-dashboard restart
sudo service tyk-gateway start

sudo /opt/tyk-dashboard/install/bootstrap.sh dashboard.tyk-local.com

Now you are good to start Tyk.

However, to enable TIB, you need to do some more steps.

In /opt/tyk-dashboard/tyk_analytics.conf

    "identity_broker": {
        "enabled": true,
        "host": {
            "connection_string": "http://localhost:3010",
            "secret": "934893845123491238192381486djfhr87234827348"
        }
    },

Make sure the shared secrets match in tyk-analytics.conf and tib.conf of tib.
https://tyk.io/docs/tyk-dashboard-v1-0/configuration/

Now restart everything.
sudo service tyk-pump stop
sudo service tyk-dashboard stop
sudo service tyk-gateway stop

sudo service tyk-pump start
sudo service tyk-dashboard start
sudo service tyk-gateway start

Start TIB
cd /home/pradeeban/programs/tib-v0.1
./tib


Find the logs.
sudo tail -f /var/log/upstart/tyk-dashboard.log
sudo tail -f /var/log/upstart/tyk-gateway.log
sudo tail -f /var/log/upstart/tyk-pump.log

No comments:

Post a Comment

You are welcome to provide your opinions in the comments. Spam comments and comments with random links will be deleted.