分立机器基站接入核心网并调试可用解决之路

news2025/1/1 23:40:20

问题描述

在两台机器上,分别为服务器A与主机B,其中服务器A上部署OAI核心网,主机B上部署容器版ueransim。两机器用一根网线连接。两台机器的连接如此:但是ueransim无法接入核心网。

解决思路1——机器网卡设置到192.168.70.0网段

将机器物理网卡网段设置到与核心网所在网段一致,192.168.70.x,ueransim直接接入。

发现1

两机器分别设置如下:

核心网A:

ens38:
                  addresses: [192.168.70.12/24]
                  dhcp4: no
                  gateway4: 192.168.70.1
                  nameservers:
                          addresses: [8.8.8.8,144.144.144.144,255.255.255.255]

主机B:

ens39:
                  addresses: [192.168.70.13/24]
                  dhcp4: no
                  gateway4: 192.168.70.1
                  nameservers:
                          addresses: [8.8.8.8,144.144.144.144,255.255.255.255]

两者可以互相ping通,但开启核心网后却无法互相ping通

进行如下修改,将对方网口作为自己的网关后,在开通核心网后可以ping通,但依旧无法ping通核心网

核心网A:

ens38:
                  addresses: [192.168.70.12/24]
                  dhcp4: no
                  gateway4: 192.168.70.12
                  nameservers:
                          addresses: [8.8.8.8,144.144.144.144,255.255.255.255]

主机B:

ens39:
                  addresses: [192.168.70.13/24]
                  dhcp4: no
                  gateway4: 192.168.70.13
                  nameservers:
                          addresses: [8.8.8.8,144.144.144.144,255.255.255.255]

经过在服务器A抓包,发现服务器A的192.168.70.12上有抓到来自192.168.70.13寻找192.168.70.1的ARP,但是却没有成功找到的返回
有来自192.168.70.13的寻找192.168.70.1的icmp包,但只有request, no response found

然后通过如下方法解决,让主机B可以ping到192.168.70.1:
在主机B上添加到192.168.70.0/24网段的路由:

sudo route add -net 192.168.70.0/24 gw 192.168.70.12

在服务器A添加到主机B的路由:

sudo route add -host 192.168.70.13 gw 192.168.70.12

在这里插入图片描述
然后启动ueransim测试:
在这里插入图片描述
无法启动,ueransim需要接入demo-oai等网桥,貌似无法接入另一台机器上的网桥。

但这样的网络配置可以作为非容器化ueransim的一种配置,中间不用换网段到192.168.12.x

解决思路2 docker-swarm

Docker Compose和Docker Swarm旨在实现完全集成,这意味着您可以将Compose应用程序指向Swarm集群,并使它们都像使用单个Docker主机一样正常工作。引用
manager是我们管理集群的入口,我们的docker命令都是在manager上执行,node节点上是不能执行dockr命令的

这里我将服务器A作为管理节点,主机B作为工作节点

在服务器A上,通过ssh接入想作为管理节点的服务器,然后执行swarm init命令,指定swarm管理机的IP地址:

#安装docker-ce
sudo apt-get update
sudo apt-get install docker-ce
#指定为管理节点,该节点ip为192.168.12.3
lab@lab-virtual-machine:~$ docker swarm init --advertise-addr 192.168.12.3

出现以下提示

Swarm initialized: current node (uowf6o6oftuh47y2qjgm7jqeh) is now a manager.

To add a worker to this swarm, run the following command:

    docker swarm join --token SWMTKN-1-2f3q3ajwud8mg8xw62zbs7k0hpw9ypss7qgqcyjdzw5dns4qxf-a9mnk42uf9tjh58yj8s00t4ta 192.168.12.3:2377

To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.

其中这里表示如何加入工作节点:

docker swarm join --token SWMTKN-1-2f3q3ajwud8mg8xw62zbs7k0hpw9ypss7qgqcyjdzw5dns4qxf-a9mnk42uf9tjh58yj8s00t4ta 192.168.12.3:2377

在主机B上将主机B设置为工作节点:

docker swarm join --token SWMTKN-1-2f3q3ajwud8mg8xw62zbs7k0hpw9ypss7qgqcyjdzw5dns4qxf-a9mnk42uf9tjh58yj8s00t4ta 192.168.12.3:2377

出现以下提示:

This node joined a swarm as a worker.

到此搭建了一个简单的swarm集群。

查看接入的节点:

lab@lab-virtual-machine:~$ docker node ls

在这里插入图片描述
查看创建的网络:

docker network ls

在这里插入图片描述
创建一个新网络:
网络模式需要选择overlay

docker network create -d overlay testnet

在这里插入图片描述
可是OAI核心网的网络模式是bridge,是否可以将其变成overlay?

将所有docker-compose-basic-vpp-nrf.yaml中的网络由bridge改为overlay:

networks:
    public_net:
        driver: overlay
        name: demo-oai-public-net
        ipam:
            config:
                - subnet: 192.168.70.0/24
        driver_opts:
            com.docker.network.bridge.name: "demo-oai"
    public_net_access:
        driver: overlay
        name: oai-public-access
        ipam:
            config:
                - subnet: 192.168.72.0/24
        driver_opts:
            com.docker.network.bridge.name: "cn5g-access"
    public_net_core:
        driver: overlay
        name: oai-public-core
        ipam:
            config:
                - subnet: 192.168.73.0/24
        driver_opts:
            com.docker.network.bridge.name: "cn5g-core"

然后使用docker stack启动

之前 swarm 集群中docker service create一次只能部署一个微服务,我们可以使用 docker stack + compose 一次启动多个服务
stack相关操作:

deploy      Deploy a new stack or update an existing stack
ls          List stacks
ps          List the tasks in the stack
rm          Remove one or more stacks
services    List the services in the stack
lab@lab-virtual-machine:~/oai-cn5g-fed/docker-compose$ docker stack deploy --compose-file docker-compose-basic-vpp-nrf.yaml oai

在这里插入图片描述
查看运行的服务:

docker service ls

在这里插入图片描述

查看容器运行状态:

docker service ps 容器名字

在这里插入图片描述

启动ueransim;

lab@lab-virtual-machine:~/oai-cn5g-fed/docker-compose$ sudo docker stack deploy --compose-file docker-compose-ueransim-vpp.yaml ueransim
[sudo] password for lab: 
WARN[0000] network public_net_access: network.external.name is deprecated in favor of network.name 
WARN[0000] network public_net: network.external.name is deprecated in favor of network.name 
Ignoring unsupported options: privileged

Ignoring deprecated options:

container_name: Setting the container name is not supported.

Error response from daemon: 2 matches found based on name: network demo-oai-public-net is ambiguous

其中前两个警告WARN【0000】是由于yaml文件网络external的格式不对,更改为如下后会消失:

networks:
    public_net:
        external: true
        name: demo-oai-public-net
    public_net_access:
        external: true
        name: oai-public-access

后面的警告Error response from daemon: 2 matches found based on name: network demo-oai-public-net is ambiguous是由于机器上docker network里的demo-oai-public-net有local与swarm两种
在这里插入图片描述
将其中local的部分删掉:

docker network rm f6dd0838cf68
docker network rm 34b108d99783
docker network rm f9b3e7f7b442

再次启动ueransim:

lab@lab-virtual-machine:~/oai-cn5g-fed/docker-compose$ sudo docker stack deploy --compose-file docker-compose-ueransim-vpp.yaml ueransim
Ignoring unsupported options: privileged

Ignoring deprecated options:

container_name: Setting the container name is not supported.

Creating service ueransim_ueransim

在这里插入图片描述

但是查看ueransim的日志,发现未能启动成功:
甚至连gnb都没有成功接入OAI核心网

lab@lab-virtual-machine:~/oai-cn5g-fed/docker-compose$ docker service logs 5iarfozcjdvi
WARNING: Error loading config file: /home/lab/.docker/config.json: open /home/lab/.docker/config.json: permission denied
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | Now setting these variables '@GTP_IP@ @IGNORE_STREAM_IDS@ @LINK_IP@ @MCC@ @MNC@ @NCI@ @NGAP_IP@ @NGAP_PEER_IP@ @SD_0@ @SD_1@ @SD_2@ @SST_0@ @SST_1@ @SST_2@ @TAC@'
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | Now setting these variables '@AMF_VALUE@ @APN@ @GNB_IP_ADDRESS@ @IMEI@ @IMEI_SV@ @IMSI@ @KEY@ @MCC@ @MNC@ @OP@ @OP_TYPE@ @PDU_TYPE@ @SD_C@ @SD_D@ @SD_R@ @SST_C@ @SST_D@ @SST_R@'
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | Done setting the configuration
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | ### Running ueransim ###
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | Running gnb
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | UERANSIM v3.2.5
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | [2023-04-17 07:30:40.606] [rls-udp] [error] RLS failure [Socket bind failed: Cannot assign requested address]
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | [2023-04-17 07:30:40.607] [sctp] [info] Trying to establish SCTP connection... (192.168.70.132:38412)
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | [2023-04-17 07:30:40.607] [gtp] [error] GTP/UDP task could not be created. Socket bind failed: Cannot assign requested address
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | Now setting these variables '@GTP_IP@ @IGNORE_STREAM_IDS@ @LINK_IP@ @MCC@ @MNC@ @NCI@ @NGAP_IP@ @NGAP_PEER_IP@ @SD_0@ @SD_1@ @SD_2@ @SST_0@ @SST_1@ @SST_2@ @TAC@'
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | [2023-04-17 07:30:40.613] [sctp] [error] Binding to 192.168.70.141:0 failed. SCTP bind failed: Cannot assign requested address
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | Now setting these variables '@AMF_VALUE@ @APN@ @GNB_IP_ADDRESS@ @IMEI@ @IMEI_SV@ @IMSI@ @KEY@ @MCC@ @MNC@ @OP@ @OP_TYPE@ @PDU_TYPE@ @SD_C@ @SD_D@ @SD_R@ @SST_C@ @SST_D@ @SST_R@'
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | Running ue
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | Done setting the configuration
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | UERANSIM v3.2.5
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | [2023-04-17 07:30:41.589] [nas] [info] UE switches to state [MM-DEREGISTERED/PLMN-SEARCH]
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | ### Running ueransim ###
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | [2023-04-17 07:30:43.791] [nas] [error] PLMN selection failure, no cells in coverage
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | [2023-04-17 07:30:45.993] [nas] [error] PLMN selection failure, no cells in coverage
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | Running gnb
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | [2023-04-17 07:30:46.592] [rrc] [warning] Acceptable cell selection failed, no cell is in coverage
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | UERANSIM v3.2.5
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | [2023-04-17 07:30:46.592] [rrc] [error] Cell selection failure, no suitable or acceptable cell found
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | [2023-04-17 07:30:47.094] [nas] [info] UE switches to state [MM-DEREGISTERED/NO-CELL-AVAILABLE]
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | [2023-04-17 07:31:53.735] [rls-udp] [error] RLS failure [Socket bind failed: Cannot assign requested address]
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | [2023-04-17 07:31:16.604] [rrc] [warning] Acceptable cell selection failed, no cell is in coverage
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | [2023-04-17 07:31:16.605] [rrc] [error] Cell selection failure, no suitable or acceptable cell found
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | [2023-04-17 07:31:53.737] [sctp] [info] Trying to establish SCTP connection... (192.168.70.132:38412)
ueransim_ueransim.1.4wxgx35hss0j@lab-virtual-machine    | [2023-04-17 07:31:16.823] [nas] [error] PLMN selection failure, no cells in coverage
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | [2023-04-17 07:31:53.737] [gtp] [error] GTP/UDP task could not be created. Socket bind failed: Cannot assign requested address
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | [2023-04-17 07:31:53.743] [sctp] [error] Binding to 192.168.70.141:0 failed. SCTP bind failed: Cannot assign requested address
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | Running ue
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | UERANSIM v3.2.5
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | [2023-04-17 07:31:54.719] [nas] [info] UE switches to state [MM-DEREGISTERED/PLMN-SEARCH]
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | [2023-04-17 07:31:56.921] [nas] [error] PLMN selection failure, no cells in coverage
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | [2023-04-17 07:31:59.124] [nas] [error] PLMN selection failure, no cells in coverage
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | [2023-04-17 07:31:59.722] [rrc] [warning] Acceptable cell selection failed, no cell is in coverage
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | [2023-04-17 07:31:59.722] [rrc] [error] Cell selection failure, no suitable or acceptable cell found
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | [2023-04-17 07:32:00.225] [nas] [info] UE switches to state [MM-DEREGISTERED/NO-CELL-AVAILABLE]
ueransim_ueransim.1.jygw0gvxxm32@lab-virtual-machine    | [2023-04-17 07:32:29.734] [rrc] [warning] Acceptable cell selection failed, no cell is in coverage

