当前位置:   article > 正文

Linux安装kubeedge_亲测成功

kubeedge

先安装k8s

linux安装部署k8s(kubernetes)和解决遇到的坑

下载kubeedge需要的软件

官方github下载kubeedge地址

cloudcore.service文件下载地址

注意:下载对应的版本和架构

keadm-v1.5.0-linux-amd64.tar.gz
下面的2个文件可以不用下载,安装kubeedge时也会自动去下载到/etc/kubeedge/目录,我这里在线github下载很慢,所以提前下载好
kubeedge-v1.6.1-linux-amd64.tar.gz
cloudcore.service

如果github访问不了,或者太慢,可以给我留言或评论,我发给大家


#创建文件夹
mkdir /etc/kubeedge/

#把下载的软件复制到/etc/kubeedge/目录,可以不下载这2个文件,安装时会自动从github上在线下载到/etc/kubeedge/目录
#因为访问github很慢,我提前下载好
cp kubeedge-v1.6.1-linux-amd64.tar.gz /etc/kubeedge/
cp cloudcore.service /etc/kubeedge/ 

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

安装kubeedge的cloudcore

–advertise-address=“192.168.0.123” kubeedge的cloudcore的IP,edge边缘节点能访问的IP,如果公网访问,建议使用外网IP
–kubeedge-version=1.6.1 kubeedge的版本,会去下载指定版本的kubeedge包

#解压keadm
tar -zxvf keadm-v1.6.1-linux-amd64.tar.gz

#初始化安装kubeedge的cloudcore
./keadm-v1.6.1-linux-amd64/keadm/keadm init --advertise-address="192.168.0.123" --kubeedge-version=1.6.1

#输出如下信息成功:
version=1.6.1
Kubernetes version verification passed, KubeEdge installation will start...
W0511 14:35:30.146678    3524 warnings.go:67] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
W0511 14:35:30.154102    3524 warnings.go:67] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
W0511 14:35:30.159650    3524 warnings.go:67] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
W0511 14:35:30.164732    3524 warnings.go:67] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
Expected or Default KubeEdge version 1.6.1 is already downloaded and will checksum for it. 
kubeedge-v1.6.1-linux-amd64.tar.gz checksum: 
checksum_kubeedge-v1.6.1-linux-amd64.tar.gz.txt content: 
Expected or Default KubeEdge version 1.6.1 is already downloaded
[Run as service] start to download service file for cloudcore
[Run as service] success to download service file for cloudcore
kubeedge-v1.6.1-linux-amd64/
kubeedge-v1.6.1-linux-amd64/edge/
kubeedge-v1.6.1-linux-amd64/edge/edgecore
kubeedge-v1.6.1-linux-amd64/cloud/
kubeedge-v1.6.1-linux-amd64/cloud/csidriver/
kubeedge-v1.6.1-linux-amd64/cloud/csidriver/csidriver
kubeedge-v1.6.1-linux-amd64/cloud/admission/
kubeedge-v1.6.1-linux-amd64/cloud/admission/admission
kubeedge-v1.6.1-linux-amd64/cloud/cloudcore/
kubeedge-v1.6.1-linux-amd64/cloud/cloudcore/cloudcore
kubeedge-v1.6.1-linux-amd64/version

KubeEdge cloudcore is running, For logs visit:  /var/log/kubeedge/cloudcore.log
CloudCore started

#查看cloudcore的日志
vim /var/log/kubeedge/cloudcore.log
  • 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
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36

配置cloudcore开机自启动服务

#查看cloudcore启动情况
ps aux|grep cloudcore

#输出如下表示启动:
root     23498  0.1  0.3 1012544 48640 ?       Ssl  May12  13:11 /usr/local/bin/cloudcore

#查看端口 10000 10002 端口都有了
#没有netstat命令,安装:yum install net-tools -y
netstat -tpnl
#如下:
tcp6       0      0 :::10000                :::*                    LISTEN      23498/cloudcore     
tcp6       0      0 :::10002                :::*                    LISTEN      23498/cloudcore     

#查看cloudcore启动状态
systemctl status cloudcore

#如果没有设置开机启动服务则设置 复制开启自启动服务文件
cp /etc/kubeedge/cloudcore.service /etc/systemd/system/cloudcore.service

#添加文件权限
chmod +x /etc/systemd/system/cloudcore.service

#重新加载配置文件
systemctl daemon-reload

#查看cloudcore启动的进程id,然后杀掉
ps aux|grep cloudcore
#输出如下:
root     23498  0.1  0.3 1012544 48640 ?       Ssl  May12  13:12 /usr/local/bin/cloudcore
#杀掉
kill -9 23498

#启动cloudcore
systemctl start cloudcore

#设置开机自启动
systemctl enable cloudcore.service

#查看cloudcore开机启动状态 enabled:开启, disabled:关闭
systemctl is-enabled cloudcore.service
  • 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
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40

获取kubeedge的token

./keadm-v1.6.1-linux-amd64/keadm/keadm gettoken
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/黑客灵魂/article/detail/838379
推荐阅读
相关标签
  

闽ICP备14008679号