Standalone Installation in Virtual Machine¶
Contents
Overview¶
- This document explains the steps required to install ONAP policy framework in a standalone virtual machine. The following steps are explained in detail with required commands.
Install policy framework on a Virtual Machine using the integration script.
Install the Beijing controller.
Install and Push Beijing policy for vCPE, vFirewall, vDNS & VOLTE use cases.
Verify the use cases manually.
Note
Either use sudo access to run the commands or login through root user.
These steps have been verified for a VM with Ubuntu OS.
Follow the steps below to install policy framework in a virtual machine using the integration script.
Docker Installation¶
Step 1: Make the etc/hosts entries
echo $(hostname -I | cut -d\ -f1) $(hostname) | sudo tee -a /etc/hosts
Step 2: Make the DNS entries
echo "nameserver <PrimaryDNSIPIP>" >> /etc/resolvconf/resolv.conf.d/head echo "nameserver <SecondaryDNSIP>" >> /etc/resolvconf/resolv.conf.d/head resolvconf -u
Step 3: Update the ubuntu software installer
apt-get update
Step 4: Check and Install Java
apt-get install -y openjdk-8-jdk java -versionEnsure that the Java version that is executing is OpenJDK version 8
Step 5: Check and Install GIT
apt-get install git git -version
Step 6: Check and Install Maven
apt-get install maven mvn -version
Step 7: Check and Install docker and docker-compose
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" apt-get update apt-cache policy docker-ce apt-get install -y docker-ce systemctl status docker docker ps apt install docker-compose docker-compose
Step 8: Check the MTU size of the eth0 interface on your VM, it is 9126 in the example below
ifconfig eth0 Link encap:Ethernet HWaddr 02:42:ac:12:00:07 inet addr:172.18.0.7 Bcast:0.0.0.0 Mask:255.255.0.0 inet6 addr: fe80::42:acff:fe12:7/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:9126 Metric:1 RX packets:44955 errors:0 dropped:0 overruns:0 frame:0 TX packets:75017 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:8712526 (8.7 MB) TX bytes:7079733 (7.0 MB)
Step 9: Configure the DNS settings in the Docker daemon configuration file /etc/docker/daemon.json
add or edit the first line below for your DNS settings <PrimaryDNSIP> and <SecondaryDNSIP>
add or edit the second line below for your MTU size <MTUSize>, taken from the command in step 8 above
add "dns": ["<PrimaryDNSIP>", "<SecondaryDNSIP>"] add "mtu": <MTUSize>
Step 10: Restart the docker service
service docker restart
Step 11: Change the permissions of the Docker Daemon configuration file
chmod 565 /etc/docker/daemon.json
Step 12: Configure the DNS settings in the Docker configuration file /etc/default/docker
add or edit the line below for your DNS settings <PrimaryDNSIP> and <SecondaryDNSIP>
add DOCKER_OPTS="--dns <PrimaryDNSIP> --dns <SecondaryDNSIP>"
Step 13: Change the permissions of the Docker socket file
chmod 565 /var/run/docker.sock
Step 14: Check the status of the Docker service and ensure it is running correctly
service docker status docker ps
Install the ONAP Policy Framework¶
Step 1: Clone the integration git repository
git clone https://gerrit.onap.org/r/integration
Step 2: Change to the policy integration script location
cd integration/test/csit/scripts/policy/
Step 3: Edit the Policy integration script script1.sh
# - set the MTU value <MTUValue> to the same value as read in step 8 above # - set the value of PRELOAD_POLICIES to true # - change the name of the docker compose Yaml file to remove the -integration part of the file name from # "docker-compose -f docker-compose-integration.yml up -d" # to # "docker-compose -f docker-compose.yml up -d" export MTU=<MTUValue> export PRELOAD_POLICIES=true docker-compose -f docker-compose.yml up -d
Step 4: Run the integration script for automated installation
./script1.sh | tee /tmp/log.txt
Note: It may take up to 60 minutes for the installation to complete. You can view installation logs in /tmp/log.txt
Step 5: Verify the installation
echo $(hostname -I | cut -d\ -f1) $(hostname) | sudo tee -a /etc/hosts docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2d04434c5354 onap/policy-drools "/bin/sh -c ./do-sta…" 2 days ago Up 2 days 0.0.0.0:6969->6969/tcp, 0.0.0.0:9696->9696/tcp drools 52a910a3678b onap/policy-pe "bash ./do-start.sh …" 2 days ago Up 2 days 0.0.0.0:8081->8081/tcp pdp aa9bb20efe59 onap/policy-pe "bash ./do-start.sh …" 2 days ago Up 2 days brmsgw 7cdf4919044b onap/policy-pe "bash ./do-start.sh …" 2 days ago Up 2 days 0.0.0.0:8443->8443/tcp, 0.0.0.0:9091->9091/tcp pap 394854eab2bc sonatype/nexus:2.14.8-01 "/bin/sh -c '${JAVA_…" 2 days ago Up 2 days 0.0.0.0:9081->8081/tcp nexus fd48c851b6be mariadb:10.0.34 "docker-entrypoint.s…" 2 days ago Up 2 days 0.0.0.0:3306->3306/tcp mariadb
Installation of Controllers and Policies¶
You may now install a controller and policies on the ONAP Policy Framework. Follow either of the HowTos below to install either the Amsterdam or Beijing controller and policies.
Useful Commands¶
The following command returns a JSON document containing the configuration information from the PDP.
curl -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'ClientAuth: cHl0aG9uOnRlc3Q=' -H 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' -H 'Environment: TEST' -X POST -d '{"policyName": ".*"}' http://localhost:8081/pdp/api/getConfig | python -m json.tool
Run following command to check PDP, PAP and PDP-D Health status
http -a 'healthcheck:zb!XztG34' :6969/healthcheck
HTTP/1.1 200 OK
Content-Length: 276
Content-Type: application/json
Date: Tue, 17 Apr 2018 10:51:14 GMT
Server: Jetty(9.3.20.v20170531)
{
"details":[
{
"code":200,
"healthy":true,
"message":"alive",
"name":"PDP-D",
"url":"self"
},
{
"code":200,
"healthy":true,
"message":"",
"name":"PAP",
"url":"http://pap:9091/pap/test"
},
{
"code":200,
"healthy":true,
"message":"",
"name":"PDP",
"url":"http://pdp:8081/pdp/test"
}
],
"healthy":true
}
Run following command to make sure all topics are created
curl --silent --user @1b3rt:31nst31n -X GET http://localhost:9696/policy/pdp/engine/topics/sources | python -m json.tool
End of Document