离线安装测试环境docker 离线安装的文档参考 Install Docker Engine from binaries 验证离线安装的环境是否正确:
root@rbqntnwlflfxvigv:~/workspaces/Open-IM-Server-Enterprise/script# docker version && docker-compose versionClient: Version: 20.10.24 API version: 1.41 Go version: go1.20.4 Git commit: 297e128 Built: Wed May 24 23:30:52 2023 OS/Arch: linux/amd64 Context: default Experimental: trueServer: Engine: Version: 20.10.24 API version: 1.41 (minimum version 1.12) Go version: go1.20.4 Git commit: 5d6db84 Built: Wed May 24 23:31:22 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: v1.6.20 GitCommit: 2806fc1057397dbaeefbea0e4e17bddfbd388f38 runc: Version: 1.1.5 GitCommit: docker-init: Version: 0.19.0 GitCommit: de40ad0Docker Compose version v2.17.2安装包准备镜像下载:
scp -r [url=mailtoff-line@114.96.97.161]off-line@114.96.97.161[/url]:/home/off-line/openim-off-install/images.tar ./images.tar外网 scp 后迁移到 内网 中,密码是 123456。 安装的逻辑:
可以使用 docker 安装
使用 docker-compopse
docker-compose
先把im的docker-compose配置注释掉,用docker安装组件。
再源码编译im server,启动im
导入:docker save quay.io/coreos/etcd:latest | gzip > etcd.tar docker save grafana/grafana:latest | gzip > grafana.tardocker save wurstmeister/kafka:latest | gzip > kafka.tardocker save minio/minio:latest | gzip > minio.tardocker save mongo:4.0 | gzip > mongo.tardocker save mysql:5.7 | gzip > mysql.tardocker save quay.io/prometheus/node-exporter:latest | gzip > node-exporter.tar docker save prom/prometheus:latest | gzip > promethues.tardocker save redis:latest | gzip > redis.tardocker save zookeeper:latest| gzip > zookeeper.tar## OR ---docker stop $(docker ps -aq)for i in $(docker images -q);do docker save $i > $i.tardone离线安装中间件
scp images.tar.gz 到服务器, 并且解压文件
tar -zxvf ./images.tar.gz
加载每个镜像到docker里面
docker tag b1241b0087e5 minio/minio:latestdocker tag 173d3570a5af quay.io/prometheus/node-exporter:latestdocker tag 0ec8ab59a35f redis:latestdocker tag 0aa9adb9f6ef grafana/grafana:latestdocker tag 75972a31ad25 prom/prometheus:latestdocker tag dd6675b5cfea mysql:5.7docker tag 9a4968658ca4 openim/open_im_server:v2.3.8docker tag f6732aaf8367 openim/open_im_enterprise:v1.0.3docker tag 3502f0883719 openim/open_im_server:v2.3.2docker tag fb1435e8841c mongo:4.0docker tag a692873757c0 wurstmeister/kafka:latestdocker tag 3f43f72cb283 wurstmeister/zookeeper:latestdocker tag 61ad63875109 quay.io/coreos/etcd:latest etcd.tar grafana.tar kafka.tar minio.tar mongo.tar mysql.tar node-exporter.tar promethues.tar redis.tar zookeeper.tardocker 本地镜像导入:
docker load -i ./etcd.tar; docker load -i ./grafana.tar; docker load -i ./kafka.tar; docker load -i ./minio.tar; docker load -i ./mongo.tar; docker load -i ./mysql.tar; docker load -i ./node-exporter.tar; docker load -i ./promethues.tar; docker load -i ./redis.tar; docker load -i ./zookeeper.tar;# ---# OR -for img in minio/minio quay.io/prometheus/node-exporter redis grafana/grafana prom/prometheus mysql openim/open_im_server openim/open_im_enterprise openim/open_im_server mongo wurstmeister/kafka wurstmeister/zookeeper quay.io/coreos/etcd; do docker load -i ./$imgdone
验证导入
images=(minio/minio quay.io/prometheus/node-exporter redis grafana/grafana prom/prometheus mysql openim/open_im_server openim/open_im_enterprise openim/open_im_server mongo wurstmeister/kafka wurstmeister/zooke eper quay.io/coreos/etcd)for image in ${images[@]}; do docker inspect $image >/dev/null 2>&1 if [ $? -eq 0 ]; then echo "$image is running" else echo "$image is not running" fi done代码部分代码部分: