kubernetes ui 搭建

 

1、部署Kubernetes云计算平台,至少准备两台服务器,此处为3台

Kubernetes Master节点:192.168.0.111
Kubernetes Node1节点:192.168.0.112
Kubernetes Node2节点:192.168.0.113

2、每台服务器主机都运行如下命令

systemctl stop firewalld
systemctl disable firewalld
yum -y install ntp
ntpdate pool.ntp.org #保证每台服务器时间一致性
systemctl start ntpd
systemctl enable ntpd

3、Kubernetes Master 安装与配置 Kubernetes Master节点上安装etcd和Kubernetes、flannel网络,命令如下

yum install kubernetes-master etcd flannel -y

Master /etc/etcd/etcd.conf 配置文件,代码如下

cat>/etc/etcd/etcd.conf<<EOF
# [member]
ETCD_NAME=etcd1
ETCD_DATA_DIR="/data/etcd"
#ETCD_WAL_DIR=""
#ETCD_SNAPSHOT_COUNT="10000"
#ETCD_HEARTBEAT_INTERVAL="100"
#ETCD_ELECTION_TIMEOUT="1000"
ETCD_LISTEN_PEER_URLS="http://192.168.0.111:2380"
ETCD_LISTEN_CLIENT_URLS="http://192.168.0.111:2379,http://127.0.0.1:2379"
ETCD_MAX_SNAPSHOTS="5"
#ETCD_MAX_WALS="5"
#ETCD_CORS=""
#
#[cluster]
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.0.111:2380"
# if you use different ETCD_NAME (e.g. test), set ETCD_INITIAL_CLUSTER value for this name, i.e. "test=http://..."
ETCD_INITIAL_CLUSTER="etcd1=http://192.168.0.111:2380,etcd2=http://192.168.0.112:2380,etcd3=http://192.168.0.113:2380"
#ETCD_INITIAL_CLUSTER_STATE="new"
#ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
ETCD_ADVERTISE_CLIENT_URLS="http://192.168.0.111:2379"
#ETCD_DISCOVERY=""
#ETCD_DISCOVERY_SRV=""
#ETCD_DISCOVERY_FALLBACK="proxy"
#ETCD_DISCOVERY_PROXY=""
#
#[proxy]
#ETCD_PROXY="off"
#ETCD_PROXY_FAILURE_WAIT="5000"
#ETCD_PROXY_REFRESH_INTERVAL="30000"
#ETCD_PROXY_DIAL_TIMEOUT="1000"
#ETCD_PROXY_WRITE_TIMEOUT="5000"
#ETCD_PROXY_READ_TIMEOUT="0"
#
#[security]
#ETCD_CERT_FILE=""
#ETCD_KEY_FILE=""
#ETCD_CLIENT_CERT_AUTH="false"
#ETCD_TRUSTED_CA_FILE=""
#ETCD_PEER_CERT_FILE=""
#ETCD_PEER_KEY_FILE=""
#ETCD_PEER_CLIENT_CERT_AUTH="false"
#ETCD_PEER_TRUSTED_CA_FILE=""
#
#[logging]
#ETCD_DEBUG="false"
# examples for -log-package-levels etcdserver=WARNING,security=DEBUG
#ETCD_LOG_PACKAGE_LEVELS=""
EOF
mkdir  -p  /data/etcd/;chmod 757 -R /data/etcd/
systemctl restart etcd.service

Master /etc/kubernetes/config配置文件,命令如下:

cat>/etc/kubernetes/config<<EOF
# kubernetes  system config
# The following values are used to configure various aspects of all
# kubernetes i, including
#   kube-apiserver.service
#   kube-controller-manager.service
#   kube-scheduler.service
#   kubelet.service
#   kube-proxy.service
# logging to stderr means we get it in the systemd journal
KUBE_LOGTOSTDERR="--logtostderr=true"
# journal message level, 0 is debug
KUBE_LOG_LEVEL="--v=0"
# Should this cluster be allowed to run privileged docker containers
KUBE_ALLOW_PRIV="--allow-privileged=false"
# How the controller-manager, scheduler, and proxy find the apiserver
KUBE_MASTER="--master=http://192.168.0.111:8080"
EOF