删除oai与ueransim服务:

docker stack rm oai
docker stack rm ueransim

将ueransim与oai合并到一起启动:
创建文件1.yaml

version: '3.8'
services:
    mysql:
        container_name: "mysql"
        image: mysql:8.0
        volumes:
            - ./database/oai_db2.sql:/docker-entrypoint-initdb.d/oai_db.sql
            - ./healthscripts/mysql-healthcheck2.sh:/tmp/mysql-healthcheck.sh
        environment:
            - TZ=Europe/Paris
            - MYSQL_DATABASE=oai_db
            - MYSQL_USER=test
            - MYSQL_PASSWORD=test
            - MYSQL_ROOT_PASSWORD=linux
        healthcheck:
            test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
            interval: 10s
            timeout: 5s
            retries: 30
        networks:
            public_net:
                ipv4_address: 192.168.70.131
    oai-udr:
        container_name: "oai-udr"
        image: oaisoftwarealliance/oai-udr:v1.5.0
        environment:
            - TZ=Europe/Paris
            - UDR_NAME=OAI_UDR
            - UDR_INTERFACE_NAME_FOR_NUDR=eth0
            - MYSQL_IPV4_ADDRESS=192.168.70.131
            - MYSQL_USER=test
            - MYSQL_PASS=test
            - MYSQL_DB=oai_db
            - WAIT_MYSQL=120
            - USE_FQDN_DNS=yes
            - REGISTER_NRF=yes
            - NRF_IPV4_ADDRESS=192.168.70.130
            - NRF_FQDN=oai-nrf
        depends_on:
            - mysql
            - oai-nrf
        networks:
            public_net:
                ipv4_address: 192.168.70.136
    oai-udm:
        container_name: "oai-udm"
        image: oaisoftwarealliance/oai-udm:v1.5.0
        environment:
            - TZ=Europe/Paris
            - UDM_NAME=OAI_UDM
            - SBI_IF_NAME=eth0
            - REGISTER_NRF=yes
            - USE_FQDN_DNS=yes
            - UDR_IP_ADDRESS=192.168.70.136
            - UDR_FQDN=oai-udr
            - NRF_IPV4_ADDRESS=192.168.70.130
            - NRF_FQDN=oai-nrf
        depends_on:
            - oai-udr
        networks:
            public_net:
                ipv4_address: 192.168.70.137
    oai-ausf:
        container_name: "oai-ausf"
        image: oaisoftwarealliance/oai-ausf:v1.5.0
        environment:
            - TZ=Europe/Paris
            - AUSF_NAME=OAI_AUSF
            - SBI_IF_NAME=eth0
            - USE_FQDN_DNS=yes
            - REGISTER_NRF=yes
            - UDM_IP_ADDRESS=192.168.70.137
            - UDM_FQDN=oai-udm
            - NRF_IPV4_ADDRESS=192.168.70.130
            - NRF_FQDN=oai-nrf
        depends_on:
            - oai-udm
        networks:
            public_net:
                ipv4_address: 192.168.70.138
    oai-nrf:
        container_name: "oai-nrf"
        image: oaisoftwarealliance/oai-nrf:v1.5.0
        environment:
            - TZ=Europe/Paris
            - NRF_INTERFACE_NAME_FOR_SBI=eth0
        networks:
            public_net:
                ipv4_address: 192.168.70.130
    oai-amf:
        container_name: "oai-amf"
        image: oaisoftwarealliance/oai-amf:v1.5.0
        environment:
            - TZ=Europe/paris
            - MCC=208
            - MNC=95
            - REGION_ID=128
            - AMF_SET_ID=1
            - SERVED_GUAMI_MCC_0=208
            - SERVED_GUAMI_MNC_0=95
            - SERVED_GUAMI_REGION_ID_0=128
            - SERVED_GUAMI_AMF_SET_ID_0=1
            - SERVED_GUAMI_MCC_1=460
            - SERVED_GUAMI_MNC_1=11
            - SERVED_GUAMI_REGION_ID_1=10
            - SERVED_GUAMI_AMF_SET_ID_1=1
            - PLMN_SUPPORT_MCC=208
            - PLMN_SUPPORT_MNC=95
            - PLMN_SUPPORT_TAC=0xa000
            # Slice 0 (222, 123)
            - SST_0=222
            - SD_0=123
            # Slice 0 (128, 12)
            - SST_1=128
            - SD_1=12
            - AMF_INTERFACE_NAME_FOR_NGAP=eth0
            - AMF_INTERFACE_NAME_FOR_N11=eth0
            # One single SMF instance
            - SMF_INSTANCE_ID_0=1
            - SMF_FQDN_0=oai-smf
            - SMF_IPV4_ADDR_0=192.168.70.133
            - SELECTED_0=true
            - NF_REGISTRATION=yes
            - SMF_SELECTION=yes
            - USE_FQDN_DNS=yes
            - EXTERNAL_AUSF=yes
            - EXTERNAL_UDM=no
            - EXTERNAL_NSSF=no
            - NRF_IPV4_ADDRESS=192.168.70.130
            - NRF_FQDN=oai-nrf
            - AUSF_IPV4_ADDRESS=192.168.70.138
            - AUSF_FQDN=oai-ausf
            - UDM_IPV4_ADDRESS=192.168.70.137
            - UDM_FQDN=oai-udm
            - INT_ALGO_LIST=[ "NIA1" , "NIA2"]
            - CIPH_ALGO_LIST=[ "NEA1" , "NEA2"]
        depends_on:
            - mysql
            - vpp-upf
            - oai-ext-dn
            - oai-ausf
        networks:
            public_net:
                ipv4_address: 192.168.70.132
    oai-smf:
        container_name: "oai-smf"
        image: oaisoftwarealliance/oai-smf:v1.5.0
        environment:
            - TZ=Europe/Paris
            - SMF_INTERFACE_NAME_FOR_N4=eth0
            - SMF_INTERFACE_NAME_FOR_SBI=eth0
            - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100
            - DEFAULT_DNS_SEC_IPV4_ADDRESS=8.8.8.8
            - AMF_IPV4_ADDRESS=192.168.70.132
            - AMF_FQDN=oai-amf
            - UDM_IPV4_ADDRESS=192.168.70.137
            - UDM_FQDN=oai-udm
            - UPF_IPV4_ADDRESS=192.168.70.201
            - UPF_FQDN_0=vpp-upf.node.5gcn.mnc95.mcc208.3gppnetwork.org
            - NRF_IPV4_ADDRESS=192.168.70.130
            - NRF_FQDN=oai-nrf
            - DEFAULT_CSCF_IPV4_ADDRESS=127.0.0.1  # only needed when ims is being used
            - USE_LOCAL_SUBSCRIPTION_INFO=yes  #Set to yes if SMF uses local subscription information instead of from an UDM
            - REGISTER_NRF=yes
            - DISCOVER_UPF=yes
            - USE_FQDN_DNS=yes
            - USE_NETWORK_INSTANCE=yes
            - ENABLE_USAGE_REPORTING=yes
            # Slice 0 (1, 0xFFFFFF)
            - DNN_NI0=oai
            - TYPE0=IPv4
            - DNN_RANGE0=12.1.1.151 - 12.1.1.253
            - NSSAI_SST0=1
            - SESSION_AMBR_UL0=200Mbps
            - SESSION_AMBR_DL0=400Mbps
            # Slice 1 (1, 1)
            - DNN_NI1=oai.ipv4
            - TYPE1=IPv4
            - DNN_RANGE1=12.1.1.51 - 12.1.1.150
            - NSSAI_SST1=1
            - NSSAI_SD1=1
            - SESSION_AMBR_UL1=100Mbps
            - SESSION_AMBR_DL1=200Mbps
            # Slice 2 (222, 123)
            - DNN_NI2=default
            - TYPE2=IPv4
            - DNN_RANGE2=12.1.1.2 - 12.1.1.50
            - NSSAI_SST2=222
            - NSSAI_SD2=123
            - SESSION_AMBR_UL2=50Mbps
            - SESSION_AMBR_DL2=100Mbps
            # Slice 3 for ims
            - DNN_NI3=ims
            - TYPE3=IPv4v6
            - DNN_RANGE3=14.1.1.2 - 14.1.1.253
        extra_hosts:
            - "vpp-upf.node.5gcn.mnc95.mcc208.3gppnetwork.org:192.168.70.201"
        depends_on:
            - oai-amf
        networks:
            public_net:
                ipv4_address: 192.168.70.133
    vpp-upf:
        privileged: true
        container_name: "vpp-upf"
        image: oaisoftwarealliance/oai-upf-vpp:v1.5.0
        environment:
            - IF_1_IP=192.168.70.201
            - IF_1_TYPE=N4
            - IF_2_IP=192.168.72.201
            - IF_2_TYPE=N3
            - IF_2_NWI=access.oai.org
            - IF_3_IP=192.168.73.201
            - IF_3_TYPE=N6
            - IF_3_IP_REMOTE=192.168.73.135 # EXT-DN IP Address
            - IF_3_NWI=internet.oai.org
            - NAME=VPP-UPF
            - MNC=95
            - MCC=208
            - REALM=3gppnetwork.org
            - VPP_MAIN_CORE=0
            - VPP_CORE_WORKER=1
