[K8S:命令执行:权限异常:解决篇]:通过更新kubeconfig配置相关信息

news2024/11/25 15:57:34

文章目录

  • 一:场景复现:
    • 1.1:关键信息:
    • 1.2:全异常日志输出:
  • 二:解决流程:
    • 2.1:更新 kubeconfig:
      • 2.1.1:执行命令:
    • 2.2:再次执行之前的异常命令:
    • 2.3:k8s配置操作config相关命令:
    • 2.4:重新执行之前操作失效命令:
    • 2.5:[解决]:重新启动机器后发现kubectl apply -f相关命令又失效无权限相关:
      • 2.5.1:异常日志显示:
      • 2.5.2:解决方式:执行export KUBECONFIG=/root/.kube/config / chmod g-r /root/.kube/config

一:场景复现:

1.1:关键信息:

执行K8S相关命令显示关键信息

Name: "calico-config", Namespace: "kube-system"
from server for: "calico.yaml": configmaps "calico-config" is forbidden: User "system:node:vboxnode3ccccccttttttchenyang" cannot ge API group "" in the namespace "kube-system": no relationship found between node 'vboxnode3ccccccttttttchenyang' and this object
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "bgpconfigurations.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "bgpconfigurations.crd.projectcalico.org" is forbiddnode3ccccccttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "bgppeers.crd.projectcalico.org", Namespace: ""

1.2:全异常日志输出:

