k8s 常用命令(三)

1查看版本信息kubectl version

[root@master ~]# kubectl version

[root@master ~]# kubectl version

Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.3", GitCommit:"ca643a4d1f7bfe34773c74f79527be4afd95bf39", GitTreeState:"clean", BuildDate:"2021-07-15T21:04:39Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}

Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.3", GitCommit:"ca643a4d1f7bfe34773c74f79527be4afd95bf39", GitTreeState:"clean", BuildDate:"2021-07-15T20:59:07Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}

[root@master ~]# kubectl

2查看资源对象简写缩写):kubectl api-resources

[root@master ~]# kubectl api-resources

Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.3", GitCommit:"ca643a4d1f7bfe34773c74f79527be4afd95bf39", GitTreeState:"clean", BuildDate:"2021-07-15T21:04:39Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}

Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.3", GitCommit:"ca643a4d1f7bfe34773c74f79527be4afd95bf39", GitTreeState:"clean", BuildDate:"2021-07-15T20:59:07Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}

3查看集群信息kubectl cluster-info

[root@master ~]# kubectl cluster-info

Kubernetes control plane is running at https://192.168.159.10:6443

CoreDNS is running at https://192.168.159.10:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

4查看帮助信息kubectl --help

[root@master ~]# kubectl –help

kubectl controls the Kubernetes cluster manager.

 Find more information at: https://kubernetes.io/docs/reference/kubectl/overview/

Basic Commands (Beginner):

  create        Create a resource from a file or from stdin.

  expose        使用 replication controller, service, deployment 或者 pod 并暴露它作为一个 新的 Kubernetes

Service

  run           在集群中运行一个指定的镜像

  set           为 objects 设置一个指定的特征

Basic Commands (Intermediate):

  explain       查看资源的文档

  get           显示一个或更多 resources

  edit          在服务器上编辑一个资源

  delete        Delete resources by filenames, stdin, resources and names, or by resources and label selector

Deploy Commands:

  rollout       Manage the rollout of a resource

  scale         Set a new size for a Deployment, ReplicaSet or Replication Controller

  autoscale     Auto-scale a Deployment, ReplicaSet, StatefulSet, or ReplicationController

Cluster Management Commands:

  certificate   修改 certificate 资源.

  cluster-info  显示集群信息

  top           显示 Resource (CPU/Memory) 使用.

  cordon        标记 node 为 unschedulable

  uncordon      标记 node 为 schedulable

  drain         Drain node in preparation for maintenance

  taint         更新一个或者多个 node 上的 taints

Troubleshooting and Debugging Commands:

  describe      显示一个指定 resource 或者 group 的 resources 详情

  logs          输出容器在 pod 中的日志

  attach        Attach 到一个运行中的 container

  exec          在一个 container 中执行一个命令

  port-forward  Forward one or more local ports to a pod

  proxy         运行一个 proxy 到 Kubernetes API server

  cp            复制 files 和 directories 到 containers 和从容器中复制 files 和 directories.

  auth          Inspect authorization

  debug         Create debugging sessions for troubleshooting workloads and nodes

Advanced Commands:

  diff          Diff live version against would-be applied version

  apply         通过文件名或标准输入流(stdin)对资源进行配置

  patch         Update field(s) of a resource

  replace       通过 filename 或者 stdin替换一个资源

  wait          Experimental: Wait for a specific condition on one or many resources.

  kustomize     Build a kustomization target from a directory or URL.

[root@master ~]# kubectl api-resources

NAME                              SHORTNAMES   APIVERSION                             NAMESPACED   KIND

bindings                                       v1                                     true         Binding

componentstatuses                 cs           v1                                     false        ComponentStatus

configmaps                        cm           v1                                     true         ConfigMap

endpoints                         ep           v1                                     true         Endpoints

events                            ev           v1                                     true         Event

limitranges                       limits       v1                                     true         LimitRange

namespaces                        ns           v1                                     false        Namespace

nodes                             no           v1                                     false        Node

persistentvolumeclaims            pvc          v1                                     true         PersistentVolumeClaim

persistentvolumes                 pv           v1                                     false        PersistentVolume

pods                              po           v1                                     true         Pod

podtemplates                                   v1                                     true         PodTemplate

replicationcontrollers            rc           v1                                     true         ReplicationController

resourcequotas                    quota        v1                                     true         ResourceQuota

secrets                                        v1                                     true         Secret

serviceaccounts                   sa           v1                                     true         ServiceAccount

services                          svc          v1                                     true         Service

mutatingwebhookconfigurations                  admissionregistration.k8s.io/v1        false        MutatingWebhookConfiguration

validatingwebhookconfigurations                admissionregistration.k8s.io/v1        false        ValidatingWebhookConfiguration

customresourcedefinitions         crd,crds     apiextensions.k8s.io/v1                false        CustomResourceDefinition

apiservices                                    apiregistration.k8s.io/v1              false        APIService

controllerrevisions                            apps/v1                                true         ControllerRevision

daemonsets                        ds           apps/v1                                true         DaemonSet

deployments                       deploy       apps/v1                                true         Deployment

replicasets                       rs           apps/v1                                true         ReplicaSet

statefulsets                      sts          apps/v1                                true         StatefulSet

tokenreviews                                   authentication.k8s.io/v1               false        TokenReview

localsubjectaccessreviews                      authorization.k8s.io/v1                true         LocalSubjectAccessReview

selfsubjectaccessreviews                       authorization.k8s.io/v1                false        SelfSubjectAccessReview

selfsubjectrulesreviews                        authorization.k8s.io/v1                false        SelfSubjectRulesReview

subjectaccessreviews                           authorization.k8s.io/v1                false        SubjectAccessReview

horizontalpodautoscalers          hpa          autoscaling/v1                         true         HorizontalPodAutoscaler

cronjobs                          cj           batch/v1                               true         CronJob

jobs                                           batch/v1                               true         Job

certificatesigningrequests        csr          certificates.k8s.io/v1                 false        CertificateSigningRequest

leases                                         coordination.k8s.io/v1                 true         Lease

endpointslices                                 discovery.k8s.io/v1                    true         EndpointSlice

events                            ev           events.k8s.io/v1                       true         Event

ingresses                         ing          extensions/v1beta1                     true         Ingress

flowschemas                                    flowcontrol.apiserver.k8s.io/v1beta1   false        FlowSchema

prioritylevelconfigurations                    flowcontrol.apiserver.k8s.io/v1beta1   false        PriorityLevelConfiguration

ingressclasses                                 networking.k8s.io/v1                   false        IngressClass

ingresses                         ing          networking.k8s.io/v1                   true         Ingress

networkpolicies                   netpol       networking.k8s.io/v1                   true         NetworkPolicy

runtimeclasses                                 node.k8s.io/v1                         false        RuntimeClass

poddisruptionbudgets              pdb          policy/v1                              true         PodDisruptionBudget

podsecuritypolicies               psp          policy/v1beta1                         false        PodSecurityPolicy

clusterrolebindings                            rbac.authorization.k8s.io/v1           false        ClusterRoleBinding

clusterroles                                   rbac.authorization.k8s.io/v1           false        ClusterRole

rolebindings                                   rbac.authorization.k8s.io/v1           true         RoleBinding

roles                                          rbac.authorization.k8s.io/v1           true         Role

priorityclasses                   pc           scheduling.k8s.io/v1                   false        PriorityClass

csidrivers                                     storage.k8s.io/v1                      false        CSIDriver

csinodes                                       storage.k8s.io/v1                      false        CSINode

csistoragecapacities                           storage.k8s.io/v1beta1                 true         CSIStorageCapacity

storageclasses                    sc           storage.k8s.io/v1                      false        StorageClass

volumeattachments                              storage.k8s.io/v1                      false        VolumeAttachment

Settings Commands:

  label         更新在这个资源上的 labels

  annotate      更新一个资源的注解

  completion    Output shell completion code for the specified shell (bash or zsh)

Other Commands:

  api-resources Print the supported API resources on the server

  api-versions  Print the supported API versions on the server, in the form of "group/version"

  config        修改 kubeconfig 文件

  plugin        Provides utilities for interacting with plugins.

  version       输出 client 和 server 的版本信息

Usage:

  kubectl [flags] [options]

Use "kubectl <command> --help" for more information about a given command.

Use "kubectl options" for a list of global command-line options (applies to all commands).

5、node节点日志查看:journalctl -u kubelet -f

k8s中查看核心组件日志怎么看

①、通过kubeadm部署的:kubectl logs -f pod_组件名 -n namespace

                                             或者 journalctl -u kubelet -f

②、二进制部署的:journalctl -u kubelet -f

-- Logs begin at 三 2022-11-02 02:24:50 CST. --

11月 01 19:51:04 master kubelet[13641]: I1101 19:51:04.415651   13641 pod_container_deletor.go:79] "Container not found in pod's containers" containerID="041b38b5bb2ff0161170bea161fd70e9175cc27fdc98877944d899ebe7b90d2f"

11月 01 19:51:06 master kubelet[13641]: I1101 19:51:06.428325   13641 reconciler.go:196] "operationExecutor.UnmountVolume started for volume \"kubeconfig\" (UniqueName: \"kubernetes.io/host-path/771ef2517500c43b40e7df4c76198cac-kubeconfig\") pod \"771ef2517500c43b40e7df4c76198cac\" (UID: \"771ef2517500c43b40e7df4c76198cac\") "

11月 01 19:51:06 master kubelet[13641]: I1101 19:51:06.428370   13641 operation_generator.go:829] UnmountVolume.TearDown succeeded for volume "kubernetes.io/host-path/771ef2517500c43b40e7df4c76198cac-kubeconfig" (OuterVolumeSpecName: "kubeconfig") pod "771ef2517500c43b40e7df4c76198cac" (UID: "771ef2517500c43b40e7df4c76198cac"). InnerVolumeSpecName "kubeconfig". PluginName "kubernetes.io/host-path", VolumeGidValue ""

11月 01 19:51:06 master kubelet[13641]: I1101 19:51:06.529163   13641 reconciler.go:319] "Volume detached for volume \"kubeconfig\" (UniqueName: \"kubernetes.io/host-path/771ef2517500c43b40e7df4c76198cac-kubeconfig\") on node \"master\" DevicePath \"\""

11月 01 19:51:07 master kubelet[13641]: I1101 19:51:07.282148   13641 kubelet_getters.go:300] "Path does not exist" path="/var/lib/kubelet/pods/771ef2517500c43b40e7df4c76198cac/volumes"

11月 01 19:51:10 master kubelet[13641]: I1101 19:51:10.913108   13641 topology_manager.go:187] "Topology Admit Handler"

11月 01 19:51:11 master kubelet[13641]: I1101 19:51:11.079185   13641 reconciler.go:224] "operationExecutor.VerifyControllerAttachedVolume started for volume \"kubeconfig\" (UniqueName: \"kubernetes.io/host-path/5e72c0f5a18f84d50f027106c98ab6b1-kubeconfig\") pod \"kube-scheduler-master\" (UID: \"5e72c0f5a18f84d50f027106c98ab6b1\") "

11月 01 19:51:15 master kubelet[13641]: E1101 19:51:15.849398   13641 cadvisor_stats_provider.go:151] "Unable to fetch pod etc hosts stats" err="failed to get stats failed command 'du' ($ nice -n 19 du -x -s -B 1) on path /var/lib/kubelet/pods/771ef2517500c43b40e7df4c76198cac/etc-hosts with error exit status 1" pod="kube-system/kube-scheduler-master"

11月 01 19:51:25 master kubelet[13641]: E1101 19:51:25.874999   13641 cadvisor_stats_provider.go:151] "Unable to fetch pod etc hosts stats" err="failed to get stats failed command 'du' ($ nice -n 19 du -x -s -B 1) on path /var/lib/kubelet/pods/771ef2517500c43b40e7df4c76198cac/etc-hosts with error exit status 1" pod="kube-system/kube-scheduler-master"

11月 01 19:51:31 master kubelet[13641]: I1101 19:51:31.

6、获取一个或多个资源信息:kubectl get

语法格式:

kubectl get <resource> [-o wide | json| yaml] [-n namespace]

注释:

resource:可以是具体资源名称

-o :指定输出格式

-n :指定名称空间

6.1、查看所有命名空间运行的pod信息: kubectl get pods -A

[root@master ~]# kubectl get pods -A

NAMESPACE      NAME                             READY   STATUS    RESTARTS   AGE

kube-flannel   kube-flannel-ds-7clld            1/1     Running   0          5h35m

kube-flannel   kube-flannel-ds-psgvb            1/1     Running   0          5h35m

kube-flannel   kube-flannel-ds-xxncr            1/1     Running   0          5h35m

kube-system    coredns-6f6b8cc4f6-lbvl5         1/1     Running   0          5h45m

kube-system    coredns-6f6b8cc4f6-m6brz         1/1     Running   0          5h45m

kube-system    etcd-master                      1/1     Running   0          5h45m

kube-system    kube-apiserver-master            1/1     Running   0          5h45m

kube-system    kube-controller-manager-master   1/1     Running   0          5h11m

kube-system    kube-proxy-jwpnz                 1/1     Running   0          5h40m

kube-system    kube-proxy-xqcqm                 1/1     Running   0          5h41m

kube-system    kube-proxy-z6rhl                 1/1     Running   0          5h45m

kube-system    kube-scheduler-master            1/1     Running   0          5h11m

6.2查看所有命名空间运行的pod详细信息 kubectl get pods -A -o wide

[root@master ~]# kubectl get pods -A -o wide

NAMESPACE      NAME                             READY   STATUS    RESTARTS   AGE     IP               NODE     NOMINATED NODE   READINESS GATES

kube-flannel   kube-flannel-ds-7clld            1/1     Running   0          5h39m   192.168.159.13   node02   <none>           <none>

kube-flannel   kube-flannel-ds-psgvb            1/1     Running   0          5h39m   192.168.159.11   node01   <none>           <none>

kube-flannel   kube-flannel-ds-xxncr            1/1     Running   0          5h39m   192.168.159.10   master   <none>           <none>

kube-system    coredns-6f6b8cc4f6-lbvl5         1/1     Running   0          5h49m   10.150.2.2       node02   <none>           <none>

kube-system    coredns-6f6b8cc4f6-m6brz         1/1     Running   0          5h49m   10.150.1.2       node01   <none>           <none>

kube-system    etcd-master                      1/1     Running   0          5h49m   192.168.159.10   master   <none>           <none>

kube-system    kube-apiserver-master            1/1     Running   0          5h49m   192.168.159.10   master   <none>           <none>

kube-system    kube-controller-manager-master   1/1     Running   0          5h16m   192.168.159.10   master   <none>           <none>

kube-system    kube-proxy-jwpnz                 1/1     Running   0          5h45m   192.168.159.13   node02   <none>           <none>

kube-system    kube-proxy-xqcqm                 1/1     Running   0          5h45m   192.168.159.11   node01   <none>           <none>

kube-system    kube-proxy-z6rhl                 1/1     Running   0          5h49m   192.168.159.10   master   <none>           <none>

kube-system    kube-scheduler-master            1/1     Running   0          5h15m   192.168.159.10   master   <none>           <none>

 

6.3查看所有资源对象kubectl get all -A

[root@master ~]# kubectl get all -A

NAMESPACE      NAME                                 READY   STATUS    RESTARTS   AGE

kube-flannel   pod/kube-flannel-ds-7whbw            1/1     Running   0          5h14m

kube-flannel   pod/kube-flannel-ds-nj4vl            1/1     Running   0          5h14m

kube-flannel   pod/kube-flannel-ds-w55x5            1/1     Running   0          5h14m

kube-system    pod/coredns-6f6b8cc4f6-lg6hc         1/1     Running   0          5h20m

kube-system    pod/coredns-6f6b8cc4f6-tdwhx         1/1     Running   0          5h20m

kube-system    pod/etcd-master                      1/1     Running   0          5h20m

kube-system    pod/kube-apiserver-master            1/1     Running   0          5h20m

kube-system    pod/kube-controller-manager-master   1/1     Running   0          5h13m

kube-system    pod/kube-proxy-gv58r                 1/1     Running   0          5h20m

kube-system    pod/kube-proxy-xd4lz                 1/1     Running   0          5h18m

kube-system    pod/kube-proxy-zzs2s                 1/1     Running   0          5h18m

kube-system    pod/kube-scheduler-master            1/1     Running   0          5h12m

NAMESPACE     NAME                    TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)                  AGE

default       service/kubernetes      ClusterIP   10.125.0.1     <none>        443/TCP                  5h20m

default       service/nginx-service   NodePort    10.125.18.84   <none>        80:32476/TCP             5h3m

kube-system   service/kube-dns        ClusterIP   10.125.0.10    <none>        53/UDP,53/TCP,9153/TCP   5h20m

NAMESPACE      NAME                             DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR            AGE

kube-flannel   daemonset.apps/kube-flannel-ds   3         3         3       3            3           <none>                   5h14m

kube-system    daemonset.apps/kube-proxy        3         3         3       3            3           kubernetes.io/os=linux   5h20m