#           - VPP_PLUGIN_PATH=/usr/lib64/vpp_plugins/                # RHEL7
            - VPP_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/vpp_plugins/ # Ubntu18.04
            - SNSSAI_SD=123
            - SNSSAI_SST=222
            - DNN=default
            - REGISTER_NRF=yes
            - NRF_IP_ADDR=192.168.70.130
            - NRF_PORT=80
            - HTTP_VERSION=1
        depends_on:
            - oai-nrf
        healthcheck:
            test: /bin/bash -c "pgrep vpp"
            interval: 10s
            timeout: 5s
            retries: 5
        networks:
            public_net:
                ipv4_address: 192.168.70.134
            public_net_access:
                ipv4_address: 192.168.72.134
            public_net_core:
                ipv4_address: 192.168.73.134
    oai-ext-dn:
        privileged: true
        init: true
        container_name: "oai-ext-dn"
        image: oaisoftwarealliance/trf-gen-cn5g:latest
        entrypoint: /bin/bash -c \
              "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
              "ip route add 12.1.1.0/24 via 192.168.73.201 dev eth0; ip route; sleep infinity"
        command: ["/bin/bash", "-c", "trap : SIGTERM SIGINT; sleep infinity & wait"]
        healthcheck:
            test: /bin/bash -c "iptables -L -t nat | grep MASQUERADE"
            interval: 10s
            timeout: 5s
            retries: 5
        networks:
            public_net_core:
                ipv4_address: 192.168.73.135
    ueransim:
        container_name: ueransim
        image: ueransim:latest
        privileged: true
        environment:
            # GNB Congig Parameters
            - MCC=208
            - MNC=95
            - NCI=0x000000010
            - TAC=0xa000
            - LINK_IP=192.168.70.141
            - NGAP_IP=192.168.70.141
            - GTP_IP=192.168.72.141
            - NGAP_PEER_IP=192.168.70.132
            - SST=222
            - SD=123
            - IGNORE_STREAM_IDS=true
            # UE Config Parameters
            - NUMBER_OF_UE=1
            - IMSI=208950000000041
            - KEY=0C0A34601D4F07677303652C0462535B
            - OP=63bfa50ee6523365ff14c1f45f88737d
            - OP_TYPE=OPC
            - AMF_VALUE=8000
            - IMEI=356938035643803
            - IMEI_SV=0035609204079514
            - GNB_IP_ADDRESS=192.168.70.141
            - PDU_TYPE=IPv4
            - APN=default
            - SST_0=222
            - SD_0=123
            - SST_C=222
            - SD_C=123
            - SST_D=222
            - SD_D=123
        healthcheck:
            test: /bin/bash -c "ifconfig uesimtun0"
            interval: 10s
            timeout: 5s
            retries: 5
        networks:
            public_net:
                ipv4_address: 192.168.70.141
            public_net_access:
                ipv4_address: 192.168.72.141