将Kubernetes 的apiserver进程的服务地址告诉kubernetes的controller-manager,scheduler,proxy进程。

Master /etc/kubernetes/apiserver 配置文件,代码如下:

cat>/etc/kubernetes/apiserver<<EOF
# kubernetes system config
# The following values are used to configure the kube-apiserver
# The address on the local server to listen to.
KUBE_API_ADDRESS="--insecure-bind-address=0.0.0.0"
# The port on the local server to listen on.
KUBE_API_PORT="--port=8080"
# Port minions listen on
KUBELET_PORT="--kubelet-port=10250"
# Comma separated list of nodes in the etcd cluster
KUBE_ETCD_SERVERS="--etcd-servers=http://192.168.0.111:2379,http://192.168.0.112:2379,http://192.168.0.113:2379"
# Address range to use for i
KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16"
# default admission control policies
#KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota"
KUBE_ADMISSION_CONTROL="--admission_control=NamespaceLifecycle,NamespaceExists,LimitRanger,ResourceQuota"
# Add your own!
KUBE_API_ARGS=""
EOFfor i in etcd kube-apiserver kube-controller-manager kube-scheduler ;do systemctl restart $i ;systemctl enable $i ;systemctl status $i;done

启动Kubernetes Master节点上的etcd, apiserver, controller-manager和scheduler进程及状态

4、Kubernetes Node1安装配置

在Kubenetes Node1节点上安装flannel、docker和Kubernetes

yum install kubernetes-node etcd docker flannel*rhsm* -y

在Node1节点上配置

vim node1 /etc/etcd/etcd.conf 配置如下

cat>/etc/etcd/etcd.conf<<EOF
##########
# [member]
ETCD_NAME=etcd2
ETCD_DATA_DIR="/data/etcd"
#ETCD_WAL_DIR=""
#ETCD_SNAPSHOT_COUNT="10000"
#ETCD_HEARTBEAT_INTERVAL="100"
#ETCD_ELECTION_TIMEOUT="1000"
ETCD_LISTEN_PEER_URLS="http://192.168.0.112:2380"
ETCD_LISTEN_CLIENT_URLS="http://192.168.0.112:2379,http://127.0.0.1:2379"
ETCD_MAX_SNAPSHOTS="5"
#ETCD_MAX_WALS="5"
#ETCD_CORS=""
#[cluster]
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.0.112:2380"
# if you use different ETCD_NAME (e.g. test), set ETCD_INITIAL_CLUSTER value for this name, i.e. "test=http://..."
ETCD_INITIAL_CLUSTER="etcd1=http://192.168.0.111:2380,etcd2=http://192.168.0.112:2380,etcd3=http://192.168.0.113:2380"
#ETCD_INITIAL_CLUSTER_STATE="new"
#ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
ETCD_ADVERTISE_CLIENT_URLS="http://192.168.0.112:2379"
#ETCD_DISCOVERY=""
#ETCD_DISCOVERY_SRV=""
#ETCD_DISCOVERY_FALLBACK="proxy"
#ETCD_DISCOVERY_PROXY=""
#[proxy]
#ETCD_PROXY="off"
#ETCD_PROXY_FAILURE_WAIT="5000"
#ETCD_PROXY_REFRESH_INTERVAL="30000"
#ETCD_PROXY_DIAL_TIMEOUT="1000"
#ETCD_PROXY_WRITE_TIMEOUT="5000"
#ETCD_PROXY_READ_TIMEOUT="0"
#
#[security]
#ETCD_CERT_FILE=""
#ETCD_KEY_FILE=""
#ETCD_CLIENT_CERT_AUTH="false"
#ETCD_TRUSTED_CA_FILE=""
#ETCD_PEER_CERT_FILE=""
#ETCD_PEER_KEY_FILE=""
#ETCD_PEER_CLIENT_CERT_AUTH="false"
#ETCD_PEER_TRUSTED_CA_FILE=""
#
#[logging]
#ETCD_DEBUG="false"
# examples for -log-package-levels etcdserver=WARNING,security=DEBUG
#ETCD_LOG_PACKAGE_LEVELS=""
EOF
mkdir  -p  /data/etcd/;chmod 757 -R /data/etcd/;service etcd restart