NAMESPACE     NAME                      READY   UP-TO-DATE   AVAILABLE   AGE

kube-system   deployment.apps/coredns   2/2     2            2           5h20m

NAMESPACE     NAME                                 DESIRED   CURRENT   READY   AGE

kube-system   replicaset.apps/coredns-6f6b8cc4f6   2         2         2       5h20m

6.4查看node节点上的标签kube get nodes --show-labels 

[root@master ~]# kubectl get nodes --show-labels

NAME     STATUS   ROLES                  AGE     VERSION   LABELS

master   Ready    control-plane,master   5h58m   v1.21.3   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=master,kubernetes.io/os=linux,node-role.kubernetes.io/control-plane=,node-role.kubernetes.io/master=,node.kubernetes.io/exclude-from-external-load-balancers=

node01   Ready    node                   5h53m   v1.21.3   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=node01,kubernetes.io/os=linux,node-role.kubernetes.io/node=node

node02   Ready    node                   5h53m   v1.21.3   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=node02,kubernetes.io/os=linux,node-role.kubernetes.io/node=node

6.5查看pod节点上的标签kubectl get pods --show-labels -A

[root@master ~]# kubectl get pods --show-labels -A

[root@master ~]# kubectl get pods --show-labels -A

NAMESPACE      NAME                             READY   STATUS    RESTARTS   AGE     LABELS

kube-flannel   kube-flannel-ds-7clld            1/1     Running   0          5h51m   app=flannel,controller-revision-hash=5b775b5b5c,pod-template-generation=1,tier=node

kube-flannel   kube-flannel-ds-psgvb            1/1     Running   0          5h51m   app=flannel,controller-revision-hash=5b775b5b5c,pod-template-generation=1,tier=node

kube-flannel   kube-flannel-ds-xxncr            1/1     Running   0          5h51m   app=flannel,controller-revision-hash=5b775b5b5c,pod-template-generation=1,tier=node

kube-system    coredns-6f6b8cc4f6-lbvl5         1/1     Running   0          6h1m    k8s-app=kube-dns,pod-template-hash=6f6b8cc4f6

kube-system    coredns-6f6b8cc4f6-m6brz         1/1     Running   0          6h1m    k8s-app=kube-dns,pod-template-hash=6f6b8cc4f6

kube-system    etcd-master                      1/1     Running   0          6h1m    component=etcd,tier=control-plane

kube-system    kube-apiserver-master            1/1     Running   0          6h1m    component=kube-apiserver,tier=control-plane

kube-system    kube-controller-manager-master   1/1     Running   0          5h27m   component=kube-controller-manager,tier=control-plane

kube-system    kube-proxy-jwpnz                 1/1     Running   0          5h56m   controller-revision-hash=6b87fcb57c,k8s-app=kube-proxy,pod-template-generation=1

kube-system    kube-proxy-xqcqm                 1/1     Running   0          5h56m   controller-revision-hash=6b87fcb57c,k8s-app=kube-proxy,pod-template-generation=1

kube-system    kube-proxy-z6rhl                 1/1     Running   0          6h1m    controller-revision-hash=6b87fcb57c,k8s-app=kube-proxy,pod-template-generation=1

kube-system    kube-scheduler-master            1/1     Running   0          5h26m   component=kube-scheduler,tier=control-plane

6.6查看节点组件的状态信息kubectl get cs

[root@master ~]# kubectl get cs

Warning: v1 ComponentStatus is deprecated in v1.19+

NAME                 STATUS    MESSAGE             ERROR

scheduler            Healthy   ok                 

controller-manager   Healthy   ok                 

etcd-0               Healthy   {"health":"true"} 

6.7查看命名空间kubectl get namespaces

或者使用缩写:[root@master ~]# kubectl get ns

[root@master ~]# kubectl  get namespace

NAME              STATUS   AGE

default           Active   6h8m

kube-flannel      Active   5h58m

kube-node-lease   Active   6h8m

kube-public       Active   6h8m

kube-system       Active   6h8m

7创建命名空间 :kubectl create ns app

[root@master ~]# kubectl create ns ceshi

namespace/ceshi created

 

8删除命名空间kubectl delete ns ceshi

[root@master ~]# kubectl delete ns ceshi

namespace "ceshi" deleted

9在命名空间kube-public创建无状态控制器deployment来启动pod暴露80端口副本集为3

kube-public命名空间创建一个nginx