networks:
    public_net:
        driver: overlay
        name: demo-oai-public-net
        ipam:
            config:
                - subnet: 192.168.70.0/24
        driver_opts:
            com.docker.network.bridge.name: "demo-oai"
    public_net_access:
        driver: overlay
        name: oai-public-access
        ipam:
            config:
                - subnet: 192.168.72.0/24
        driver_opts:
            com.docker.network.bridge.name: "cn5g-access"
    public_net_core:
        driver: overlay
        name: oai-public-core
        ipam:
            config:
                - subnet: 192.168.73.0/24
        driver_opts:
            com.docker.network.bridge.name: "cn5g-core"

启动1.yaml:

lab@lab-virtual-machine:~/oai-cn5g-fed/docker-compose$ docker stack deploy --compose-file 1.yaml oaiue
WARNING: Error loading config file: /home/lab/.docker/config.json: open /home/lab/.docker/config.json: permission denied
Ignoring unsupported options: privileged

Ignoring deprecated options:

container_name: Setting the container name is not supported.

Creating network oai-public-access
Creating network oai-public-core
Creating network demo-oai-public-net
Creating service oaiue_ueransim
Creating service oaiue_vpp-upf
Creating service oaiue_oai-amf
Creating service oaiue_oai-udr
Creating service oaiue_oai-udm
Creating service oaiue_oai-ausf
Creating service oaiue_oai-nrf
Creating service oaiue_mysql
Creating service oaiue_oai-ext-dn
Creating service oaiue_oai-smf

这样运行的容器乱七八糟的分布在多个机器上,需要通过如下方式指定不同容器运行的节点:

利用docker-compose.yml文件中的deploy.placement.constraints属性

#指定manage或worker
deploy:
  replicas: 1
     placement:
        constraints:
          ## 常用方式指定 manager或者work节点
          - node.role == worker 
#指定主机名
deploy:
  replicas: 1
     placement:
        constraints:
          - node.hostname == docker1 

指定标签的方法:
node label 可以给一个或多个机器打上一个标签,然后再compose文件中指定节点标签,就可以部署在打上对应标签的机器上。具体步骤如下:

现在主节点机器上对所有节点机器进行打标签操作,命令如下:

docker node update --label-add role=标签名称  主机名
 
例如我要对一个主机名为docker1的机器打上一个标签为db的标签
docker node update --label-add role=db  docker1

deploy:
  replicas: 1
     placement:
        constraints:
          - node.labels.role == db

除此以外还有指定节点ID的方式

这里我采用指定manager与worker的方式:
将核心网部署在manager节点上,将ueransim部署在worker节点上

version: '3.8'
services:
    mysql:
        container_name: "mysql"
        image: mysql:8.0
        volumes:
            - ./database/oai_db2.sql:/docker-entrypoint-initdb.d/oai_db.sql
            - ./healthscripts/mysql-healthcheck2.sh:/tmp/mysql-healthcheck.sh
        environment:
            - TZ=Europe/Paris
            - MYSQL_DATABASE=oai_db
            - MYSQL_USER=test
            - MYSQL_PASSWORD=test
            - MYSQL_ROOT_PASSWORD=linux
        healthcheck:
            test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
            interval: 10s
            timeout: 5s
            retries: 30
        networks:
            public_net:
                ipv4_address: 192.168.70.131
        deploy:
          mode: global
          placement: 
             constraints: 
               - node.role == manager


    oai-udr:
        container_name: "oai-udr"
        image: oaisoftwarealliance/oai-udr:v1.5.0
        environment:
            - TZ=Europe/Paris
            - UDR_NAME=OAI_UDR
            - UDR_INTERFACE_NAME_FOR_NUDR=eth0
            - MYSQL_IPV4_ADDRESS=192.168.70.131
            - MYSQL_USER=test
            - MYSQL_PASS=test
            - MYSQL_DB=oai_db
            - WAIT_MYSQL=120
            - USE_FQDN_DNS=yes
            - REGISTER_NRF=yes
            - NRF_IPV4_ADDRESS=192.168.70.130
            - NRF_FQDN=oai-nrf
        depends_on:
            - mysql
            - oai-nrf
        networks:
            public_net:
                ipv4_address: 192.168.70.136
        deploy:
          mode: global
          placement: 
             constraints: 
               - node.role == manager

    oai-udm:
        container_name: "oai-udm"
        image: oaisoftwarealliance/oai-udm:v1.5.0
        environment:
            - TZ=Europe/Paris
            - UDM_NAME=OAI_UDM
            - SBI_IF_NAME=eth0
            - REGISTER_NRF=yes
            - USE_FQDN_DNS=yes
            - UDR_IP_ADDRESS=192.168.70.136
            - UDR_FQDN=oai-udr
            - NRF_IPV4_ADDRESS=192.168.70.130
            - NRF_FQDN=oai-nrf
        depends_on:
            - oai-udr
        networks:
            public_net:
                ipv4_address: 192.168.70.137
        deploy:
          mode: global
          placement: 
             constraints: 
               - node.role == manager

    oai-ausf:
        container_name: "oai-ausf"
        image: oaisoftwarealliance/oai-ausf:v1.5.0
        environment:
            - TZ=Europe/Paris
            - AUSF_NAME=OAI_AUSF
            - SBI_IF_NAME=eth0
            - USE_FQDN_DNS=yes
            - REGISTER_NRF=yes
            - UDM_IP_ADDRESS=192.168.70.137
            - UDM_FQDN=oai-udm
            - NRF_IPV4_ADDRESS=192.168.70.130
            - NRF_FQDN=oai-nrf
        depends_on:
            - oai-udm
        networks:
            public_net:
                ipv4_address: 192.168.70.138
        deploy:
          mode: global
          placement: 
             constraints: 
               - node.role == manager

    oai-nrf:
        container_name: "oai-nrf"
        image: oaisoftwarealliance/oai-nrf:v1.5.0
        environment:
            - TZ=Europe/Paris
            - NRF_INTERFACE_NAME_FOR_SBI=eth0
        networks:
            public_net:
                ipv4_address: 192.168.70.130
        deploy:
          mode: global
          placement: 
             constraints: 
               - node.role == manager

    oai-amf:
        container_name: "oai-amf"
        image: oaisoftwarealliance/oai-amf:v1.5.0
        environment:
            - TZ=Europe/paris
            - MCC=208
            - MNC=95
            - REGION_ID=128
            - AMF_SET_ID=1
            - SERVED_GUAMI_MCC_0=208
            - SERVED_GUAMI_MNC_0=95
            - SERVED_GUAMI_REGION_ID_0=128
            - SERVED_GUAMI_AMF_SET_ID_0=1
            - SERVED_GUAMI_MCC_1=460
            - SERVED_GUAMI_MNC_1=11
            - SERVED_GUAMI_REGION_ID_1=10
            - SERVED_GUAMI_AMF_SET_ID_1=1
            - PLMN_SUPPORT_MCC=208
            - PLMN_SUPPORT_MNC=95
            - PLMN_SUPPORT_TAC=0xa000
            # Slice 0 (222, 123)
            - SST_0=222
            - SD_0=123
            # Slice 0 (128, 12)
            - SST_1=128
            - SD_1=12
            - AMF_INTERFACE_NAME_FOR_NGAP=eth0
            - AMF_INTERFACE_NAME_FOR_N11=eth0
            # One single SMF instance
            - SMF_INSTANCE_ID_0=1
            - SMF_FQDN_0=oai-smf
            - SMF_IPV4_ADDR_0=192.168.70.133
            - SELECTED_0=true
            - NF_REGISTRATION=yes
            - SMF_SELECTION=yes
            - USE_FQDN_DNS=yes
            - EXTERNAL_AUSF=yes
            - EXTERNAL_UDM=no
            - EXTERNAL_NSSF=no
            - NRF_IPV4_ADDRESS=192.168.70.130
            - NRF_FQDN=oai-nrf
            - AUSF_IPV4_ADDRESS=192.168.70.138
            - AUSF_FQDN=oai-ausf
            - UDM_IPV4_ADDRESS=192.168.70.137
            - UDM_FQDN=oai-udm
            - INT_ALGO_LIST=[ "NIA1" , "NIA2"]
            - CIPH_ALGO_LIST=[ "NEA1" , "NEA2"]
        depends_on:
            - mysql
            - vpp-upf
            - oai-ext-dn
            - oai-ausf
        networks:
            public_net:
                ipv4_address: 192.168.70.132
        deploy:
          mode: global
          placement: 
             constraints: 
               - node.role == manager

    oai-smf:
        container_name: "oai-smf"
        image: oaisoftwarealliance/oai-smf:v1.5.0
        environment:
            - TZ=Europe/Paris
            - SMF_INTERFACE_NAME_FOR_N4=eth0
            - SMF_INTERFACE_NAME_FOR_SBI=eth0
            - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100
            - DEFAULT_DNS_SEC_IPV4_ADDRESS=8.8.8.8
            - AMF_IPV4_ADDRESS=192.168.70.132
            - AMF_FQDN=oai-amf
            - UDM_IPV4_ADDRESS=192.168.70.137
            - UDM_FQDN=oai-udm
            - UPF_IPV4_ADDRESS=192.168.70.201
            - UPF_FQDN_0=vpp-upf.node.5gcn.mnc95.mcc208.3gppnetwork.org
            - NRF_IPV4_ADDRESS=192.168.70.130
            - NRF_FQDN=oai-nrf
            - DEFAULT_CSCF_IPV4_ADDRESS=127.0.0.1  # only needed when ims is being used
            - USE_LOCAL_SUBSCRIPTION_INFO=yes  #Set to yes if SMF uses local subscription information instead of from an UDM
            - REGISTER_NRF=yes
            - DISCOVER_UPF=yes
            - USE_FQDN_DNS=yes
            - USE_NETWORK_INSTANCE=yes
            - ENABLE_USAGE_REPORTING=yes
            # Slice 0 (1, 0xFFFFFF)
            - DNN_NI0=oai
            - TYPE0=IPv4
            - DNN_RANGE0=12.1.1.151 - 12.1.1.253
            - NSSAI_SST0=1
            - SESSION_AMBR_UL0=200Mbps
            - SESSION_AMBR_DL0=400Mbps
            # Slice 1 (1, 1)
            - DNN_NI1=oai.ipv4
            - TYPE1=IPv4
            - DNN_RANGE1=12.1.1.51 - 12.1.1.150
            - NSSAI_SST1=1
            - NSSAI_SD1=1
            - SESSION_AMBR_UL1=100Mbps
            - SESSION_AMBR_DL1=200Mbps
            # Slice 2 (222, 123)
            - DNN_NI2=default
            - TYPE2=IPv4
            - DNN_RANGE2=12.1.1.2 - 12.1.1.50
            - NSSAI_SST2=222
            - NSSAI_SD2=123
            - SESSION_AMBR_UL2=50Mbps
            - SESSION_AMBR_DL2=100Mbps
            # Slice 3 for ims
            - DNN_NI3=ims
            - TYPE3=IPv4v6
            - DNN_RANGE3=14.1.1.2 - 14.1.1.253
        extra_hosts:
            - "vpp-upf.node.5gcn.mnc95.mcc208.3gppnetwork.org:192.168.70.201"
        depends_on:
            - oai-amf
        networks:
            public_net:
                ipv4_address: 192.168.70.133
        deploy:
          mode: global
          placement: 
             constraints: 
               - node.role == manager

    vpp-upf:
        privileged: true
        container_name: "vpp-upf"
        image: oaisoftwarealliance/oai-upf-vpp:v1.5.0
        environment:
            - IF_1_IP=192.168.70.201
            - IF_1_TYPE=N4
            - IF_2_IP=192.168.72.201
            - IF_2_TYPE=N3
            - IF_2_NWI=access.oai.org
            - IF_3_IP=192.168.73.201
            - IF_3_TYPE=N6
            - IF_3_IP_REMOTE=192.168.73.135 # EXT-DN IP Address
            - IF_3_NWI=internet.oai.org
            - NAME=VPP-UPF
            - MNC=95
            - MCC=208
            - REALM=3gppnetwork.org
            - VPP_MAIN_CORE=0
            - VPP_CORE_WORKER=1