[root@vboxnode3ccccccttttttchenyang ~]# kubectl apply -f calico.yaml
^[[Aerror parsing calico.yaml: error converting YAML to JSON: yaml: line 153: found character that cannot start any token
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "/v1, Resource=configmaps", GroupVersionKind: "/v1, Kind=ConfigMap"
Name: "calico-config", Namespace: "kube-system"
from server for: "calico.yaml": configmaps "calico-config" is forbidden: User "system:node:vboxnode3ccccccttttttchenyang" cannot ge API group "" in the namespace "kube-system": no relationship found between node 'vboxnode3ccccccttttttchenyang' and this object
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "bgpconfigurations.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "bgpconfigurations.crd.projectcalico.org" is forbiddnode3ccccccttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "bgppeers.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "bgppeers.crd.projectcalico.org" is forbidden: User ccttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "blockaffinities.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "blockaffinities.crd.projectcalico.org" is forbiddende3ccccccttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "caliconodestatuses.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "caliconodestatuses.crd.projectcalico.org" is forbidxnode3ccccccttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scop
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "clusterinformations.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "clusterinformations.crd.projectcalico.org" is forbioxnode3ccccccttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster sco
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "felixconfigurations.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "felixconfigurations.crd.projectcalico.org" is forbioxnode3ccccccttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster sco
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "globalnetworkpolicies.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "globalnetworkpolicies.crd.projectcalico.org" is forvboxnode3ccccccttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster s
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "globalnetworksets.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "globalnetworksets.crd.projectcalico.org" is forbiddnode3ccccccttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "hostendpoints.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "hostendpoints.crd.projectcalico.org" is forbidden: 3ccccccttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "ipamblocks.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "ipamblocks.crd.projectcalico.org" is forbidden: Useccccttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "ipamconfigs.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "ipamconfigs.crd.projectcalico.org" is forbidden: Uscccccttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "ipamhandles.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "ipamhandles.crd.projectcalico.org" is forbidden: Uscccccttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "ippools.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "ippools.crd.projectcalico.org" is forbidden: User "cttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "ipreservations.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "ipreservations.crd.projectcalico.org" is forbidden:e3ccccccttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "kubecontrollersconfigurations.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "kubecontrollersconfigurations.crd.projectcalico.orgem:node:vboxnode3ccccccttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the c
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "networkpolicies.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "networkpolicies.crd.projectcalico.org" is forbiddende3ccccccttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "apiextensions.k8s.io/v1, Resource=customresourcedefinitions", GroupVersionKind: "apiextensions.k8s.io/v1, Kind=CustomRes
Name: "networksets.crd.projectcalico.org", Namespace: ""
from server for: "calico.yaml": customresourcedefinitions.apiextensions.k8s.io "networksets.crd.projectcalico.org" is forbidden: Uscccccttttttchenyang" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "rbac.authorization.k8s.io/v1, Resource=clusterroles", GroupVersionKind: "rbac.authorization.k8s.io/v1, Kind=ClusterRole"
Name: "calico-kube-controllers", Namespace: ""
from server for: "calico.yaml": clusterroles.rbac.authorization.k8s.io "calico-kube-controllers" is forbidden: User "system:node:vbg" cannot get resource "clusterroles" in API group "rbac.authorization.k8s.io" at the cluster scope
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "rbac.authorization.k8s.io/v1, Resource=clusterrolebindings", GroupVersionKind: "rbac.authorization.k8s.io/v1, Kind=Clust
Name: "calico-kube-controllers", Namespace: ""
from server for: "calico.yaml": clusterrolebindings.rbac.authorization.k8s.io "calico-kube-controllers" is forbidden: User "system:chenyang" cannot get resource "clusterrolebindings" in API group "rbac.authorization.k8s.io" at the cluster scope
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "rbac.authorization.k8s.io/v1, Resource=clusterroles", GroupVersionKind: "rbac.authorization.k8s.io/v1, Kind=ClusterRole"
Name: "calico-node", Namespace: ""
from server for: "calico.yaml": clusterroles.rbac.authorization.k8s.io "calico-node" is forbidden: User "system:node:vboxnode3ccccct resource "clusterroles" in API group "rbac.authorization.k8s.io" at the cluster scope
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "rbac.authorization.k8s.io/v1, Resource=clusterrolebindings", GroupVersionKind: "rbac.authorization.k8s.io/v1, Kind=Clust
Name: "calico-node", Namespace: ""
from server for: "calico.yaml": clusterrolebindings.rbac.authorization.k8s.io "calico-node" is forbidden: User "system:node:vboxnodnnot get resource "clusterrolebindings" in API group "rbac.authorization.k8s.io" at the cluster scope

二:解决流程:

2.1:更新 kubeconfig:

2.1.1:执行命令:

export KUBECONFIG=/root/.kube/config
chmod g-r /root/.kube/config

2.2:再次执行之前的异常命令:

[root@vboxnode3ccccccttttttchenyang ~]#  kubectl get deployment
Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")
[root@vboxnode3ccccccttttttchenyang ~]# kubectl apply -f calico.yaml
Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")

在这里插入图片描述

2.3:k8s配置操作config相关命令:

这一步应该在安装K8S kubeadm init后面执行,之前安装忘记这一步。

 mkdir -p $HOME/.kube
 sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
 sudo chown $(id -u):$(id -g) $HOME/.kube/config

[root@vboxnode3ccccccttttttchenyang ~]# mkdir -p $HOME/.kube
[root@vboxnode3ccccccttttttchenyang ~]#
[root@vboxnode3ccccccttttttchenyang ~]# sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
cp:是否覆盖"/root/.kube/config"? y
[root@vboxnode3ccccccttttttchenyang ~]# sudo chown ( i d − u ) : (id -u): (idu):(id -g) $HOME/.kube/config
在这里插入图片描述
在这里插入图片描述

2.4:重新执行之前操作失效命令:

可以看见都已经生效:

kubectl get nodes -o wide
kubectl apply -f calico.yaml
[root@vboxnode3ccccccttttttchenyang ~]# kubectl get nodes -o wide
NAME                            STATUS     ROLES                  AGE   VERSION   INTERNAL-IP      EXTERNAL-IP   OS-IMAGE                KERNEL-VERSION                CONTAINER-RUNTIME
chenyang-mine-vbox02            NotReady   <none>                 19h   v1.21.0   192.168.56.102   <none>        CentOS Linux 7 (Core)   3.10.0-1160.88.1.el7.x86_64   docker://23.0.5
vboxnode3ccccccttttttchenyang   NotReady   control-plane,master   19h   v1.21.0   192.168.56.103   <none>        CentOS Linux 7 (Core)   3.10.0-1160.90.1.el7.x86_64   docker://23.0.5
[root@vboxnode3ccccccttttttchenyang ~]# kubectl apply -f calico.yaml
configmap/calico-config created
customresourcedefinition.apiextensions.k8s.io/bgpconfigurations.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/bgppeers.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/blockaffinities.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/caliconodestatuses.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/clusterinformations.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/felixconfigurations.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/globalnetworkpolicies.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/globalnetworksets.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/hostendpoints.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/ipamblocks.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/ipamconfigs.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/ipamhandles.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/ippools.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/ipreservations.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/kubecontrollersconfigurations.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/networkpolicies.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/networksets.crd.projectcalico.org created
clusterrole.rbac.authorization.k8s.io/calico-kube-controllers created
clusterrolebinding.rbac.authorization.k8s.io/calico-kube-controllers created
clusterrole.rbac.authorization.k8s.io/calico-node created
clusterrolebinding.rbac.authorization.k8s.io/calico-node created
error: error parsing calico.yaml: error converting YAML to JSON: yaml: line 153: found character that cannot start any token
[root@vboxnode3ccccccttttttchenyang ~]#

在这里插入图片描述

2.5:[解决]:重新启动机器后发现kubectl apply -f相关命令又失效无权限相关:

2.5.1:异常日志显示:

[root@vboxnode3ccccccttttttchenyang ~]# vim calico.yaml
-bash: vim: 未找到命令
[root@vboxnode3ccccccttttttchenyang ~]# vi calico.yaml
[root@vboxnode3ccccccttttttchenyang ~]# kubectl apply -f calico.yaml
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "policy/v1, Resource=poddisruptionbudgets", GroupVersionKind: "policy/v1, Kind=PodDisruptionBudget"
Name: "calico-kube-controllers", Namespace: "kube-system"
from server for: "calico.yaml": poddisruptionbudgets.policy "calico-kube-controllers" is forbidden: User "system:node:vboxnode3cccc                                                                 ccttttttchenyang" cannot get resource "poddisruptionbudgets" in API group "policy" in the namespace "kube-system"
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "/v1, Resource=serviceaccounts", GroupVersionKind: "/v1, Kind=ServiceAccount"
Name: "calico-kube-controllers", Namespace: "kube-system"
from server for: "calico.yaml": serviceaccounts "calico-kube-controllers" is forbidden: User "system:node:vboxnode3ccccccttttttchen                                                                 yang" cannot get resource "serviceaccounts" in API group "" in the namespace "kube-system": can only create tokens for individual s                                                                 ervice accounts
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "/v1, Resource=serviceaccounts", GroupVersionKind: "/v1, Kind=ServiceAccount"
Name: "calico-node", Namespace: "kube-system"
from server for: "calico.yaml": serviceaccounts "calico-node" is forbidden: User "system:node:vboxnode3ccccccttttttchenyang" cannot                                                                  get resource "serviceaccounts" in API group "" in the namespace "kube-system": can only create tokens for individual service accou                                                                 nts

在这里插入图片描述

2.5.2:解决方式:执行export KUBECONFIG=/root/.kube/config / chmod g-r /root/.kube/config

export KUBECONFIG=/root/.kube/config
chmod g-r /root/.kube/config
kubectl apply -f calico.yaml

[root@vboxnode3ccccccttttttchenyang ~]# export KUBECONFIG=/root/.kube/config
[root@vboxnode3ccccccttttttchenyang ~]# chmod g-r /root/.kube/config
[root@vboxnode3ccccccttttttchenyang ~]# kubectl apply -f calico.yaml

kubectl delete pod coredns-545d6fc579-6ddhj coredns-545d6fc579-nkk68 -n kube-system

[root@vboxnode3ccccccttttttchenyang ~]# export KUBECONFIG=/root/.kube/config
[root@vboxnode3ccccccttttttchenyang ~]# chmod g-r /root/.kube/config
[root@vboxnode3ccccccttttttchenyang ~]# kubectl apply -f calico.yaml
poddisruptionbudget.policy/calico-kube-controllers created
serviceaccount/calico-kube-controllers created
serviceaccount/calico-node created
configmap/calico-config unchanged
customresourcedefinition.apiextensions.k8s.io/bgpconfigurations.crd.projectcalico.org configured
customresourcedefinition.apiextensions.k8s.io/bgppeers.crd.projectcalico.org configured
customresourcedefinition.apiextensions.k8s.io/blockaffinities.crd.projectcalico.org configured
customresourcedefinition.apiextensions.k8s.io/caliconodestatuses.crd.projectcalico.org configured
customresourcedefinition.apiextensions.k8s.io/clusterinformations.crd.projectcalico.org configured
customresourcedefinition.apiextensions.k8s.io/felixconfigurations.crd.projectcalico.org configured
customresourcedefinition.apiextensions.k8s.io/globalnetworkpolicies.crd.projectcalico.org configured
customresourcedefinition.apiextensions.k8s.io/globalnetworksets.crd.projectcalico.org configured
customresourcedefinition.apiextensions.k8s.io/hostendpoints.crd.projectcalico.org configured
customresourcedefinition.apiextensions.k8s.io/ipamblocks.crd.projectcalico.org configured
customresourcedefinition.apiextensions.k8s.io/ipamconfigs.crd.projectcalico.org configured
customresourcedefinition.apiextensions.k8s.io/ipamhandles.crd.projectcalico.org configured
customresourcedefinition.apiextensions.k8s.io/ippools.crd.projectcalico.org configured
customresourcedefinition.apiextensions.k8s.io/ipreservations.crd.projectcalico.org configured
customresourcedefinition.apiextensions.k8s.io/kubecontrollersconfigurations.crd.projectcalico.org configured
customresourcedefinition.apiextensions.k8s.io/networkpolicies.crd.projectcalico.org configured
customresourcedefinition.apiextensions.k8s.io/networksets.crd.projectcalico.org configured
clusterrole.rbac.authorization.k8s.io/calico-kube-controllers configured
clusterrole.rbac.authorization.k8s.io/calico-node configured
clusterrolebinding.rbac.authorization.k8s.io/calico-kube-controllers unchanged
clusterrolebinding.rbac.authorization.k8s.io/calico-node unchanged
daemonset.apps/calico-node created
deployment.apps/calico-kube-controllers created
[root@vboxnode3ccccccttttttchenyang ~]#

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/845041.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Android平台一对一音视频通话方案对比:WebRTC VS RTMP VS RTSP

一对一音视频通话使用场景 一对一音视频通话都需要稳定、清晰和流畅&#xff0c;以确保良好的用户体验&#xff0c;常用的使用场景如下&#xff1a; 社交应用&#xff1a;社交应用是一种常见的使用场景&#xff0c;用户可以通过音视频通话进行面对面的交流&#xff1b;在线教…

Android google admob Timeout for show call succeed 问题解决

项目场景&#xff1a; 项目中需要接入 google admob sdk 实现广告商业化 问题描述 在接入Institial ad 时&#xff0c;onAdLoaded 成功回调&#xff0c;但是onAdFailedToShowFullScreenContent 也回调了错误信息 “Timeout for show call succeed.” InterstitialAd.load(act…

算法刷题之路

刷题历程 - - - 基本数据结构 - - -数组、字符串、堆、栈、队列、链表739.每日温度&#xff08;栈&#xff09;155. 最小栈20. 有效的括号581.最短无序连续数组169. 多数元素&#xff08;数组&#xff09;136.只出现一次的数字128.最长连续序列560.和为k的子数组&#xff08;组…

yolo使用说明

yolo-v5代码 一、环境准备 yolo-v5更像是一个工程 算法和v4差不多&#xff0c;只是细节有所不同 拉取代码 环境要求 因为v6用到了torch1.6中的混合精度 二、数据准备 训练使用的是coco数据集 coco数据集很大&#xff0c;训练起来费时间&#xff0c;可以直接用自己数据集来做…

三、axios+vue

Axios 导入&#xff1a; <script src"https://unpkg.com/axios/dist/axios.min.js"></script> 基础语法&#xff1a; axios.get(?keyvalue&key2value2).then(function(response){},function(err){} axios.post(地址&#xff0c;{key:value,key2…

IDEA常用插件介绍

1.CodeGlance&#xff08;CodeGlance Pro&#xff09; 安装后&#xff0c;重新启动编译器即可。 CodeGlance是一款非常好用的代码地图插件&#xff0c;可以在代码编辑区的右侧生成一个竖向可拖动的代码缩略区&#xff0c;可以快速定位代码的同时&#xff0c;并且提供放大镜功能…

DARPA TC-engagement5数据集解析为json格式输出到本地

关于这个数据集的一些基本信息就不赘述了&#xff0c;参考我之前的博客。DARPA TC-engagement5数据集官方工具可视化 官方给的工具是将解析的数据存到elasticsearch的&#xff0c;但是数据集的解压增长率非常恐怖&#xff0c;对空间要求很高。因此针对这个问题&#xff0c;我对…

win10配置rocketmq

下载地址&#xff1a;下载 | RocketMQ ,版本根据自己情况定&#xff0c;我选用的是4.7.* 1、下载后解压。D:\rocketmq-all-4.7.0-bin-release 2、需要注意一下jdk安装目录的目录名不能有空格&#xff0c;否则会报错找不到JAVA 3、环境变量新增ROCKEMQ_THOMED:\rocketmq-all-4…

MySQL语句判断数据库数据重复情况,新增、删除、不变。

判断 7月8月两个月数据对比情况&#xff0c;新增、删除(离职)、重复。 根据manager_name,gg_name,employer,department,historical_office判断出是否重复数据 -- ●- 新增或离职 -- ●- 创建临时表CREATE TABLE temp_table (SELECT id,manager_name,gg_name,employer,departme…

4用opencv玩转图像2

opencv绘制文字和几何图形 黑色底图 显示是一张黑色图片 使用opencv画圆形 #画一个圆 cv2.circle(imgblack_img,center(400,400),radius100,color(0,0,255),thickness10) 画实心圆 只需要把thickness-1。 cv2.circle(imgblack_img,center(500,600),radius50,color(0,0,255),t…

项目优化后续 ,手撸一个精简版VUE项目框架!

之前说过项目之前用的vben框架&#xff0c;在优化完性能后打包效果由原来的纯代码96M变成了56M&#xff0c;后续来啦&#xff0c;通过更换框架&#xff0c;代码压缩到了36M撒花~ 现在就来详细说说是怎么手撸一个框架的&#xff01; 方案&#xff1a; 搭建一套 vite vue3 a…

系统架构设计师-软件架构设计(7)

目录 大型网站系统架构演化 一、第一阶段&#xff1a;单体架构 到 第二阶段&#xff1a;垂直架构 二、第三阶段&#xff1a;使用缓存改善网站性能 1、缓存与数据库的数据一致性问题 2、缓存技术对比【MemCache与Redis】 3、Redis分布式存储方案 4、Redis集群切片的常见方式 …

【C++】STL map和set用法基本介绍

map、set用法简介 前言正式开始set构造erasefindswapcountlower_bound 和 upper_boundlower_boundupper_bound equal_rangepair multiusetfinderasecount map构造insert[ ][ ]底层原理 multimap两道题目前K个高频单词两个数组的交集 前言 首先&#xff0c;使用map和set最少要了…

[golang gin框架] 45.Gin商城项目-微服务实战之后台Rbac微服务之角色权限关联

角色和权限的关联关系在前面文章中有讲解,见[golang gin框架] 14.Gin 商城项目-RBAC管理之角色和权限关联,角色授权,在这里通过微服务来实现角色对权限的授权操作,这里要实现的有两个功能,一个是进入授权,另一个是,授权提交操作,页面如下: 一.实现后台权限管理Rbac之角色权限关…

pom文件---maven

027-Maven 命令行-实验四-生成 Web 工程-执行生成_ev_哔哩哔哩_bilibili 27节.后续补充 一.maven下载安装及配置 1)maven下载 2) settings文件配置本地仓库 3)settings配置远程仓库地址 4)配置maven工程的基础JDK版本 5)确认JDK环境变量配置没问题,配置maven的环境变量 验证…

