参考地址:https://www.goodrain.com/info.html
https://www.rainbond.com/video.html
doc地址:https://www.rainbond.com/docs/
本实例演示快速安装:https://www.rainbond.com/docs/user-operations/install/online_install/

下载系统安装工具

  1. wget https://pkg.rainbond.com/releases/common/v5.1/grctl
  2. chmod +x ./grctl

初始化数据中心

# 建议使用root执行安装操作
./grctl init --iip 内网ip --eip 公网ip  --role master,compute

注意:安装速度跟网速有关。总共下载约2G的文件

TASK [node/up : Rainbond | Check goodrain.me] **********************************
changed: [dbf24d56-9f44-caae-1ddd-0a520de95870]
Thursday 11 July 2019  18:28:39 +0800 (0:00:00.245)       1:23:08.412 ********* 

TASK [node/up : Rainbond | Check check_ok] *************************************
ok: [dbf24d56-9f44-caae-1ddd-0a520de95870]
Thursday 11 July 2019  18:28:39 +0800 (0:00:00.403)       1:23:08.816 ********* 

TASK [node/up : The next task may take some time to execute] *******************
ok: [dbf24d56-9f44-caae-1ddd-0a520de95870] => {
    "msg": "The next task may take some time to execute: Waiting Pushing local images to goodrain.me"
}
Thursday 11 July 2019  18:28:39 +0800 (0:00:00.044)       1:23:08.861 ********* 

TASK [node/up : Rainbond | Push local images to goodrain.me] *******************
changed: [dbf24d56-9f44-caae-1ddd-0a520de95870]

PLAY RECAP *********************************************************************
dbf24d56-9f44-caae-1ddd-0a520de95870 : ok=212  changed=135  unreachable=0    failed=0    skipped=104  rescued=0    ignored=2   

Congrats! All goes well. :-)
Thursday 11 July 2019  18:35:49 +0800 (0:07:09.947)       1:30:18.808 ********* 
=============================================================================== 
node/init : init rainbond -------------------------------------------- 1228.97s
docker/image : Rainbond | Download base image tgz ok ----------------- 1085.37s
node/init : check init rainbond --------------------------------------- 628.60s
docker/image : Rainbond | Download rainbond image tgz ok -------------- 559.76s
docker/install : Docker | Install docker online ----------------------- 513.16s
node/up : Rainbond | Push local images to goodrain.me ----------------- 429.95s
docker/image : Rainbond | load image from local ok -------------------- 333.09s
docker/image : Rainbond | Unzip base image Ok ------------------------- 220.86s
docker/image : Rainbond | Unzip rainbond image Ok --------------------- 136.42s
docker/image : K8S | Copy tools ---------------------------------------- 30.36s
docker/image : Rainbond | Unpack k8s cni tools ------------------------- 25.91s
docker/image : K8S | Copy CNI ------------------------------------------ 21.24s
Gathering Facts -------------------------------------------------------- 19.40s
prepare : install centos package --------------------------------------- 16.86s
bootstrap : gather facts ----------------------------------------------- 15.52s
docker/install : Docker | pause while Docker restarts ------------------ 10.06s
docker/image : Generate certificate ------------------------------------- 9.30s
k8s/manage : Rainbond | Copy kubectl binary from deploy ----------------- 8.36s
prepare : remove centos firewall pkg ------------------------------------ 7.01s
prepare : Copy Rainbond Tools ------------------------------------------- 6.54s
 OK   

 >  控制台访问地址  http://192.168.26.136:7070 
 >  扩容节点  https://www.rainbond.com/docs/user-operations/management/add-node/ 
 >  操作文档  https://www.rainbond.com/docs/user-manual/ 
 >  社区  https://t.goodrain.com 
 >  查询当前数据中心信息  grctl show 
[/opt/rainbond/rainbond-ansible]# grctl show 
Code 500, Msg:500:Get https://region.goodrain.me:8443/v2/nodes/rule/manage: dial tcp 192.168.26.136:8443: connect: connection refused
exit status 1

image.png

启动容器出现失败的情况

笔者在安装成功之后发现三个容器启动失败。
而 rbd-chaos & rbd-worker 依赖rbd-db。
所以主要问题为解决rbd-db容器的失败

[root@base luoqiz]# docker ps -a
CONTAINER ID        IMAGE                                          COMMAND                  CREATED              STATUS                     PORTS               NAMES
a745963b3e49        goodrain.me/rbd-db:latest                      "/run.sh mysqld"         2 seconds ago        Exited (1) 1 second ago                        rbd-db
548ff296e858        goodrain.me/rbd-api:v5.1.5-release             "/run/entrypoint.sh …"   5 seconds ago        Up 5 seconds                                   rbd-api
d3cbb29c2e2b        goodrain.me/rbd-worker:v5.1.5-release          "/run/entrypoint.sh …"   6 seconds ago        Exited (1) 5 seconds ago                       rbd-worker
c2e42653842e        goodrain.me/rbd-eventlog:v5.1.5-release        "/run/entrypoint.sh …"   About a minute ago   Up About a minute                              rbd-eventlog
864e3a5bba8f        goodrain.me/rbd-app-ui:v5.1.5-release          "./entrypoint.sh"        About a minute ago   Up About a minute                              rbd-app-ui
0cd6d3d9f9a1        goodrain.me/calico-node:v3.3.1                 "start_runit"            About an hour ago    Up About an hour                               calico
5c646f2de62a        goodrain.me/rbd-monitor:v5.1.5-release         "/run/entrypoint.sh …"   About an hour ago    Up About an hour                               rbd-monitor
187e775136e6        goodrain.me/rbd-gateway:v5.1.5-release         "/run/entrypoint.sh …"   About an hour ago    Up About an hour                               rbd-gateway
a782917c18bf        goodrain.me/rbd-webcli:v5.1.5-release          "/entrypoint.sh --ho…"   About an hour ago    Up About an hour                               rbd-webcli
dbabff231bc2        goodrain.me/rbd-mq:v5.1.5-release              "/run/entrypoint.sh …"   About an hour ago    Up About an hour                               rbd-mq
70ff6c2a48fb        goodrain.me/kube-controller-manager:v1.10.13   "/run.sh --master=12…"   About an hour ago    Up About an hour                               kube-controller-manager
5de561feb32b        goodrain.me/kube-scheduler:v1.10.13            "/run.sh --logtostde…"   About an hour ago    Up About an hour                               kube-scheduler
5f58b2d0aea8        goodrain.me/kube-apiserver:v1.10.13            "/run.sh --insecure-…"   About an hour ago    Up About an hour                               kube-apiserver
f1722a1bddf0        goodrain.me/rbd-dns                            "/run/kube-dns --kub…"   About an hour ago    Up About an hour                               rbd-dns
2d0ce0ea71af        goodrain.me/rbd-repo:6.5.9                     "/bin/sh -c /entrypo…"   About an hour ago    Up About an hour                               rbd-repo
3fa1821bf75f        goodrain.me/rbd-registry:2.6.2                 "/entrypoint.sh /etc…"   About an hour ago    Up About an hour                               rbd-hub
0a1df812e5eb        goodrain.me/etcd:v3.2.25                       "/usr/local/bin/etcd…"   About an hour ago    Up About an hour                               etcd

image.png

查看日志。

[root@base luoqiz]# docker logs rbd-db
Time                 Id Command    Argument
mysqld, Version: 10.1.29-MariaDB-1~jessie (mariadb.org binary distribution). started with:
Tcp port: 3306  Unix socket: /data/tmp/mysqld.sock
Time                 Id Command    Argument
mysqld, Version: 10.1.29-MariaDB-1~jessie (mariadb.org binary distribution). started with:
Tcp port: 3306  Unix socket: /data/tmp/mysqld.sock
Time                 Id Command    Argument
mysqld, Version: 10.1.29-MariaDB-1~jessie (mariadb.org binary distribution). started with:
Tcp port: 3306  Unix socket: /data/tmp/mysqld.sock
Time                 Id Command    Argument
2019-07-11 19:11:17 140252081137600 [Note] mysqld (mysqld 10.1.29-MariaDB-1~jessie) starting as process 1 ...
2019-07-11 19:11:17 140252081137600 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2019-07-11 19:11:17 140252081137600 [Note] InnoDB: The InnoDB memory heap is disabled
2019-07-11 19:11:17 140252081137600 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-07-11 19:11:17 140252081137600 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-07-11 19:11:17 140252081137600 [Note] InnoDB: Compressed tables use zlib 1.2.8
2019-07-11 19:11:17 140252081137600 [Note] InnoDB: Using Linux native AIO
2019-07-11 19:11:17 140252081137600 [Note] InnoDB: Using SSE crc32 instructions
2019-07-11 19:11:17 140252081137600 [Note] InnoDB: Initializing buffer pool, size = 256.0M
2019-07-11 19:11:17 140252081137600 [Note] InnoDB: Completed initialization of buffer pool
2019-07-11 19:11:17 140252081137600 [Note] InnoDB: Restoring page 0 of tablespace 0
2019-07-11 19:11:17 140252081137600 [Warning] InnoDB: Doublewrite does not have page_no=0 of space: 0
2019-07-11 19:11:17 140252081137600 [ERROR] InnoDB: space header page consists of zero bytes in data file ./ibdata1
2019-07-11 19:11:17 140252081137600 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2019-07-11 19:11:17 140252081137600 [ERROR] Plugin 'InnoDB' init function returned error.
2019-07-11 19:11:17 140252081137600 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-07-11 19:11:17 140252081137600 [Note] Plugin 'FEEDBACK' is disabled.
2019-07-11 19:11:17 140252081137600 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2019-07-11 19:11:17 140252081137600 [ERROR] Unknown/unsupported storage engine: InnoDB
2019-07-11 19:11:17 140252081137600 [ERROR] Aborting

mysqld, Version: 10.1.29-MariaDB-1~jessie (mariadb.org binary distribution). started with:
Tcp port: 3306  Unix socket: /data/tmp/mysqld.sock
Time                 Id Command    Argument

解决方案:
删除数据库原来的数据,重新启动 rbd-db 容器,此时会正常启动

rm -rf /opt/rainbond/data/mysql/data/
docker start rbd-db

启动 rbd-chaos & rbd-worker (需要 rbd-db 正常启动)

/opt/rainbond/.init/updatedb.sh prepare
/opt/rainbond/.init/updatedb.sh migrate
/opt/rainbond/.init/updatedb.sh config

访问云帮地址

http://192.168.26.136:7070

创建应用提示资源不足

# 集群整体状态
grctl cluster

# 集群节点状态
grctl node list


[root@base luoqiz]# grctl cluster
                   Used/Total    Use of
CPU                 0/0          0%    
Memory             0/0           0%    
DistributedDisk    21Gb/59Gb     35.50%
+-------------------------+-----------------------+---------+
| Service                 | HealthyQuantity/Total | Message |
+-------------------------+-----------------------+---------+
| ClusterStatus           | healthy               |         |
| docker                  | 1/1                   |         |
| rbd-monitor             | 1/1                   |         |
| kubelet                 | 1/1                   |         |
| rbd-api                 | 1/1                   |         |
| rbd-mq                  | 1/1                   |         |
| storage                 | 1/1                   |         |
| kube-controller-manager | 1/1                   |         |
| rbd-hub                 | 1/1                   |         |
| kube-scheduler          | 1/1                   |         |
| nfs_server              | 1/1                   |         |
| rbd-db                  | 1/1                   |         |
| NodeInit                | 1/1                   |         |
| rbd-dns                 | 1/1                   |         |
| rbd-eventlog            | 1/1                   |         |
| rbd-gateway             | 1/1                   |         |
| rbd-repo                | 1/1                   |         |
| local-dns               | 1/1                   |         |
| rbd-app-ui              | 1/1                   |         |
| rbd-worker              | 1/1                   |         |
| calico                  | 1/1                   |         |
| etcd                    | 1/1                   |         |
| rbd-chaos               | 1/1                   |         |
| NodeUp                  | 1/1                   |         |
| Ready                   | 1/1                   |         |
| kube-apiserver          | 1/1                   |         |
| rbd-webcli              | 1/1                   |         |
+-------------------------+-----------------------+---------+

+--------------------------------------+----------------+----------+------------------------+---------+
| Uid                                  | IP             | HostName | NodeRole               | Status  |
+--------------------------------------+----------------+----------+------------------------+---------+
| 959eba4b-6bbe-4ad5-ba0f-ecfad17d378d | 192.168.26.136 | base     | manage,compute,gateway | offline |
+--------------------------------------+----------------+----------+------------------------+---------+

此时一个节点连接上集群了,但是未上线计算节点。只需要上线服务器资源即可 (使用uid)

grctl node up 959eba4b-6bbe-4ad5-ba0f-ecfad17d378d

命令

grclis stop  <服务名> //关闭云帮所有服务
grclis start  <服务名>
grclis upgrade <服务名/all/node/plugins>
grclis reset
# 建议使用root执行安装操作
grctl node add --host computexx --iip 计算节点IP --root-pass root用户密码 --role compute --install
示例:
grctl node add --host compute01 --iip 192.168.1.1 --root-pass 12345678 --role compute --install
grctl node list
# 确定节点处于健康状态上线节点
grctl node up <NodeID>