配置信息告诉flannel进程etcd服务的位置以及在etcd上网络配置信息的节点位置。

Node1 kubernetes配置 vim 配置 /etc/kubernetes/config

cat>/etc/kubernetes/config<<EOF
# kubernetes system config
# The following values are used to configure various aspects of all
# kubernetes services, including
#   kube-apiserver.service
#   kube-controller-manager.service
#   kube-scheduler.service
#   kubelet.service
#   kube-proxy.service
# logging to stderr means we get it in the systemd journal
KUBE_LOGTOSTDERR="--logtostderr=true"
# journal message level, 0 is debug
KUBE_LOG_LEVEL="--v=0"
# Should this cluster be allowed to run privileged docker containers
KUBE_ALLOW_PRIV="--allow-privileged=false"
# How the controller-manager, scheduler, and proxy find the apiserver
KUBE_MASTER="--master=http://192.168.0.111:8080"
EOF

配置/etc/kubernetes/kubelet代码如下

cat>/etc/kubernetes/kubelet<<EOF
###
# kubernetes kubelet (minion) config
# The address for the info server to serve on (set to 0.0.0.0 or "" for all interfaces)
KUBELET_ADDRESS="--address=0.0.0.0"
# The port for the info server to serve on
KUBELET_PORT="--port=10250"
# You may leave this blank to use the actual hostname
KUBELET_HOSTNAME="--hostname-override=192.168.0.112"
# location of the api-server
KUBELET_API_SERVER="--api-servers=http://192.168.0.111:8080"
# pod infrastructure container
#KUBELET_POD_INFRA_CONTAINER="--pod-infra-container-image=192.168.0.123:5000/centos68"
KUBELET_POD_INFRA_CONTAINER="--pod-infra-container-image=registry.access.redhat.com/rhel7/pod-infrastructure:latest"
# Add your own!
KUBELET_ARGS=""
EOF
for  I  in  etcd kube-proxy  kubelet  docker ;do systemctl  restart  $I ;systemctl  enable  $I;systemctl status $I ;done
iptables -P FORWARD ACCEPT

分别启动Kubernetes Node节点上kube-proxy、kubelet、docker、flanneld进程并查看其状态

 4、在Kubernetes Node2节点上安装flannel、docker和Kubernetes

yum install kubernetes-node etcd docker flannel *rhsm* -y

Node2 节点配置Etcd配置

Node2 /etc/etcd/etcd.config 配置flannel内容如下:

cat>/etc/etcd/etcd.conf<<EOF
##########
# [member]
ETCD_NAME=etcd3
ETCD_DATA_DIR="/data/etcd"
#ETCD_WAL_DIR=""
#ETCD_SNAPSHOT_COUNT="10000"
#ETCD_HEARTBEAT_INTERVAL="100"
#ETCD_ELECTION_TIMEOUT="1000"
ETCD_LISTEN_PEER_URLS="http://192.168.0.113:2380"
ETCD_LISTEN_CLIENT_URLS="http://192.168.0.113:2379,http://127.0.0.1:2379"
ETCD_MAX_SNAPSHOTS="5"
#ETCD_MAX_WALS="5"
#ETCD_CORS=""
#[cluster]
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.0.113:2380"
# if you use different ETCD_NAME (e.g. test), set ETCD_INITIAL_CLUSTER value for this name, i.e. "test=http://..."
ETCD_INITIAL_CLUSTER="etcd1=http://192.168.0.111:2380,etcd2=http://192.168.0.112:2380,etcd3=http://192.168.0.113:2380"
#ETCD_INITIAL_CLUSTER_STATE="new"
#ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
ETCD_ADVERTISE_CLIENT_URLS="http://192.168.0.113:2379"
#ETCD_DISCOVERY=""
#ETCD_DISCOVERY_SRV=""
#ETCD_DISCOVERY_FALLBACK="proxy"
#ETCD_DISCOVERY_PROXY=""
#[proxy]
#ETCD_PROXY="off"
#ETCD_PROXY_FAILURE_WAIT="5000"
#ETCD_PROXY_REFRESH_INTERVAL="30000"
#ETCD_PROXY_DIAL_TIMEOUT="1000"
#ETCD_PROXY_WRITE_TIMEOUT="5000"
#ETCD_PROXY_READ_TIMEOUT="0"
#
#[security]
#ETCD_CERT_FILE=""
#ETCD_KEY_FILE=""
#ETCD_CLIENT_CERT_AUTH="false"
#ETCD_TRUSTED_CA_FILE=""
#ETCD_PEER_CERT_FILE=""
#ETCD_PEER_KEY_FILE=""
#ETCD_PEER_CLIENT_CERT_AUTH="false"
#ETCD_PEER_TRUSTED_CA_FILE=""
#
#[logging]
#ETCD_DEBUG="false"
# examples for -log-package-levels etcdserver=WARNING,security=DEBUG
#ETCD_LOG_PACKAGE_LEVELS=""
EOF
mkdir  -p  /data/etcd/;chmod 757 -R /data/etcd/;service etcd restart

Node2 Kubernetes 配置

vim /etc/kubernete/config

cat>/etc/kubernetes/config<<EOF
# kubernetes system config
# The following values are used to configure various aspects of all
# kubernetes services, including
#   kube-apiserver.service
#   kube-controller-manager.service
#   kube-scheduler.service
#   kubelet.service
#   kube-proxy.service
# logging to stderr means we get it in the systemd journal
KUBE_LOGTOSTDERR="--logtostderr=true"
# journal message level, 0 is debug
KUBE_LOG_LEVEL="--v=0"
# Should this cluster be allowed to run privileged docker containers
KUBE_ALLOW_PRIV="--allow-privileged=false"
# How the controller-manager, scheduler, and proxy find the apiserver
KUBE_MASTER="--master=http://192.168.0.111:8080"
EOF

配置文件/etc/kubernetes/kubelet 代码如下

cat>/etc/kubernetes/kubelet<<EOF
###
# kubernetes kubelet (minion) config
# The address for the info server to serve on (set to 0.0.0.0 or "" for all interfaces)
KUBELET_ADDRESS="--address=0.0.0.0"
# The port for the info server to serve on
KUBELET_PORT="--port=10250"
# You may leave this blank to use the actual hostname
KUBELET_HOSTNAME="--hostname-override=192.168.0.113"
# location of the api-server
KUBELET_API_SERVER="--api-servers=http://192.168.0.111:8080"
# pod infrastructure container
#KUBELET_POD_INFRA_CONTAINER="--pod-infra-container-image=192.168.0.123:5000/centos68"
KUBELET_POD_INFRA_CONTAINER="--pod-infra-container-image=registry.access.redhat.com/rhel7/pod-infrastructure:latest"
# Add your own!
KUBELET_ARGS=""
EOF
for  I  in  etcd kube-proxy  kubelet  docker ;do systemctl  restart  $I;systemctl  enable  $I ;systemctl status $I ;done
iptables -P FORWARD ACCEPT

此时可以在Master节点上使用kubectl get nodes 查看加入到kubernetes集群的两个Node节点:此时kubernetes集群环境搭建完成

5、Kubernetes flanneld网络配置

Kubernetes整个集群所有的服务器(Master minion)配置Flanneld,/etc/sysconfig/flanneld 代码如下

cat>/etc/sysconfig/flanneld<<EOF
# Flanneld configuration options  
# etcd url location.  Point this to the server where etcd runs
FLANNEL_ETCD_ENDPOINTS="http://192.168.0.111:2379"
# etcd config key.  This is the configuration key that flannel queries
# For address range assignment
FLANNEL_ETCD_PREFIX="/atomic.io/network"
# Any additional options that you want to pass
#FLANNEL_OPTIONS=""
EOF
service flanneld restart

