「连载」边缘计算(十五)02-02:云、边、端的部署与配置(基础篇)

97 阅读2分钟

(接上篇)

打开edgex-launch.sh:#vim edgex-go/bin/edgex-launch.sh,具体如下所示。

#!/bin/bash**
*#
# Copyright (c) 2018
# Mainflux
#
# SPDX-License-Identifier: Apache-2.0
#
**
###
# Launches all EdgeX Go binaries (must be previously built).
#
# Expects that Consul and MongoDB are already installed and running.
#
###
**
*DIR=$PWD
CMD=../cmd

# Kill all edgex - stuff**
*function cleanup {
pkill edgex
}

# disable secret-store integration*
*export EDGEX_SECURITY_SECRET_STORE=false

###*
# Support logging
###
*cd CMD/support-logging *# Add `* *edgex* *-` prefix on start, so we can find the process family** *exec -a edgex-support-logging ./support-logging & cd DIR

###*
# Core Command
###
*cd CMD/core-command *# Add `* *edgex* *-` prefix on start, so we can find the process family** *exec -a edgex-core-command ./core-command & cd DIR

###*
# Core Data
###
*cd CMD/core-data exec -a edgex-core-data ./core-data & cd DIR

###*
# Core Meta Data
###
*cd CMD/core-metadata exec -a edgex-core-metadata ./core-metadata & cd DIR

###*
# Support Notifications
###
*cd CMD/support-notifications *# Add `* *edgex* *-` prefix on start, so we can find the process family** *exec -a edgex-support-notifications ./support-notifications & cd DIR

###*
# System Management Agent
###
*cd CMD/sys-mgmt-agent *# Add `* *edgex* *-` prefix on start, so we can find the process family** *exec -a edgex-sys-mgmt-agent ./sys-mgmt-agent & cd DIR

# Support Scheduler*
###
*cd CMD/support-scheduler *# Add `* *edgex* *-` prefix on start, so we can find the process family** *exec -a edgex-support-scheduler ./support-scheduler & cd DIR

trap cleanup EXIT

while : ; do sleep 1 ; done

 

edgex-launch.sh主要做了3件事。

1)通过shell的内置命令exec将EdgeX Foundry的各组件以系统进程的方式运行起来;

2)通过一个while死循环将edgex-launch.sh以前台驻留进程的方式驻留在前台;

3)通过trap命令监听EXIT信号,并在监听到EXIT信号之后调用clean函数杀掉EdgeX Foundry的各组件以系统进程的方式运行起来的进程。

未完待续……」 点击下方标题可阅读技术文章

「连载」边缘计算(一)01-16:边缘计算系统(基础篇)

juejin.cn/post/732453…

「连载」边缘计算(二)01-16:边缘计算系统(基础篇)

juejin.cn/post/732452…

「连载」边缘计算(三)01-17:边缘计算系统(基础篇)

juejin.cn/post/732488…

「连载」边缘计算(四)01-18:边缘计算系统(基础篇)

juejin.cn/post/732525…

「连载」边缘计算(五)01-19:云、边、端的部署与配置(基础篇)

juejin.cn/post/732542…

「连载」边缘计算(六)01-22:云、边、端的部署与配置(基础篇)

juejin.cn/post/732657…

「连载」边缘计算(七)01-23:云、边、端的部署与配置(基础篇)

juejin.cn/post/732686…

「连载」边缘计算(八)01-24:云、边、端的部署与配置(基础篇)

juejin.cn/post/732719…

「连载」边缘计算(九)01-25:云、边、端的部署与配置(基础篇)

juejin.cn/post/732768…

「连载」边缘计算(十)01-26:云、边、端的部署与配置(基础篇)

juejin.cn/post/732798…

「连载」边缘计算(十一)01-29:云、边、端的部署与配置(基础篇)

juejin.cn/spost/73290…

「连载」边缘计算(十二)01-30:云、边、端的部署与配置(基础篇)

juejin.cn/post/732947…

「连载」边缘计算(十三)01-31:云、边、端的部署与配置(基础篇)

juejin.cn/post/732979…

「连载」边缘计算(十四)02-01:云、边、端的部署与配置(基础篇)

juejin.cn/post/733029…