golang开发试水 - 开源工业互联网mainflux的部署和运行

golang开发试水 - 开源工业互联网mainflux的部署和运行,第1张

前言

mainflux是一款优秀的golang语言开发的开源工业互联网平台软件。这里讲述在该系统软件在ubuntu18.04系统下面部署和运行的过程。

一、准备工作 1)源代码下载

git clone https://github.com/mainflux/mainflux.git

2)docker安装

sudo apt-get install docker-io

3)docker-compose安装

下载docker-compose

curl -SL https://github.com/docker/compose/releases/download/v2.4.1/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose

设置环境变量,将下面一行加入到root目录下下面的.bashrc文件末尾。

export PATH=$PATH:~/.docker/cli-plugins

二、运行mainflux

进入mainflux目录执行make run命令,出现下面的一个错误。

root@ubuntu:/home/shane/mainflux# make run
docker-compose -f docker/docker-compose.yml up
[+] Running 0/18
 ⠹ nats Pulling                                                                     0.2s
 ⠹ auth-redis Pulling                                                           0.2s
 ⠹ coap-adapter Pulling                                                             0.2s
 ⠹ mqtt-adapter Pulling                                                             0.2s
 ⠹ http-adapter Pulling                                                             0.2s
 ⠹ keto-migrate Pulling                                                             0.2s
 ⠹ users Pulling                                                                    0.2s
 ⠹ auth Pulling                                                                     0.1s
 ⠹ es-redis Pulling                                                                 0.1s
 ⠹ jaeger Pulling                                                                   0.1s
 ⠹ vernemq Pulling                                                                  0.1s
 ⠹ things-db Pulling                                                                0.1s
 ⠹ keto-db Pulling                                                                  0.1s
 ⠹ auth-db Pulling                                                                  0.1s
 ⠹ users-db Pulling                                                                 0.1s
 ⠙ keto Pulling                                                                     0.1s
 ⠙ things Pulling                                                                   0.1s
 ⠋ nginx Pulling                                                                    0.1s
error getting credentials - err: exit status 1, out: `The connection is closed`

删除golang-docker-credential-helpers之后,问题修复。

sudo apt-get remove golang-docker-credential-helpers

三、mainflux运行状态

重新运行make run之后,系统进入正常运转状态。

mainflux-auth-db       | fixing permissions on existing directory /var/lib/postgresql/data ... ok
mainflux-auth-db       | creating subdirectories ... ok
mainflux-auth-db       | selecting dynamic shared memory implementation ... posix
mainflux-auth-db       | selecting default max_connections ... 100
mainflux-users-db      | The files belonging to this database system will be owned by user "postgres".
mainflux-users-db      | This user must also own the server process.
mainflux-users-db      |
mainflux-users-db      | The database cluster will be initialized with locale "en_US.utf8".
mainflux-users-db      | The default database encoding has accordingly been set to "UTF8".
mainflux-users-db      | The default text search configuration will be set to "english".
mainflux-users-db      |
mainflux-users-db      | Data page checksums are disabled.
mainflux-users-db      |
mainflux-users-db      | fixing permissions on existing directory /var/lib/postgresql/data ... ok
mainflux-users-db      | creating subdirectories ... ok
mainflux-users-db      | selecting dynamic shared memory implementation ... posix

后记

至此mainflux的系统已经正常部署和运行起来了,然而golang开发才刚刚开始。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/990498.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-21
下一篇 2022-05-21

发表评论

登录后才能评论

评论列表(0条)

保存