在Master 服务器,测试Etcd集群是否正常,同时在Etcd配置中心创建flannel网络配置

 

6、Kubernetes Dashboard UI界面

 Kubernetes实现的最重要的工作是对Docker容器集群统一的管理和调度,通常使用命令行来操作Kubernetes集群及各个节点,命令行操作非常不方便,如果使用UI界面来可视化操作,会更加方便的管理和维护。

Node节点提前导入两个列表镜像 如下为配置kubernetes dashboard完整过程

1  docker load <pod-infrastructure.tgz,将导入的pod镜像名称修改,命令如下:

docker tag $(docker images|grep none|awk '{print $3}') registry.access.redhat.com/rhel7/pod-infrastructure

2  docker load <kubernetes-dashboard-amd64.tgz,将导入的pod镜像名称修改,命令如下:

docker tag $(docker images|grep none|awk '{print $3}') bestwu/kubernetes-dashboard-amd64:v1.6.3

然后在Master端,创建dashboard-controller.yaml,代码如下

apiVersion: extensions/v1beta1
kind: Deployment
metadata:name: kubernetes-dashboardnamespace: kube-systemlabels:k8s-app: kubernetes-dashboardkubernetes.io/cluster-service: "true"
spec:selector:matchLabels:k8s-app: kubernetes-dashboardtemplate:metadata:labels:k8s-app: kubernetes-dashboardannotations:scheduler.alpha.kubernetes.io/critical-pod: ''scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]'spec:containers:- name: kubernetes-dashboardimage: bestwu/kubernetes-dashboard-amd64:v1.6.3resources:# keep request = limit to keep this container in guaranteed classlimits:cpu: 100mmemory: 50Mirequests:cpu: 100mmemory: 50Miports:- containerPort: 9090args:- --apiserver-host=http://192.168.0.111:8080
        livenessProbe:httpGet:path: /port: 9090initialDelaySeconds: 30timeoutSeconds: 30

创建dashboard-service.yaml,代码如下:

apiVersion: v1
kind: Service
metadata:name: kubernetes-dashboardnamespace: kube-systemlabels:k8s-app: kubernetes-dashboardkubernetes.io/cluster-service: "true"
spec:selector:k8s-app: kubernetes-dashboardports:- port: 80targetPort: 9090

创建dashboard dashborad pods模块:

kubectl create -f dashboard-controller.yaml
kubectl create -f dashboard-service.yaml 

创建完成后,查看Pods和Service的详细信息:

kubectl  get  namespace
kubectl get  deployment --all-namespaces
kubectl get  svc  --all-namespaces
kubectl  get  pods  --all-namespaces
kubectl get pod  -o wide  --all-namespaces
kubectl  describe  service/kubernetes-dashboard  --namespace="kube-system"
kubectl  describe  pod/kubernetes-dashboard-468712587-754dc --namespace="kube-system"
kubectl  delete pod/kubernetes-dashboard-468712587-754dc --namespace="kube-system"--grace-period=0 --force

 

wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm
rpm2cpio python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm | cpio -iv --to-stdout ./etc/rhsm/ca/redhat-uep.pem | tee /etc/rhsm/ca/redhat-uep.pem
注释:rpm2cpio命令用于将rpm软件包转换为cpio格式的文件
cpio命令主要是用来建立或者还原备份档的工具程序,cpio命令可以复制文件到归档包中,或者从归档包中复制文件。
-i 还原备份档
-v 详细显示指令的执行过程

转载于:https://www.cnblogs.com/legenidongma/p/10713409.html

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

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

相关文章

多项目加载顺序修改_React推出并发模式:可中断渲染、指定加载顺序、并行处理多状态...

警告&#xff1a;本文档介绍的实验功能在稳定版本中尚不可用。不要在生产应用程序中依赖 React 的实验性构建。这些功能可能会发生重大更改&#xff0c;而且直到功能成为 React 的一部分之前这类更改都不会发出警告。本文档面向早期使用者和对此感兴趣的用户。如果你不熟悉 Rea…

同步考勤数据 钉钉_作为学校,我为何选择微校wxiao考勤打卡?

随着移动互联网的兴起&#xff0c;越来越多的中小学摒弃了传统纸质考勤方式&#xff0c;采用智能考勤。目前&#xff0c;最常用的智能考勤方式可分为基于非移动端和移动端两种。其中&#xff0c;基于非移动端的包括人脸识别、指纹识别、虹膜识别考勤方式&#xff0c;基于移动端…

Guitar Por如何演奏刮弦

每当我们听到吉他现场演出的时候&#xff0c;看到吉他手在激烈的刮弦时&#xff0c;都觉得很酷&#xff0c;非常有感染力。刮弦在我们弹吉他或编曲时&#xff0c;会经常用到&#xff0c;虽然时间很短&#xff0c;但会为你加分不少。 那么我们应该如何演奏刮弦呢&#xff0c;我们…

LINQ - 對付 SQL Injection 的 免費補洞策略 (转)

LINQ - 對付 SQL Injection 的 "免費補洞策略" LINQ - 對付 SQL Injection 的 "免費補洞策略" 作者&#xff1a;黃忠成 一連串的 Mass SQL Injection 攻擊&#xff0c;讓我們回憶起數年前的 SQL Injection 攻擊&#xff0c;多年後的今天&#xff0c;我們仍…

Visual Studio .Net团队开发[转]

一、 开发前的准备1、 在装有Windows 2000或者Windows XP Professional的机器上安装.net Framework SDK、Visual Studio.Net、Visual Source Safe 6C。&#xff08;如果用户操作系统是Windows .Net Server&#xff0c;则无须安装.Net Framework SDK&#xff0c;.Net Server自带…

mysql数据库root密码在哪个文件中_mysql - 本地数据库忘记了root用户的密码

在连接本地mysql数据库一直都是客户端保存密码&#xff0c;然后一键登录。突然开发要用到这个数据库时&#xff0c;脑子嗡嗡的了……忘记了密码&#xff0c;试了很多遍还是记不起来。没办法只能去找方案了&#xff0c;网上还是有很多跟我一样的大佬的。这里记录下&#xff0c;省…

Inside IronPython: IronPython AST语法树(2/2)

接上篇: Inside IronPython: IronPython AST语法树(1/2) ASTs简介&#xff1a; 当 ipy.exe 执行demo.py的时候&#xff0c;IronPython语言自身的实现和DLR共同参与源代码的编译处理。从基本层面上来讲&#xff0c;编译器是流水化作业的&#xff1a;从语法解析器生成描述源代码…

如何开通支付宝

一、登录支付宝网站注册&#xff1a; 1、注册支付宝账户 1&#xff09;进入支付宝网站https://www.alipay.com/点击“免费注册”按钮 进入支付宝网站https://www.alipay.com/&#xff0c;如果图片有不显示的&#xff0c;请刷新一下&#xff0c;或者将鼠标放到红叉的位置&#x…

mysql的aborted_mysql参数:aborted_connects过大

mysql参数&#xff1a;aborted_connects过大(2015-12-31 11:32:08)标签&#xff1a;mysql运维it如果一个客户端在成功连接之后&#xff0c;不正常中断或结束&#xff0c;Aborted_connects将会增加1&#xff0c;并会将日志记录到error日志里。(log_warning设置为2才会记录)原因可…

小白学docker(1)---docker安装

最近学习下docker&#xff0c;并且工作需要&#xff0c;就总结下。 1、Docker安装 a、先查看下CentOS版本 b、查看下Linux内核版本 c、执行wget -qO- https://get.docker.com/|sh 其实就是一个执行脚本来快速安装开发环境docker d、启动sudo systemctl docker start 执行命令确…

.NET平台依赖注入机制及IoC的设计与实现

我们设计的分层架构&#xff0c;层与层之间应该是松散耦合的。因为是单向单一调用&#xff0c;所以&#xff0c;这里的“松散耦合”实际是指上层类不能具体依赖于下层类&#xff0c;而应该依赖于下层提供的一个接口。这样&#xff0c;上层类不能直接实例化下层中的类&#xff0…

php嵌套查询mysql语句_mysql 查询嵌套

问题描述 为使讨论简单易懂&#xff0c;我将问题稍作简化&#xff0c;去掉诸多的背景。 从前有一个皇帝&#xff0c;他有50个妃子&#xff0c;这些妃子很没有天理的给他生了100,000个儿子&#xff0c;于是&#xff0c;皇帝很苦恼&#xff0c;海量的儿子很难管理&#xff0c;而且…

征途pak文件修改_传奇技能,第十四祭:装备属性修改与增加新装备

技能献祭&#xff0c;Get 新技能&#xff1a;传奇技能——应用篇&#xff0c;增加新装备与绑特效跟航家学技能&#xff0c;用正式服带你飞&#xff0c;底部有配套学习资源场景&#xff1a;游戏中装备的属性是可以修改的&#xff0c;基础攻防属性可以直接在物品数据库中修改&…

本题要求实现一个用选择法对整数数组进行简单排序的函数。_通俗易懂讲 Python 算法:快速排序...

原文&#xff1a;https://stackabuse.com/quicksort-in-python/作者&#xff1a;Marcus Sanatan译者&#xff1a;老齐欢迎在 bilibili 搜索 freeCodeCamp 官方账号或者直接访问 https://space.bilibili.com/335505768 观看我们的技术视频介绍快速排序是一种流行的排序算法&…

vscode标记_高效扩展工具让 VS Code 如虎添翼

Codelf 变量命名神器Star&#xff1a;10688https://github.com/unbug/codelf新建项目&#xff0c;变量&#xff0c;类&#xff0c;方法&#xff0c;接口都需要命名&#xff0c;一个好的命名可以一眼看出这个地方的功能&#xff0c;CodeIf 一键起名不再难&#xff0c;输入关键词…

CSS 有关Position = absolute (绝对定位 是相对于谁而言)

css中有绝对定位法&#xff0c;以前一直搞不懂绝对定位是相对于谁而言的绝对定位。 现在搞清楚了&#xff0c;不是相对于父元素&#xff0c;也不是相对于BODY。 而是相对于所属元素树中&#xff0c;相邻最近的那个显示标识了position属性的元素。 比如 Code<div id"a&q…

mysql gui vim_vim(一): 小技巧

1) 如何yank字符然后再查找 ( / Ctrl - R 0 ) The most recently yanked text will be stored in the 0 and registers (if no register was explicitly specified e.g. by xy ). Then you can paste the text of any that register in the last line (eith1) 如何yank字符然后…

LeetCode Smallest Range

数据范围是3500,3500也就是说n的平方是可以接受的。这里告诉你就是有序的,也就是在提醒你可能会是一个类似于二分的算法,所以的话其实基于这两个认识的话我们就可以利用一个枚举叫二分的算法来解决这道题。怎么做呢&#xff1f;就首先的话我们要枚举一端,一端的话我们可以把所有…

Web前端3.0时代,“程序猿”如何“渡劫升仙”

Web前端入行门槛低&#xff0c;很多人在成为前端工程师后很容易进入工作的舒适区&#xff0c;认为该熟悉的业务已熟悉了&#xff0c;然后就是重复用轮子&#xff0c;这样很容易让自己的成长处于原地打转以及低水平重复的状态。 想要不被行业抛弃&#xff0c;就要努力提升自己。…

mysql用 fifo 记录日志_MySQL一丢丢知识点的了解

1. MySQL体系结构从概念上讲&#xff0c;数据库是文件的集合&#xff0c;是依照某种数据模型组织起来并存放于二级存储器中的数据集合&#xff1b;数据库实例是程序&#xff0c;是位于用户与操作系统之间的一层数据管理软件&#xff0c;用户对数据库数据的任何操作&#xff0c;…