[root@master ~]# kubectl create deployment nginx --image=nginx:1.15 --port=80 --replicas=3 -n kube-public

[root@master ~]# kubectl create deployment nginx --image=nginx:1.15 --port=80 --replicas=3 -n kube-public

deployment.apps/nginx created

 

11、暴露发布pod中的服务供用户访问

[root@master ~]# kubectl expose deployment nginx --port=80 --target-port=80 --name=nginx-service --type=NodePort -n kube-public

 

访问:

 

 

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

前端学习记录~2023.8.10~JavaScript重难点实例精讲~第6章 Ajax

第 6 章 Ajax 前言6.1 Ajax的基本原理及执行过程6.1.1 XMLHttpRequest对象&#xff08;1&#xff09;XMLHttpRequest对象的函数&#xff08;2&#xff09;XMLHttpRequest对象的属性 6.1.2 XMLHttpRequest对象生命周期&#xff08;1&#xff09;创建XMLHttpRequest对象&#xff…

Django基础3——视图函数

文章目录 一、基本了解1.1 Django内置函数1.2 http请求流程 二、HttpRequest对象&#xff08;接受客户端请求&#xff09;2.1 常用属性2.2 常用方法2.3 服务端接收URL参数2.4 QueryDict对象2.5 案例2.5.1 表单GET提交2.5.2 表单POST提交2.5.3 上传文件 三、HttpResponse对象&am…

OnePlus Open可折叠手机:规格、价格、发布日期等详细信息汇总!

我们知道OnePlus可折叠手机即将问世,无论它是否被命名为OnePlus Open。我们迫不及待地想让它到来,为该公司再添一根弦,为最好的可折叠手机增添一个新的竞争对手。 OnePlus以前没有生产过任何可折叠产品,但它确实拥有合作伙伴公司Oppo的丰富知识,并可以向三星、摩托罗拉和…

【C语言】基础知识杂记(整理自用)

前言 之前一直在学新知识&#xff0c;最近打算复习一下之前学的&#xff0c;所以写了这篇文章&#xff0c;记录一下不熟练的知识点&#xff0c;自用&#xff0c;对大家帮助可能不是很大。 double类型与float类型 编译器默认7.0为double类型 在数据后加一个f&#xff0c;编译…

机器人远程控制软件设计

机器人远程控制软件设计 That’s all.

2023年高教社杯 国赛数学建模思路 - 复盘:光照强度计算的优化模型

文章目录 0 赛题思路1 问题要求2 假设约定3 符号约定4 建立模型5 模型求解6 实现代码 建模资料 0 赛题思路 &#xff08;赛题出来以后第一时间在CSDN分享&#xff09; https://blog.csdn.net/dc_sinor?typeblog 1 问题要求 现在已知一个教室长为15米&#xff0c;宽为12米&…

麒麟系统上安装 MySQL 8.0.24

我介绍一下在麒麟系统上安装 MySQL 8.0.24 的详细步骤&#xff0c;前提是您已经下载了 mysql-8.0.24-linux-glibc2.12-x86_64.tar.xz 安装包。其实安装很简单&#xff0c;但是有坑&#xff0c;而且问题非常严重&#xff01;由于麒麟系统相关文章博客较少&#xff0c;导致遇到了…

openCV实战-系列教程7:轮廓检测2与模板匹配(轮廓检测/轮廓特征/轮廓近似/轮廓边界矩阵/轮廓边界圆/模版匹配)、原理解析、源码解读

打印一个图片可以做出一个函数&#xff1a; def cv_show(img,name):cv2.imshow(name,img)cv2.waitKey()cv2.destroyAllWindows() 1、轮廓特征与近似 1.1 轮廓特征 前面我们计算了这个图片的轮廓&#xff1a; 它的轮廓信息保存在了contours中&#xff0c;取出第一个轮廓&…

还不知道怎么提示LLM?ChatGPT提示入门

文章目录 简介&#xff1a;什么是人工智能&#xff1f;什么是提示过程&#xff1f;为什么会出现这样的差异&#xff1f; 为什么需要提示过程&#xff1f;1) 文章摘要2) 数学问题求解 如何进行提示过程&#xff1f;角色提示&#xff1a;多范例提示&#xff1a;无范例提示单范例提…

春秋云镜 CVE-2019-16113

