How to do it...

You may configure Red PNDA by following the succeeding commands. First clone the project code base:

$ git clone https://github.com/pndaproject/red-pnda.git
$ cd red-pnda

Build it as a super user.

$ sudo su
$ bash scripts/install-dependencies.sh wlo1

In the preceding command, replace wlo1 with one of your active network interfaces. You may find it by using the ifconfig command in Linux and ipcofig in Windows.

The build requires an internet connection as it downloads the required dependencies. You may monitor the status of the build from the logs, as the build logs are verbose. Sample configuration logs (as observed in my laptop during the build) are provided in the file 12_1_configure_red_pnda_output for your reference. After an hour or so, the following message will be printed upon a successful installation:

....
Adding platformlibs 0.6.8 to easy-install.pth file
    
Installed /usr/local/lib/python3.5/dist-packages/platformlibs-0.6.8-py2.7.egg
Processing dependencies for platformlibs==0.6.8
Searching for platformlibs==0.6.8
Reading https://pypi.python.org/simple/platformlibs/
Couldn't find index page for 'platformlibs' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
No local packages or working download links found for platformlibs==0.6.8
error: Could not find suitable distribution for Requirement.parse('platformlibs==0.6.8')
Failed to restart data-manager.service: Unit data-manager.service not found.
####################################################
    
Your Red-PNDA is successfully installed. Go to http://109.141.41.113 on your browser to view the console!

In the log you may find some error messages. Some of them are due to the fact that PNDA is written for Python 2 and hence producing error or warning messages when built with Python 3 environment. If a few libraries failed to download or configure properly, you may manually resume and fix them accordingly. The last logs indicate the admin console URL of Red PNDA. Open the URL in your browser to access it. Red PNDA can be accessed from http://localhost or http://<your-ip-address> as shown here in the following screenshot:

RED PNDA Admin Console

Grafana (https://grafana.com/) is a platform for data analytics and monitoring that is used in PNDA and Red PNDA. You may access Grafana from the Red PNDA web console. You may register yourself as a PNDA user with an email address and password using the Grafana's Log In page or sign up if you haven't already registered.

Grafana can be accessed from http://localhost:3000 or http://<your-ip-address>:3000 as shown in the following screenshot:

Grafana Admin Console

OpenTSDB (http://opentsdb.net/) is a scalable time series database used by PNDA. It stores and serves time series data and its admin interface can be accessed from the Red PNDA web console as well. OpenTSTB can be accessed from http://localhost:4242/ or http://<your-ip-address>:4242/ as shown here in the following screenshot:

OpenTSTB Admin Console

Red PNDA consists of a few scripts that are important to configure the networking data analytics platform. Your Python knowledge comes in handy when extending and executing these Python programs.

You may find four Python programs in the folder, red-pnda/scripts/files. producer.py and consumer.py function which is a Kafka producer and a consumer. You need a Kafka broker running to make these producer and consumer communicate to each other. hbase_spark_metric.py connects to the HBase and Spark to store the status of the network. Finally, create_or_update_ds.py creates a data source in OpenTSTB, or updates an existing data source.

You may use the Python script with the username and password that you have created using Grafana before. The addresses indicate the URLs of the Grafana console and the OpenTSTB console.

$ python create_or_update_ds.py [email protected] password http://localhost:3000 '{ "name": "PNDA OpenTSDB", "type": "opentsdb", "url": "http://localhost:4243", "access": "proxy", "basicAuth": false, "isDefault": true }'

If the credentials are not correct, you will receive this error message:

requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://localhost:3000/api/datasources
  

If the credentials are correct but the data source or OpenTSTB is not configured properly during the Red PNDA configuration, you will receive the following error message:

requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: http://localhost:3000/api/datasources
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.31.67