This is a brief instruction on how to deploy pm-mapper in docker env and how to configure filters in pm-mapper
Prerequisite
- Docker
- make
- bash
- linux(ubuntu 18+)
Installation
copy pm-mapper repo from onap gerrit
git clone "https://gerrit.onap.org/r/dcaegen2/services/pm-mapper"
go to sub-directory:
cd tools/development
install dmaap-dr, cbs, consul, files-publisher and dmaap-mr:
make setup-local
install pm-mapper:
make run-pm-mapper
After successful installation, we should see the docker containers:
Config dmaap
config dmaap-dr to create a feed for pm-mapper to subscribe:
make config-dmaap
Subscribe to dmaap-dr feed
config dmaap to create a feed for pm-mapper to subscribe:
make subscribe-pm-mapper
List files in container files-publisher
files-publisher is a micro-servive designed for test/demo purpose, it has some prepared files to publish to dmaap-dr:
make list-files
In real onap instance, files-publisher is replaced by Data-File-Collector.
Publish file to dmapp-dr
in the same sub-directory, there are two scripts to do this:
send-meas-collec.sh & send-meas-data.sh
we can pick one files from above list, eg:
./send-meas-collec.sh A20181002.0000-1000-0015-1000_5G.xml.gz
Check logs on dmaap-mr:
docker logs mr-simulator
We should be able to see a message like below:
After formatting:
Pay attention to the "measTypes", we can see all four types now because we didn't configure any filters yet:
Configure filters
edit file "pm-mapper/tools/development/resources/config.json"
update the filters like below:
"pm-mapper-filter": { "filters":[{ "pmDefVsn": "1.0", "nfType": "gnb", "vendor": "Nokia", "measTypes": ["succImmediateAssignProcs"] } ] }
This filter will only receive pm counters with type "succImmediateAssignProcs"
Make the filter effective:
curl 'http://localhost:8500/v1/kv/pmmapper?dc=dc1' -X PUT -H 'Accept: application/^Con' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data @config.json
Wait for 60 seconds. pm-mapper reads the configuration from consul regularly every 60 seconds.
Then do the file publish again, and check logs:
./send-meas-collec.sh A20181002.0000-1000-0015-1000_5G.xml.gz docker logs mr-simulator
Now we should see a different message like below:
After formatting:
Pay attention to the measTypes, we can only see the info with "succImmediateAssignProcs".
Clean env
clean env
make clean-env