春秋云镜 CVE-2019-16113 Bludit目录穿越漏洞 靶标介绍 在Bludit<3.9.2的版本中&#xff0c;攻击者可以通过定制uuid值将文件上传到指定的路径&#xff0c;然后通过bl-kernel/ajax/upload-images.php远程执行任意代码。 启动场景 漏洞利用 exp https://github.com/Kenun…

长时间序列的25米全球sar卫星镶嵌数据

数据简介 1992年JAXA&#xff08;Japan Aerospace Exploration Agency&#xff0c;日本宇宙航空研究开发机构&#xff09;发射了一颗JERS-1卫星&#xff0c;该卫星携带有18*24m分辨率的SAR传感器。随后&#xff0c;JAXA又在2006年和2014年分别发射了带有SAR传感器的alos卫星和…

数学建模及数据分析 || 4. 深度学习应用案例分享

PyTorch 深度学习全连接网络分类 文章目录 PyTorch 深度学习全连接网络分类1. 非线性二分类2. 泰坦尼克号数据分类2.1 数据的准备工作2.2 全连接网络的搭建2.3 结果的可视化 1. 非线性二分类 import sklearn.datasets #数据集 import numpy as np import matplotlib.pyplot as…

[MyBatis系列②]Dao层开发的两种方式

目录 1、传统开发 1.1、代码 1.2、存在的问题 2、代理开发 2.1、开发规范 2.2、代码 ⭐mybatis系列①&#xff1a;增删改查 1、传统开发 传统的mybatis开发中&#xff0c;是在数据访问层实现相应的接口&#xff0c;在实现类中用"命名空间.id"的形式找到对应的映…

Springboot+mybatis-plus+dynamic-datasource+Druid 多数据源 分布式事务

Springbootmybatis-plusdynamic-datasourceDruid 多数据源事务&#xff0c;分布式事务 文章目录 Springbootmybatis-plusdynamic-datasourceDruid 多数据源事务&#xff0c;分布式事务0.前言1. 基础介绍ConnectionFactoryAbstractRoutingDataSource 动态路由数据源的抽象类 Dyn…

SpringBoot概述SpringBoot基础配置yml的使用多环境启动

&#x1f40c;个人主页&#xff1a; &#x1f40c; 叶落闲庭 &#x1f4a8;我的专栏&#xff1a;&#x1f4a8; c语言 数据结构 javaEE 操作系统 石可破也&#xff0c;而不可夺坚&#xff1b;丹可磨也&#xff0c;而不可夺赤。 SpringBoot简介 一、 SpringBoot概述1.1 起步依赖…

前端(十四)——DOM节点操作手册:你需要了解的一切

&#x1f642;博主&#xff1a;小猫娃来啦 &#x1f642;文章核心&#xff1a;DOM节点操作手册&#xff1a;你需要了解的一切 文章目录 前言DOM基础知识操作现有节点创建新节点遍历节点树修改节点属性和样式事件处理实践应用动态创建表格动态更新列表 前言 DOM&#xff08;文档…

Python爬虫逆向实战案例(五)——YRX竞赛题第五题

题目&#xff1a;抓取全部5页直播间热度&#xff0c;计算前5名直播间热度的加和 地址&#xff1a;https://match.yuanrenxue.cn/match/5 cookie中m值分析 首先打开开发者工具进行抓包分析&#xff0c;从抓到的包来看&#xff0c;参数传递了查询参数m与f&#xff0c;同时页面中…

C# 工厂模式

一、概述 工厂模式&#xff08;Factory Pattern&#xff09;是一种创建型设计模式&#xff0c;它提供了一种创建对象的最佳方式。在C#中&#xff0c;工厂模式通过定义一个公共接口或抽象类来创建对象&#xff0c;而具体的对象创建则由工厂类来实现。 工厂模式主要包含三个角色…

opencv-dnn

# utils_words.txt 标签文件 import osimage_types (".jpg", ".jpeg", ".png", ".bmp", ".tif", ".tiff")def list_images(basePath, containsNone):# return the set of files that are validreturn list_file…

element-ui中的el-table合并单元格

描述&#xff1a; 在写项目的时候有时候会经常遇到把行和列合并起来的情况&#xff0c;因为有些数据是重复渲染的&#xff0c;不合并行列会使表格看起来非常的混乱&#xff0c;如下&#xff1a; 而我们想要的数据是下面这种情况&#xff0c;将重复的行进行合并&#xff0c;使表…