|
|
# UDR Installation
|
|
|
|
|
|
Tested and validated on Ubuntu Bionic arch amd64.
|
|
|
|
|
|
We highly recommend that you use the stable branch, `develop`, to avoid any potential issues.
|
|
|
|
|
|
## Download OAI UDR source code
|
|
|
|
|
|
```
|
|
|
ubuntu@test-udr:~$ git clone https://gitlab.eurecom.fr/oai/oai-cn5g-udr.git -b develop
|
|
|
```
|
|
|
|
|
|
## Install UDR
|
|
|
|
|
|
### Install UDR software dependencies
|
|
|
|
|
|
> - [Spdlog](https://github.com/gabime/spdlog)
|
|
|
> - [Pistache](http://pistache.io/)
|
|
|
> - [Nlohmann Json](https://github.com/nlohmann/json)
|
|
|
|
|
|
```
|
|
|
ubuntu@test-udr:~$ cd oai-cn5g-udr/
|
|
|
ubuntu@test-udr:~/oai-cn5g-udr$ cd ./build/scripts
|
|
|
ubuntu@test-udr:~/oai-cn5g-udr/build/scripts$ ./build_udr -I -f
|
|
|
```
|
|
|
|
|
|
### Build UDR
|
|
|
|
|
|
As a starting point, you can start with a Debug build, then you can change the build type
|
|
|
Check build types with `./build_udr -h`
|
|
|
|
|
|
```
|
|
|
ubuntu@test-udr:~/oai-cn5g-udr/build/scripts$ ./build_udr -c -V -b Debug -j
|
|
|
```
|
|
|
|
|
|
## UDR Configuration
|
|
|
|
|
|
|
|
|
**Create UDR configuration files**
|
|
|
|
|
|
Update the information in `build/scripts/udr_conf` according to your configuration and generate the configuration file for UDR:
|
|
|
|
|
|
|
|
|
```
|
|
|
# prompt has been removed for easier Ctrl+C Ctrl+V
|
|
|
# please update the following information according to your configuration
|
|
|
|
|
|
INSTANCE=1
|
|
|
PREFIX='/usr/local/etc/oai'
|
|
|
sudo mkdir -m 0777 -p $PREFIX
|
|
|
cp ../../etc/udr.conf $PREFIX
|
|
|
declare -A UDR_CONF
|
|
|
|
|
|
SF_CONF[@INSTANCE@]=$INSTANCE
|
|
|
UDR_CONF[@PID_DIRECTORY@]='/var/run'
|
|
|
|
|
|
UDR_CONF[@UDR_INTERFACE_NAME_FOR_NUDR@]='eth0'
|
|
|
|
|
|
UDR_CONF[@UDR_INTERFACE_PORT_FOR_NUDR@]='80'
|
|
|
UDR_CONF[@UDR_INTERFACE_HTTP2_PORT_FOR_NUDR@]='8080'
|
|
|
UDR_CONF[@UDR_API_VERSION@]='v1'
|
|
|
|
|
|
UDR_CONF[@MYSQL_IPV4_ADDRESS@]='172.16.1.103'
|
|
|
UDR_CONF[@MYSQL_USER@]='root'
|
|
|
UDR_CONF[@MYSQL_PASS@]='linux'
|
|
|
UDR_CONF[@MYSQL_DB@]='oai_db'
|
|
|
|
|
|
|
|
|
for K in "${!UDR_CONF[@]}"; do
|
|
|
egrep -lRZ "$K" $PREFIX | xargs -0 -l sed -i -e "s|$K|${UDR_CONF[$K]}|g"
|
|
|
ret=$?;[[ ret -ne 0 ]] && echo "Tried to replace $K with ${UDR_CONF[$K]}"
|
|
|
done
|
|
|
|
|
|
```
|
|
|
|
|
|
Then execute the following command to generate the corresponding configuration file for UDR (`/usr/local/etc/oai/udr.conf`):
|
|
|
```
|
|
|
ubuntu@test-udr:~/oai-cn5g-udr/build/scripts$ ./udr_conf.sh
|
|
|
```
|
|
|
|
|
|
**An example for the configuration file**
|
|
|
|
|
|
More detailed explanation for the UDR configuration is available in the section [UDR configuration](udr_configuration)
|
|
|
|
|
|
# Launch UDR
|
|
|
|
|
|
After that, you can launch UDR by executing the following command
|
|
|
```
|
|
|
ubuntu@test-udr:~/oai-cn5g-udr/build/scripts$ sudo udr -c /usr/local/etc/oai/udr.conf -o
|
|
|
```
|
|
|
|