1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
4 Standalone Installation in Virtual Machine
5 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 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.
14 * Install policy framework on a Virtual Machine using the integration script.
15 * Install the Beijing controller.
16 * Install and Push Beijing policy for vCPE, vFirewall, vDNS & VOLTE use cases.
17 * Verify the use cases manually.
20 * Either use sudo access to run the commands or login through root user.
21 * These steps have been verified for a VM with Ubuntu OS.
23 **Follow the steps below to install policy framework in a virtual machine using the integration script.**
28 **Step 1:** Make the etc/hosts entries
32 echo $(hostname -I | cut -d\ -f1) $(hostname) | sudo tee -a /etc/hosts
34 **Step 2:** Make the DNS entries
38 echo "nameserver <PrimaryDNSIPIP>" >> /etc/resolvconf/resolv.conf.d/head
39 echo "nameserver <SecondaryDNSIP>" >> /etc/resolvconf/resolv.conf.d/head
42 **Step 3:** Update the ubuntu software installer
48 **Step 4:** Check and Install Java
52 apt-get install -y openjdk-8-jdk
55 Ensure that the Java version that is executing is *OpenJDK version 8*
57 **Step 5:** Check and Install GIT
64 **Step 6:** Check and Install Maven
71 **Step 7:** Check and Install docker and docker-compose
75 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
76 add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
78 apt-cache policy docker-ce
79 apt-get install -y docker-ce
80 systemctl status docker
82 apt install docker-compose
85 **Step 8:** Check the MTU size of the eth0 interface on your VM, it is 9126 in the example below
90 eth0 Link encap:Ethernet HWaddr 02:42:ac:12:00:07
91 inet addr:172.18.0.7 Bcast:0.0.0.0 Mask:255.255.0.0
92 inet6 addr: fe80::42:acff:fe12:7/64 Scope:Link
93 UP BROADCAST RUNNING MULTICAST MTU:9126 Metric:1
94 RX packets:44955 errors:0 dropped:0 overruns:0 frame:0
95 TX packets:75017 errors:0 dropped:0 overruns:0 carrier:0
96 collisions:0 txqueuelen:0
97 RX bytes:8712526 (8.7 MB) TX bytes:7079733 (7.0 MB)
99 **Step 9:** Configure the DNS settings in the Docker daemon configuration file /etc/docker/daemon.json
101 * add or edit the first line below for your DNS settings *<PrimaryDNSIP>* and *<SecondaryDNSIP>*
102 * add or edit the second line below for your MTU size *<MTUSize>*, taken from the command in step 8 above
106 add "dns": ["<PrimaryDNSIP>", "<SecondaryDNSIP>"]
109 **Step 10:** Restart the docker service
113 service docker restart
115 **Step 11:** Change the permissions of the Docker Daemon configuration file
119 chmod 565 /etc/docker/daemon.json
121 **Step 12:** Configure the DNS settings in the Docker configuration file */etc/default/docker*
123 * add or edit the line below for your DNS settings *<PrimaryDNSIP>* and *<SecondaryDNSIP>*
127 add DOCKER_OPTS="--dns <PrimaryDNSIP> --dns <SecondaryDNSIP>"
129 **Step 13:** Change the permissions of the Docker socket file
133 chmod 565 /var/run/docker.sock
135 **Step 14:** Check the status of the Docker service and ensure it is running correctly
139 service docker status
142 Install the ONAP Policy Framework
143 ---------------------------------
145 **Step 1:** Clone the integration git repository
149 git clone https://gerrit.onap.org/r/integration
151 **Step 2:** Change to the policy integration script location
155 cd integration/test/csit/scripts/policy/
157 **Step 3:** Edit the Policy integration script script1.sh
161 # - set the MTU value <MTUValue> to the same value as read in step 8 above
162 # - set the value of PRELOAD_POLICIES to true
163 # - change the name of the docker compose Yaml file to remove the -integration part of the file name from
164 # "docker-compose -f docker-compose-integration.yml up -d"
166 # "docker-compose -f docker-compose.yml up -d"
168 export MTU=<MTUValue>
169 export PRELOAD_POLICIES=true
170 docker-compose -f docker-compose.yml up -d
172 **Step 4:** Run the integration script for automated installation
176 ./script1.sh | tee /tmp/log.txt
178 Note: It may take up to 60 minutes for the installation to complete. You can view installation logs in /tmp/log.txt
181 **Step 5:** Verify the installation
185 echo $(hostname -I | cut -d\ -f1) $(hostname) | sudo tee -a /etc/hosts
188 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
189 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
190 52a910a3678b onap/policy-pe "bash ./do-start.sh …" 2 days ago Up 2 days 0.0.0.0:8081->8081/tcp pdp
191 aa9bb20efe59 onap/policy-pe "bash ./do-start.sh …" 2 days ago Up 2 days brmsgw
192 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
193 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
194 fd48c851b6be mariadb:10.0.34 "docker-entrypoint.s…" 2 days ago Up 2 days 0.0.0.0:3306->3306/tcp mariadb
197 Installation of Controllers and Policies
198 ----------------------------------------
200 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.
202 * `Installation of Amsterdam Controller and vCPE Policy <installAmsterController.html>`_
203 * `Installation of Beijing Controller and Policies <installBeijingController.html>`_
209 The following command returns a JSON document containing the configuration information from the PDP.
212 :caption: To return a JSON document containing the configuration information from the PDP
214 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
217 Run following command to check PDP, PAP and PDP-D Health status
220 :caption: To check PDP, PAP and PDP-D Health status
222 http -a 'healthcheck:zb!XztG34' :6969/healthcheck
226 Content-Type: application/json
227 Date: Tue, 17 Apr 2018 10:51:14 GMT
228 Server: Jetty(9.3.20.v20170531)
243 "url":"http://pap:9091/pap/test"
250 "url":"http://pdp:8081/pdp/test"
256 Run following command to make sure all topics are created
259 :caption: To check all topics are created
261 curl --silent --user @1b3rt:31nst31n -X GET http://localhost:9696/policy/pdp/engine/topics/sources | python -m json.tool
264 .. _Standalone installation in Virtual Machine: https://wiki.onap.org/display/DW/ONAP+Policy+Framework%3A+Standalone+installation+in+Virtual+Machine