#           - VPP_PLUGIN_PATH=/usr/lib64/vpp_plugins/                # RHEL7
            - VPP_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/vpp_plugins/ # Ubntu18.04
            - SNSSAI_SD=123
            - SNSSAI_SST=222
            - DNN=default
            - REGISTER_NRF=yes
            - NRF_IP_ADDR=192.168.70.130
            - NRF_PORT=80
            - HTTP_VERSION=1
        depends_on:
            - oai-nrf
        healthcheck:
            test: /bin/bash -c "pgrep vpp"
            interval: 10s
            timeout: 5s
            retries: 5
        networks:
            public_net:
                ipv4_address: 192.168.70.134
            public_net_access:
                ipv4_address: 192.168.72.134
            public_net_core:
                ipv4_address: 192.168.73.134
        deploy:
          mode: global
          placement: 
             constraints: 
               - node.role == manager

    oai-ext-dn:
        privileged: true
        init: true
        container_name: "oai-ext-dn"
        image: oaisoftwarealliance/trf-gen-cn5g:latest
        entrypoint: /bin/bash -c \
              "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
              "ip route add 12.1.1.0/24 via 192.168.73.201 dev eth0; ip route; sleep infinity"
        command: ["/bin/bash", "-c", "trap : SIGTERM SIGINT; sleep infinity & wait"]
        healthcheck:
            test: /bin/bash -c "iptables -L -t nat | grep MASQUERADE"
            interval: 10s
            timeout: 5s
            retries: 5
        networks:
            public_net_core:
                ipv4_address: 192.168.73.135
        deploy:
          mode: global
          placement: 
             constraints: 
               - node.role == manager

    ueransim:
        container_name: ueransim
        image: ueransim:latest
        privileged: true
        environment:
            # GNB Congig Parameters
            - MCC=208
            - MNC=95
            - NCI=0x000000010
            - TAC=0xa000
            - LINK_IP=192.168.70.141
            - NGAP_IP=192.168.70.141
            - GTP_IP=192.168.72.141
            - NGAP_PEER_IP=192.168.70.132
            - SST=222
            - SD=123
            - IGNORE_STREAM_IDS=true
            # UE Config Parameters
            - NUMBER_OF_UE=1
            - IMSI=208950000000041
            - KEY=0C0A34601D4F07677303652C0462535B
            - OP=63bfa50ee6523365ff14c1f45f88737d
            - OP_TYPE=OPC
            - AMF_VALUE=8000
            - IMEI=356938035643803
            - IMEI_SV=0035609204079514
            - GNB_IP_ADDRESS=192.168.70.141
            - PDU_TYPE=IPv4
            - APN=default
            - SST_0=222
            - SD_0=123
            - SST_C=222
            - SD_C=123
            - SST_D=222
            - SD_D=123
        healthcheck:
            test: /bin/bash -c "ifconfig uesimtun0"
            interval: 10s
            timeout: 5s
            retries: 5
        networks:
            public_net:
                ipv4_address: 192.168.70.141
            public_net_access:
                ipv4_address: 192.168.72.141
        deploy:
          mode: global
          placement: 
             constraints: 
               - node.role == worker

networks:
    public_net:
        driver: overlay
        name: demo-oai-public-net
        ipam:
            config:
                - subnet: 192.168.70.0/24
        driver_opts:
            com.docker.network.bridge.name: "demo-oai"
    public_net_access:
        driver: overlay
        name: oai-public-access
        ipam:
            config:
                - subnet: 192.168.72.0/24
        driver_opts:
            com.docker.network.bridge.name: "cn5g-access"
    public_net_core:
        driver: overlay
        name: oai-public-core
        ipam:
            config:
                - subnet: 192.168.73.0/24
        driver_opts:
            com.docker.network.bridge.name: "cn5g-core"

经过较长时间的等待后,启动结果如下:
核心网网元正常启动,ueransim未成功
在这里插入图片描述
对ueransim进行重启:

docker service ls  
docker service update --force 07ms7mdsk907

重启后依旧无法接入

将ueransim与核心网都部署到服务器A上,依旧同样的报错

再尝试将所有容器全部部署到主机B上
在这里插入图片描述
依旧不行

结点服务的可视化界面管理visualizer:

docker pull dockersamples/visualizer:latest
docker run -itd --name visualizer -p 8099:8080 -e HOST=192.168.12.3 -e PORT=8080 -v /var/run/docker.sock:/var/run/docker.sock dockersamples/visualizer:latest

然后在浏览器输入 192.168.12.3:8090访问
reference1
reference2
reference3:docker-compose+swarm

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/425258.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

常用AI网站精简版

1.ChatGPT:ChatGPThttps://chat.openai.com/ 2.Discord社区:(AI绘图midjourney)Discord | Midjourney AI生图https://discord.com/channels/@me3.文心一言:

套利策略样本外跟踪

量化策略开发,高质量社群,交易思路分享等相关内容 『正文』 ˇ 专享策略No.2 | 商品股指通用套利策略(一) 日线版本: 15分钟版本: 专享02模型开发步骤: 1.计算套利品种价比的高开低收,不是价差。 2.计…

231:vue+openlayers绘制点、点击此点弹出坐标复制和取消功能

第231个 点击查看专栏目录 本示例的目的是介绍演示如何在vue+openlayers项目绘制点、点击此点弹出坐标复制和取消功能,这里面的复制功能采用了ue-clipboard2插件。 直接复制下面的 vue+openlayers源代码,操作2分钟即可运行实现效果 示例效果 配置方式 1)查看基础设置:ht…

【数据挖掘与商务智能决策】第八章 K近邻算法

第八章 K近邻算法 1.K近邻算法简单代码演示 import pandas as pd df pd.read_excel(葡萄酒.xlsx) df原始样本酒精含量(%)苹果酸含量(%)分类0样本15201样本26102样本34103样本48314样本51021 # 特征变量和目标变量的切分 X_train df[[酒精含量(%),苹果酸含量(%)]] y_train …

安灯电子看板实时反馈产线上的生产状态

安灯电子看板是一种用于显示生产线运行情况的电子显示设备。它可以实时显示生产线的运行状态、异常信息以及工人的呼叫请求等信息,以便管理人员及时采取措施,保证生产线的正常运行。 安灯电子看板可以实现对生产线上各个环节的实时监控,并能够…

AutoGPT使用

windows和mac都可以使用 1,安装python 10 https://www.tutorialspoint.com/how-to-install-python-in-windows 2,下载AutoGPT代码 通过git克隆AutoGPT项目,git clone https://github.com/Torantulino/Auto-GPT.git如果没有安装git的同学就…

SalesForce-第一篇-概述

1. 直接一点,一上来就上图吧,这个是系统的前端页面,分为三个部分: 顶部的菜单栏,左下部的详细信息栏,以及右部相关信息栏位; 略微详细的为: a. 用户信息部分; b. 应用…

UDP套接字编程

文章目录一、IP地址和端口号二、网络字节序三、socket编程接口1.socket常见API2.sockaddr结构四、UDP套接字1.简单认识UDP协议2.利用UDP套接字实现网络版本大小写转换(1)服务端(2)客户端一、IP地址和端口号 IP协议目前有两个版本,分别是IPV4和IPV6,IP地…

【已解决】加载模型时报错:model_config = json.loads(model_config.decode(‘utf-8‘))

Author:AXYZdong 硕士在读 工科男 有一点思考,有一点想法,有一点理性! 定个小小目标,努力成为习惯!在最美的年华遇见更好的自己! CSDNAXYZdong,CSDN首发,AXYZdong原创 唯…

科普 | 带你了解设备振动监测常见术语

一、前言 状态监测是工厂预测维修和主动维修的基础,是企业优化资源,提升生产运营水平和市场竞争力的前提。成功开展状态监测将保证工厂设备长周期、满负荷、安全可靠地运行,避免非计划停机造成的损失,降低维修成本和生产成本。 …

如何高效的完成域名实名认证

根据注册局和工信部要求,需上传实名资料的域名有:.cn/.com/.net/.top/.xyz/.vip/.club/.ren/.wang/.shop/.xin/.中国/.信息等,相关要求请查看http://www.west.cn/faq/list.asp?unid1348。 如果您帐号下的域名较少,可以在域名管理…

【Dom获取属性操作】JavaScript 全栈体系(九)

Web APIs 第一章 Web API 基本认知 一、变量声明 变量声明有三个 var let 和 const建议: const 优先,尽量使用const,原因是: const 语义化更好很多变量我们声明的时候就知道他不会被更改了,那为什么不用 const呢&am…

数据结构_第十关:二叉树的顺序结构——堆

目录 1. 二叉树的顺序结构 2.堆的概念及结构 3.堆的实现 3.1堆向下调整算法 3.2堆的创建 3.3堆的插入 3.4建堆的复杂度 3.5堆的删除 4.堆的代码实现 4.1堆的定义 4.2堆的函数实现 1)堆的初始化 2)堆的销毁 3)堆的插入 4&#xf…

【0基础敲代码】如何使用使用SeaFile搭建私有云盘并公网访问

目录 1. 前言 2. SeaFile云盘设置 2.1 Owncould的安装环境设置 2.2 SeaFile下载安装 2.3 SeaFile的配置 3. cpolar内网穿透 3.1 Cpolar下载安装 3.2 Cpolar的注册 3.3 Cpolar云端设置 3.4 Cpolar本地设置 4. 公网访问测试 5. 结语 1. 前言 现在我们身边的只能设备…

VsCode SSH远程连接服务器【内网穿透公网连接】

文章目录1.前言2.VS code的安装和设置2.1 VS code的下载安装2.2 OpenSSH的启用2.3 为VS code配置ssh2.4 局域网内测试VS code的ssh连接2.5 Cpolar下载安装3.Cpolar端口设置3.1 Cpolar云端设置3.2 Cpolar本地设置4.公网访问测试5.结语1.前言 记得笔者小时候看电视,看…

Thinkphp常见漏洞利用

一、基础知识 1.ThinkPHP简介: ThinkPHP是一个开源,快速、简单的轻量级国产PHP开发框架,诞生于2006年初,原名FCS,2007年元旦正式更名为ThinkPHP。使用面向对象的开发结构和MVC模式,融合了Struts的思想和T…

【创建者模式】建造者模式

文章目录1、简介2、结构3、实现3.1、需求场景3.2、产品类3.3、抽象建造者类3.4、具体建造者类3.5、指挥者类3.6、测试类3.7、演示结果4、应用场景5、实操举例6、优缺点分析7、抽象工厂模式区别1、简介 建造者模式(Builder Pattern)旨在将一个复杂对象的构建与表示分离&#xf…

SpringCloud:ElasticSearch之索引库操作

ElasticSearch索引库就类似数据库表,mapping映射就类似表的结构。 我们要向ElasticSearch中存储数据,必须先创建“库”和“表”。 1.mapping映射属性 mapping是对索引库中文档的约束,常见的mapping属性包括: type:…

Hyperledger Fabric 2.2版本环境搭建

前言 部署环境: CentOS7.9 提前安装好以下工具 git客户端golangdockerdocker-composecurl工具 以下是个人使用的版本 git: 2.39.2golang: 1.18.6docker: 23.0.3dockkekr-compose: v2.17.2curl: 7.29.0 官方文档参考链接:跳转链接,不同的版本对应的官…

008:Mapbox GL添加比例尺scale功能

第008个 点击查看专栏目录 本示例的目的是介绍演示如何在vue+mapbox中添加比例尺scale功能 。 直接复制下面的 vue+mapbox源代码,操作2分钟即可运行实现效果 文章目录 示例效果配置方式示例源代码(共66行)相关API参考:专栏目标示例效果 配置方式 1)查看基础设置:https…