C++ 派生类成员的标识与访问——虚基类

当某类的部分或者全部直接基类是从另一个共同的基类派生而来时&#xff0c;在这些直接基类中从上一级共同基类继承来的成员就拥有相同的名称。在派生类的对象中&#xff0c;这些同名数据成员在内存中同时多个副本&#xff0c;同一个函数名会有多个映射。 可以通过作用域分辨符…

CISCO MDS 9148 SAN Switch 交换机命令配置方法:

前言 CISCO MDS 9148 SAN 交换机已经停产&#xff0c;但还是要掌握一下配置的方法&#xff1a; 升级款后面 9148S 或者 9100系列&#xff0c;但配置方式基本都差不多&#xff0c;掌握一个就好&#xff1a; 高性能和极具吸引力的价值 Cisco MDS 9148S 16G 多层光纤交换机是下…

24届近5年南京理工大学自动化考研院校分析

今天学长给大家带来的是南京理工大学控制考研分析 满满干货&#xff5e;还不快快点赞收藏 一、南京理工大学 ​ 学校简介 南京理工大学是隶属于工业和信息化部的全国重点大学&#xff0c;学校由创建于1953年的新中国军工科技最高学府——中国人民解放军军事工程学院&#xf…

用户权限提升Sudo

目录 前言 一、su的用法 二、sudo提权 总结 前言 sudo是linux系统管理指令&#xff0c;是允许系统管理员让普通用户执行一些或者全部的root命令的一个工具&#xff0c;如halt&#xff0c;reboot&#xff0c;su等等。换句话说通过此命令可以让非root的用户运行只有root才有权限…

vue 新学习 06 js的prototype ,export暴露,vue组件,一个重要的内置关系

部分内容参考的这篇文章 原文链接&#xff1a;https://blog.csdn.net/harry5508/article/details/84025146 写的很好。 01 在js中&#xff1a; 原型链 注意&#xff1a;构造函数.prototype实例化对象.__proto__&#xff0c;都是指向函数的原型。 export&#xff1a; -export用…