Centos7中安装EdgeX Foundry边缘计算
=====1. 环境设置 ======
OS: CentOS Linux release 7.8.2003 (Core)
IP: 47.108.146.200
=====2. 应用设置======
A)安装Docker 和Docker Compose:
docker-ce的安装前如果存在系统自带的docker,且版本较低,可以使用下面命令删除旧版本
1 | yum remove docker docker-common docker-selinux docker-engine |
更新yum包
1 |
|
安装需要的软件包
1 |
|
添加软件源信息
1 |
|
更新安装docker-ce
1 2 |
|
开启docker-ce
1 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # 注意: # 官方软件源默认启用了最新的软件,您可以通过编辑软件源的方式获取各个版本的软件包。例如官方并没有将测试版本的软件源置为可用,您可以通过以下方式开启。同理可以开启各种测试版本等。 # vim /etc/yum.repos.d/docker-ee.repo # 将[docker-ce-test]下方的enabled=0修改为enabled=1 # # 安装指定版本的Docker-CE: # Step 1: 查找Docker-CE的版本: # yum list docker-ce.x86_64 --showduplicates | sort -r # Loading mirror speeds from cached hostfile # Loaded plugins: branch, fastestmirror, langpacks # docker-ce.x86_64 17.03.1.ce-1.el7.centos docker-ce-stable # docker-ce.x86_64 17.03.1.ce-1.el7.centos @docker-ce-stable # docker-ce.x86_64 17.03.0.ce-1.el7.centos docker-ce-stable # Available Packages # Step2: 安装指定版本的Docker-CE: (VERSION例如上面的17.03.0.ce.1-1.el7.centos) # sudo yum -y install docker-ce-[VERSION] |
使用docker version验证docker安装成功:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
Client: Docker Engine - Community
Server: Docker Engine - Community
|
Docker-compose的安装:
更新软件源
1 2 |
|
安装docker-compose
1 |
|
验证docker-compose安装成功
1 2 3 4 5 |
docker-compose version 1.26.0, build unknown docker-py version: 4.2.1 CPython version: 3.8.2 OpenSSL version: OpenSSL 1.0.2k-fips 26 Jan 2017 |
=====3. EdgeX 部署======
A) 访问下载地址:https://github.com/edgexfoundry/developer-scripts/tree/master/releases
查看使用哪个版本的compose-file文件:此例子使用 EdgeX Foundry, Delhi, version 0.7.1 也就是下图中顺序第三个delhi/compose-files
下载文件:docker-compose-delhi-0.7.1.yml(此文件中包含了运行edgex的所有核心镜像)
B) 下载此文件内容到文件docker-compose.yml中(此例默认放在/root中)
1 2 3 4 5 6 |
total 16 -rw-------. 1 root root 1249 anaconda-ks.cfg -rw-r--r--. 1 root root 11419 docker-compose.yml
/root |
C) 由于你懂的原因,这里添加加速器:
此例采用的是daocloud的加速器,具体可以参考:https://www.daocloud.io/mirror
Linux环境使用下面的脚本:
1 |
|
D)查看要下周的核心镜像和拉取下载镜像
查看要下载的镜像名称
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
volume consul config-seed mongo logging notifications metadata data command scheduler
rulesengine device-virtual ui portainer |
拉取下载镜像:(全部一定要为done)
说明:Pulls images for services defined in a Compose file, but does not start the containers.
这里只是拉取镜像,但是并未启动镜像
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
E)启动镜像
注意:-d 选项表示 Docker Compose 以分离模式运行 EdgeX 容器(即在后台运行容器)如果没有 -d,容器将在终端运行。如果后续想要使用终端,必须先停止容器。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
F)(选看内容)如果不使用edgex了的时候可以关闭镜像
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
G)(选看内容)如果彻底不使用edgex了的时候可以删除镜像(谨慎操作)
1 |
|
1 |
|
H) 接上面的E, 启动以后验证镜像容器启动情况:
1 |
|
1 |
|
如下:edgex-config-seed 在启动后不久就会更改状态为Exit 0(这是正常情况,暂时不用管)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
通过GUI界面查看服务的情况:
在启动的服务中有一个consul服务(看下面红色标注的端口):
1 |
|
在浏览器输入本机IP(192.168.0.133)访问: http://192.168.0.133:8500
到此 edgex的核心服务安装部署完毕。
********************************************************************************
附录:如果需要跟踪容器的日志,使用docker
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
2020-06-10T12:32:00.487+0000 I ACCESS [conn27] Successfully authenticated as principal meta on metadata 2020-06-10T12:32:02.477+0000 I ACCESS [conn749] Successfully authenticated as principal core on coredata
2020-06-10T12:32:05.018+0000 I ACCESS [conn31] Successfully authenticated as principal logging on logging
2020-06-10T12:32:15.502+0000 I ACCESS [conn27] Successfully authenticated as principal meta on metadata 2020-06-10T12:32:17.476+0000 I ACCESS [conn30] Successfully authenticated as principal core on coredata 2020-06-10T12:32:20.019+0000 I ACCESS [conn66] Successfully authenticated as principal logging on logging
|
或者使用docker-compose
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
~]# docker-compose logs -f mongoedgex-mongo | 2020-06-10T08:48:32.516+0000 I - [conn152] end connection 172.18.0.4:35464 (17 connections now open)
edgex-mongo | 2020-06-10T08:48:39.969+0000 I ACCESS [conn31] Successfully authenticated as principal logging on logging
edgex-mongo | 2020-06-10T08:48:42.516+0000 I NETWORK [thread1] connection accepted from 172.18.0.4:35692 #153 (17 connections now open)
edgex-mongo | 2020-06-10T08:48:42.517+0000 I - [conn153] end connection 172.18.0.4:35692 (17 connections now open)
edgex-mongo | 2020-06-10T08:48:45.495+0000 I ACCESS [conn29] Successfully authenticated as principal core on coredata
edgex-mongo | 2020-06-10T08:48:45.517+0000 I ACCESS [conn23] Successfully authenticated as principal meta on metadata
edgex-mongo | 2020-06-10T08:48:47.483+0000 I ACCESS [conn29] Successfully authenticated as principal core on coredata
edgex-mongo | 2020-06-10T08:48:52.517+0000 I NETWORK [thread1] connection accepted from 172.18.0.4:35962 #154 (17 connections now open)
edgex-mongo | 2020-06-10T08:48:52.518+0000 I - [conn154] end connection 172.18.0.4:35962 (17 connections now open)
edgex-mongo | 2020-06-10T08:49:00.468+0000 I ACCESS [conn66] Successfully authenticated as principal logging on logging
edgex-mongo | 2020-06-10T08:49:00.503+0000 I ACCESS [conn23] Successfully authenticated as principal meta on metadata
edgex-mongo | 2020-06-10T08:49:02.486+0000 I ACCESS [conn30] Successfully authenticated as principal core on coredata
以上是 Centos7中安装EdgeX Foundry边缘计算 的全部内容, 来源链接: utcz.com/a/77631.html