Commit d62249a9 authored by yangjian's avatar yangjian

add oai v1.5.0

parents
This diff is collapsed.
This diff is collapsed.
grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
FLUSH PRIVILEGES;
[mysqld]
character-set-server=utf8mb4
default-time-zone='+8:00'
innodb_rollback_on_timeout='ON'
max_connections=500
innodb_lock_wait_timeout=500
version: '3.3'
services:
openxg-amf:
image: openxg5gc/openxg-5gc:v1.5.0
container_name: amf
restart: always
logging:
driver: "json-file"
options:
max-size: "100m"
networks:
openxg:
ipv4_address: 172.11.200.14
#ports:
# - "38412:38412/sctp"
stdin_open: true
tty: true
command: /opt/5gcs/amf/libs/ld-linux-x86-64.so.2 --library-path /opt/5gcs/amf/libs/ /opt/5gcs/amf/amf -c /opt/5gcs/amf/amf.conf -o
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
openxg-smf:
image: openxg5gc/openxg-5gc:v1.5.0
container_name: smf
restart: always
logging:
driver: "json-file"
options:
max-size: "100m"
networks:
openxg:
ipv4_address: 172.11.200.15
stdin_open: true
tty: true
command: /opt/5gcs/smf/libs/ld-linux-x86-64.so.2 --library-path /opt/5gcs/smf/libs/ /opt/5gcs/smf/smf -c /opt/5gcs/smf/smf.conf -o
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
openxg-spgwu:
image: openxg5gc/openxg-5gc:v1.5.0
container_name: spgwu
depends_on:
- openxg-smf
restart: always
cap_add:
- NET_ADMIN
- SYS_ADMIN
cap_drop:
- ALL
privileged: true
logging:
driver: "json-file"
options:
max-size: "100m"
networks:
openxg:
ipv4_address: 172.11.200.25
stdin_open: true
tty: true
command: /opt/5gcs/spgw_u/libs/ld-linux-x86-64.so.2 --library-path /opt/5gcs/spgw_u/libs/ /opt/5gcs/spgw_u/spgwu -c /opt/5gcs/spgw_u/spgw_u.conf -o
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
networks:
openxg:
name: docker-openxg
external: true
version: '3.3'
services:
iperf3:
image: openxg5gc/iperf3:latest
container_name: iperf3
restart: always
logging:
driver: "json-file"
options:
max-size: "100m"
networks:
openxg:
ipv4_address: 172.11.200.200
stdin_open: true
tty: true
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
networks:
openxg:
name: docker-openxg
external: true
version: '3.3'
services:
mysql:
image: mysql:5.7
container_name: mysql
restart: always
logging:
driver: "json-file"
options:
max-size: "1m"
networks:
openxg:
aliases:
- web_mysql
ipv4_address: 172.11.200.10
ports:
- "3306:3306"
- "33060:33060"
volumes:
- ./database/docker-compose-mysqlData/:/var/lib/mysql
- ./database/my.conf:/etc/mysql/conf.d/my.conf
- ./database/amfusers.sql:/docker-entrypoint-initdb.d/create_db_sql.sql
- ./database/grant_root_remote.sql:/docker-entrypoint-initdb.d/grant_root_remote.sql
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
environment:
MYSQL_ROOT_PASSWORD: root
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: phpmyadmin
restart: always
logging:
driver: "json-file"
options:
max-size: "1m"
depends_on:
- mysql
networks:
openxg:
aliases:
- web_phpmyadmin
ipv4_address: 172.11.200.9
ports:
- "8080:80"
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
environment:
PMA_HOST: 172.11.200.10
PMA_PORT: 3306
networks:
openxg:
driver: bridge
name: docker-openxg
ipam:
config:
- subnet: 172.11.200.0/24
driver_opts:
com.docker.network.bridge.name: "docker-openxg"
version: '3.3'
services:
ueransim-gnb:
image: openxg5gc/ueransim:latest
container_name: ueransim-gnb
restart: always
privileged: true
logging:
driver: "json-file"
options:
max-size: "100m"
networks:
openxg:
ipv4_address: 172.11.200.100
stdin_open: true
tty: true
command: ./nr-gnb -c gnb.yaml
networks:
openxg:
name: docker-openxg
external: true
version: '3.3'
services:
ueransim-ue:
image: openxg5gc/ueransim:latest
container_name: ueransim-ue
restart: always
privileged: true
logging:
driver: "json-file"
options:
max-size: "100m"
networks:
openxg:
stdin_open: true
tty: true
command: ./nr-ue -c ue.yaml
networks:
openxg:
name: docker-openxg
external: true
# OpenXG Core Network Installation Instructions
> ## docker 部署
1. 下载源码
```shell
git clone http://git.opensource5g.org/openxg/openxg-5gcs-release.git
git checkout oai
```
2. 安装docker、docker-compose
```shell
cd openxg-5gcs-release/scripts
./install.sh -I
```
3. 启动数据库并创建docker网桥
```shell
cd openxg-5gcs-release/docker-compose
docker-compose -f docker-compose-mysql.yml up -d
```
以上命令部署了phpmyadmin,通过访问http://本机ip:8080 可以打开。用户名为:root,密码为:123456;
用户sim卡信息在 amfusers数据库 users表中。
4. 启动核心网
```shell
cd openxg-5gcs-release/docker-compose
docker-compose -f docker-compose-5gc.yml up -d #构建并启动容器
```
5. 启动iperf
```shell
docker-compose -f docker-compose-iperf3.yml up -d
```
6. 连接基站、UE
```shell
docker-compose -f docker-compose-ueransim-gnb.yml up -d #启动gNB
docker-compose -f docker-compose-ueransim-ue.yml up -d #启动UE
docker exec -it ueransim-ue ping -I uesimtun0 www.baidu.com #检测ue访问外网
docker exec -it ueransim-ue iperf3 -c 172.11.200.200 -u -l 1300 -b 10M -B <ueransim容器中生成的 UE IP> #打流
```
外部基站需要在基站所在主机中执行以下命令:
```shell
route add -net 172.11.200.0 netmask 255.255.255.0 gw <核心网所在主机的IP>
```
> ## 关闭并删除docker容器
```shell
cd openxg-5gcs-release/docker-compose
docker-compose -f docker-compose-ueransim-ue.yml down -t 0 #关闭UE
docker-compose -f docker-compose-ueransim-gnb.yml down -t 0 #关闭gNB
docker-compose -f docker-compose-iperf3.yml down -t 0 #关闭iperf
docker-compose -f docker-compose-5gc.yml down -t 0 #关闭核心网
docker-compose -f docker-compose-mysql.yml down -t 0 #关闭数据库
```
> ## 日志
```shell
cd openxg-5gcs-release/docker-compose
docker logs -f amf #查看amf日志
docker logs -f smf #查看smf日志
docker logs -f spgwu #查看spgwu日志
```
#!/bin/bash
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
#echo "$THIS_SCRIPT_PATH"
source ${THIS_SCRIPT_PATH}/install_help
function help()
{
echo_info " "
echo_info "Usage: build_allinone -I"
echo_info " "
echo_info "Options:"
echo_info "Mandatory arguments to long options are mandatory for short options too."
echo_info " -I, --install-deps Check installed software necessary to build and run Docker."
echo_info " -h, --help Print this help."
echo_info " "
}
function main()
{
if [ $# -lt 1 ]; then
echo_error "$0 \"-h\" Or \"--help\""
fi
until [ -z "$1" ]
do
case "$1" in
-I | --install-deps)
dv=$(docker -v)
until [ "${dv:0:14}" = "Docker version" ]
do
apt-get update
apt-get install -y docker.io
dv=$(docker -v)
done
echo "already installed docker"
# install curl
cv=$(curl -V)
until [ "${cv:0:4}" = "curl" ]
do
apt-get install -y curl
cv=$(curl -V)
done
echo "already installed curl"
# install docker-compose
dcv=$(docker-compose --version)
until [ ${dcv:23:6} == 1.28.2 ]
do
# curl -L "https://github.com/docker/compose/releases/download/1.28.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
cp $THIS_SCRIPT_PATH/../libs/docker-compose /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
dcv=$(docker-compose --version)
done
echo "already installed docker-compose"
shift
;;
-h | --help)
help
shift
return 0
;;
*)
echo_error "Unknown option $1"
help
return 1
;;
esac
done
}
main "$@"
###############################
## echo and family
###############################
black='\E[30m'
red='\E[31m'
green='\E[32m'
yellow='\E[33m'
blue='\E[1;34m'
magenta='\E[35m'
cyan='\E[36m'
white='\E[37m'
reset_color='\E[00m'
COLORIZE=1
#-------------------------------------------------------------------------------
cecho() {
# Color-echo
# arg1 = message
# arg2 = color
local default_msg="No Message."
message=${1:-$default_msg}
color=${2:-$green}
[ "$COLORIZE" = "1" ] && message="$color$message$reset_color"
echo -e "$message"
return
}
echo_error() { cecho "$*" $red ;}
echo_fatal() { cecho "$*" $red; exit -1 ;}
echo_warning() { cecho "$*" $yellow ;}
echo_success() { cecho "$*" $green ;}
echo_info() { cecho "$*" $blue ;}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment