k8s集群安装Istio过程记录及问题总结

目录

  • 一、介绍
  • 二、部署Helm
  • 三、部署Istio
    • 部署官方示例 Bookinfo
  • 四、部署Kali
  • Bug 记录
  • 部署Bookinfo demo失败

一、介绍

这篇文章记录一下k8s集群安装Helm、Istio 和 Kiali,方便学习相关概念。
前提需要k8s集群:
k8s集群安装Istio过程记录及问题总结_第1张图片
可参考:Arm64架构(MacBookPro M1)虚拟机安装k8s1.27.3版本记录及问题总结

Helm是k8s机群的包管理器,我们可以通过Helm在k8s集群安装应用。
Istio是一个功能强大的服务网格平台,为微服务架构提供了一套丰富的工具和功能,以简化和增强服务之间的通信、安全性和可观察性。
Kiali 仪表板展示了网格的概览以及 Bookinfo 示例应用的各个服务之间的关系。 它还提供过滤器来可视化流量的流动。

Helm版本支持策略:https://helm.sh/zh/docs/topics/version_skew/
Istio 版本支持策略:https://istio.io/latest/zh/docs/releases/supported-releases/
k8s集群安装Istio过程记录及问题总结_第2张图片

k8s集群安装Istio过程记录及问题总结_第3张图片

二、部署Helm

官方文档:https://helm.sh/zh/docs/intro/quickstart/
Helm安装方式很简单,只需要执行一条命令,执行相应脚本完成安装。如果你需要安装对应版本,每个Helm 版本都提供了各种操作系统的二进制版本:https://github.com/helm/helm/releases,这些版本可以手动下载和安装,然后解压,将helm移动到需要的目录中(mv linux-amd64/helm /usr/local/bin/helm)

curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
[root@k8s-master ~]# curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11345  100 11345    0     0   8068      0  0:00:01  0:00:01 --:--:--  8063
[WARNING] Could not find git. It is required for plugin installation.
Downloading https://get.helm.sh/helm-v3.12.1-linux-arm64.tar.gz
Verifying checksum... Done.
Preparing to install helm into /usr/local/bin
helm installed into /usr/local/bin/helm
[root@k8s-master ~]# helm version
version.BuildInfo{Version:"v3.12.1", GitCommit:"f32a527a060157990e2aa86bf45010dfb3cc8b8d", GitTreeState:"clean", GoVersion:"go1.20.4"}
[root@k8s-master ~]# helm ls
NAME    NAMESPACE       REVISION        UPDATED STATUS  CHART   APP VERSION
[root@k8s-master ~]# helm repo add bitnami https://charts.bitnami.com/bitnami
"bitnami" has been added to your repositories
[root@k8s-master ~]# 
[root@k8s-master ~]# helm repo update     
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "bitnami" chart repository
Update Complete. ⎈Happy Helming!⎈

三、部署Istio

官方文档:https://istio.io/latest/zh/docs/setup/getting-started/
Istio也可以执行脚本安装,但是我的网络不通没办法。

[root@k8s-master ~]# curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.18.0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   102  100   102    0     0    359      0 --:--:-- --:--:-- --:--:--   359
  0     0    0     0    0     0      0      0 --:--:--  0:01:36 --:--:--     0
curl: (56) OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104
[root@k8s-master ~]# cat  >> /etc/hosts << EOF
> 75.2.60.5 istio.io
> EOF
> [root@k8s-master ~]# curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.18.0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   102  100   102    0     0    337      0 --:--:-- --:--:-- --:--:--   337
  0     0    0     0    0     0      0      0 --:--:--  0:01:32 --:--:--     0
curl: (56) OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104

只能下载二进制包,上传到虚拟机进行部署。
二进制包下载:https://github.com/istio/istio/releases/tag/1.18.0
下载对应版本
k8s集群安装Istio过程记录及问题总结_第4张图片
使用tar -zxvf命令进行解压,进入文件夹,将istio命令加入环境变量。
采用 demo 配置组合。 它包含了一组专为测试准备的功能集合,另外还有用于生产或性能测试的配置组合。

cd istio-1.18.0
export PATH=$PWD/bin:$PATH
istioctl install --set profile=demo -y

并且给命名空间添加标签,指示 Istio 在部署应用的时候,自动注入 Envoy 边车(Sidecar)代理:

kubectl label namespace default istio-injection=enabled

部署官方示例 Bookinfo

然后安装官方的Demo示例:

kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
[root@k8s-master ~]# ll | grep istio
-rw-r--r--. 1 root root 25307383 7月   5 23:16 istio-1.18.0-linux-arm64.tar.gz
[root@k8s-master ~]# tar -zxvf istio-1.18.0-linux-arm64.tar.gz 
[root@k8s-master ~]# ll | grep istio
drwxr-x---. 6 root root      115 6月   7 16:01 istio-1.18.0
-rw-r--r--. 1 root root 25307383 7月   5 23:16 istio-1.18.0-linux-arm64.tar.gz
[root@k8s-master ~]# cd istio-1.18.0
[root@k8s-master istio-1.18.0]# ls
bin  LICENSE  manifests  manifest.yaml  README.md  samples  tools
[root@k8s-master istio-1.18.0]# export PATH=$PWD/bin:$PATH
[root@k8s-master istio-1.18.0]# istioctl install --set profile=demo -y
✔ Istio core installed                                                                                                                                                                      
✔ Istiod installed                                                                                                                                                                          
✔ Egress gateways installed                                                                                                                                                                 
✔ Ingress gateways installed                                                                                                                                                                
✔ Installation complete                                                                                                                                                                     Making this installation the default for injection and validation.
[root@k8s-master istio-1.18.0]# kubectl label namespace default istio-injection=enabled
namespace/default labeled
[root@k8s-master istio-1.18.0]# kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
service/details created
serviceaccount/bookinfo-details created
deployment.apps/details-v1 created
service/ratings created
serviceaccount/bookinfo-ratings created
deployment.apps/ratings-v1 created
service/reviews created
serviceaccount/bookinfo-reviews created
deployment.apps/reviews-v1 created
deployment.apps/reviews-v2 created
deployment.apps/reviews-v3 created
service/productpage created
serviceaccount/bookinfo-productpage created
deployment.apps/productpage-v1 created
[root@k8s-master istio-1.18.0]# 

应用很快会启动起来。当每个 Pod 准备就绪时,Istio 边车将伴随应用一起部署。

[root@k8s-master istio-1.18.0]# kubectl get services
NAME          TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE
details       ClusterIP   10.111.93.162            9080/TCP   12m
kubernetes    ClusterIP   10.96.0.1                443/TCP    18h
productpage   ClusterIP   10.97.94.189             9080/TCP   12m
ratings       ClusterIP   10.106.155.115           9080/TCP   12m
reviews       ClusterIP   10.106.49.5              9080/TCP   12m
[root@k8s-master istio-1.18.0]# kubectl get pods
NAME                              READY   STATUS    RESTARTS   AGE
details-v1-7c7dbcb4b5-jx866       2/2     Running   0          12m
productpage-v1-664d44d68d-v722l   2/2     Running   0          12m
ratings-v1-844796bf85-kktgq       2/2     Running   0          12m
reviews-v1-5cf854487-gn6xv        2/2     Running   0          12m
reviews-v2-955b74755-rp9b5        2/2     Running   0          12m
reviews-v3-797fc48bc9-wspwt       2/2     Running   0          12m
[root@k8s-master istio-1.18.0]# 

确认上面的操作都正确之后,运行下面命令,通过检查返回的页面标题来验证应用是否已在集群中运行,并已提供网页服务:

[root@k8s-master istio-1.18.0]# kubectl exec "$(kubectl get pod -l app=ratings -o jsonpath='{.items[0].metadata.name}')" -c ratings -- curl -sS productpage:9080/productpage | grep -o ".*"
Simple Bookstore App<<span class="token operator">/</span>title>
<span class="token namespace">[root@k8s-master istio-1.18.0]</span><span class="token comment"># </span>
</code></pre> 
  <p>此时,BookInfo 应用已经部署,但还不能被外界访问。 要开放访问,需要创建 Istio 入站网关(Ingress Gateway), 它会在网格边缘把一个路径映射到路由。</p> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@k8s-master istio-1.18.0]</span><span class="token comment"># kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml</span>
gateway<span class="token punctuation">.</span>networking<span class="token punctuation">.</span>istio<span class="token punctuation">.</span>io/bookinfo-gateway created
virtualservice<span class="token punctuation">.</span>networking<span class="token punctuation">.</span>istio<span class="token punctuation">.</span>io/bookinfo created

<span class="token comment"># 确保配置文件没有问题:</span>
<span class="token namespace">[root@k8s-master istio-1.18.0]</span><span class="token comment"># istioctl analyze</span>

✔ No validation issues found when analyzing namespace: default<span class="token punctuation">.</span>
<span class="token namespace">[root@k8s-master istio-1.18.0]</span><span class="token comment"># </span>
</code></pre> 
  <p>执行下面命令以判断您的 Kubernetes 集群环境是否支持外部负载均衡:</p> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@k8s-master ~]</span><span class="token comment"># kubectl get svc istio-ingressgateway -n istio-system</span>
NAME                   <span class="token function">TYPE</span>           CLUSTER-IP      EXTERNAL-IP   PORT<span class="token punctuation">(</span>S<span class="token punctuation">)</span>                                                                      AGE
istio-ingressgateway   LoadBalancer   10<span class="token punctuation">.</span>103<span class="token punctuation">.</span>45<span class="token punctuation">.</span>216   <pending>     15021:31564/TCP<span class="token punctuation">,</span>80:30704/TCP<span class="token punctuation">,</span>443:30854/TCP<span class="token punctuation">,</span>31400:30301/TCP<span class="token punctuation">,</span>15443:30563/TCP   20h
<span class="token namespace">[root@k8s-master ~]</span><span class="token comment"># </span>
</code></pre> 
  <p>设置 <code>EXTERNAL-IP</code> 的值之后, 环境就有了一个外部的负载均衡器,可以将其用作入站网关。 但如果 EXTERNAL-IP 的值为 (或者一直是 <<code>pending</code>> 状态), 则您的环境则没有提供可作为入站流量网关的外部负载均衡器。 在这个情况下,您还可以用服务(Service)的<code>NodePort</code>访问网关。<br> 如果你的环境中没有外部负载均衡器,那就选择一个<code>NodePort</code>来代替。<br> 设置入站 IP 地址和端口:</p> 
  <pre><code class="prism language-powershell">export INGRESS_PORT=$<span class="token punctuation">(</span>kubectl <span class="token operator">-</span>n istio-system get service istio-ingressgateway <span class="token operator">-</span>o jsonpath=<span class="token string">'{.spec.ports[?(@.name=="http2")].nodePort}'</span><span class="token punctuation">)</span>

export INGRESS_HOST=$<span class="token punctuation">(</span>kubectl get po <span class="token operator">-</span>l istio=ingressgateway <span class="token operator">-</span>n istio-system <span class="token operator">-</span>o jsonpath=<span class="token string">'{.items[0].status.hostIP}'</span><span class="token punctuation">)</span>
</code></pre> 
  <p>设置环境变量 GATEWAY_URL:</p> 
  <pre><code class="prism language-powershell">export GATEWAY_URL=<span class="token variable">$INGRESS_HOST</span>:<span class="token variable">$INGRESS_PORT</span>
<span class="token function">echo</span> <span class="token string">"<span class="token variable">$GATEWAY_URL</span>"</span>
<span class="token function">echo</span> <span class="token string">"http://<span class="token variable">$GATEWAY_URL</span>/productpage"</span>
</code></pre> 
  <p>把上面命令的输出地址复制粘贴到浏览器并访问,确认 Bookinfo 应用的产品页面是否可以打开。</p> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@k8s-master ~]</span><span class="token comment"># export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')</span>
<span class="token namespace">[root@k8s-master ~]</span><span class="token comment"># export INGRESS_HOST=$(kubectl get po -l istio=ingressgateway -n istio-system -o jsonpath='{.items[0].status.hostIP}')</span>
<span class="token namespace">[root@k8s-master ~]</span><span class="token comment"># export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT</span>
<span class="token namespace">[root@k8s-master ~]</span><span class="token comment"># echo "$GATEWAY_URL"</span>
192<span class="token punctuation">.</span>168<span class="token punctuation">.</span>153<span class="token punctuation">.</span>102:30704
<span class="token namespace">[root@k8s-master ~]</span><span class="token comment"># echo "http://$GATEWAY_URL/productpage"</span>
http:<span class="token operator">/</span><span class="token operator">/</span>192<span class="token punctuation">.</span>168<span class="token punctuation">.</span>153<span class="token punctuation">.</span>102:30704/productpage
</code></pre> 
  <p>成功在外部(宿主机)访问:<br> <a href="http://img.e-com-net.com/image/info8/748c61eaa5514ff8a1ae055e3bc45577.jpg" target="_blank"><img src="http://img.e-com-net.com/image/info8/748c61eaa5514ff8a1ae055e3bc45577.jpg" alt="k8s集群安装Istio过程记录及问题总结_第5张图片" width="650" height="369" style="border:1px solid black;"></a><br> <a href="http://img.e-com-net.com/image/info8/f852859ba9c242afb8ebe0dec88a84c1.jpg" target="_blank"><img src="http://img.e-com-net.com/image/info8/f852859ba9c242afb8ebe0dec88a84c1.jpg" alt="k8s集群安装Istio过程记录及问题总结_第6张图片" width="650" height="369" style="border:1px solid black;"></a></p> 
  <h1>四、部署Kali</h1> 
  <p>Istio 和几个遥测应用做了集成。 遥测能帮我们了解服务网格的结构、展示网络的拓扑结构、分析网格的健康状态。<br> 使用下面说明部署 Kiali 仪表板、 以及 Prometheus、 Grafana、 还有 Jaeger。</p> 
  <pre><code class="prism language-powershell">kubectl apply <span class="token operator">-</span>f samples/addons
<span class="token comment"># 查询kiali在滚动更新期间的状态</span>
kubectl rollout status deployment/kiali <span class="token operator">-</span>n istio-system
</code></pre> 
  <p>要想外部访问kiali 的web页面,还需要创建一个<code>NodePort</code> Service。</p> 
  <pre><code class="prism language-powershell">kubectl <span class="token operator">-</span>n istio-system expose service kiali <span class="token operator">--</span><span class="token function">type</span>=NodePort <span class="token operator">--</span>name=kiali-external
kubectl get svc <span class="token operator">-</span>n istio-system
kubectl <span class="token operator">-</span>n istio-system get service kiali-external <span class="token operator">-</span>o=jsonpath=<span class="token string">'{.spec.ports[0].nodePort}'</span>
</code></pre> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@k8s-master ~]</span><span class="token comment"># cd istio-1.18.0</span>
<span class="token namespace">[root@k8s-master istio-1.18.0]</span><span class="token comment"># kubectl apply -f samples/addons</span>
serviceaccount/grafana created
configmap/grafana created
service/grafana created
deployment<span class="token punctuation">.</span>apps/grafana created
configmap/istio-grafana-dashboards created
configmap/istio-services-grafana-dashboards created
deployment<span class="token punctuation">.</span>apps/jaeger created
service/tracing created
service/zipkin created
service/jaeger-collector created
serviceaccount/kiali created
configmap/kiali created
clusterrole<span class="token punctuation">.</span>rbac<span class="token punctuation">.</span>authorization<span class="token punctuation">.</span>k8s<span class="token punctuation">.</span>io/kiali-viewer created
clusterrole<span class="token punctuation">.</span>rbac<span class="token punctuation">.</span>authorization<span class="token punctuation">.</span>k8s<span class="token punctuation">.</span>io/kiali created
clusterrolebinding<span class="token punctuation">.</span>rbac<span class="token punctuation">.</span>authorization<span class="token punctuation">.</span>k8s<span class="token punctuation">.</span>io/kiali created
role<span class="token punctuation">.</span>rbac<span class="token punctuation">.</span>authorization<span class="token punctuation">.</span>k8s<span class="token punctuation">.</span>io/kiali-controlplane created
rolebinding<span class="token punctuation">.</span>rbac<span class="token punctuation">.</span>authorization<span class="token punctuation">.</span>k8s<span class="token punctuation">.</span>io/kiali-controlplane created
service/kiali created
deployment<span class="token punctuation">.</span>apps/kiali created
serviceaccount/loki created
configmap/loki created
configmap/loki-runtime created
service/loki-memberlist created
service/loki-headless created
service/loki created
statefulset<span class="token punctuation">.</span>apps/loki created
serviceaccount/prometheus created
configmap/prometheus created
clusterrole<span class="token punctuation">.</span>rbac<span class="token punctuation">.</span>authorization<span class="token punctuation">.</span>k8s<span class="token punctuation">.</span>io/prometheus created
clusterrolebinding<span class="token punctuation">.</span>rbac<span class="token punctuation">.</span>authorization<span class="token punctuation">.</span>k8s<span class="token punctuation">.</span>io/prometheus created
service/prometheus created
deployment<span class="token punctuation">.</span>apps/prometheus created
<span class="token namespace">[root@k8s-master istio-1.18.0]</span><span class="token comment"># kubectl rollout status deployment/kiali -n istio-system</span>
deployment <span class="token string">"kiali"</span> successfully rolled out
<span class="token namespace">[root@k8s-master istio-kiali]</span><span class="token comment"># kubectl -n istio-system expose service kiali --type=NodePort --name=kiali-external</span>
service/kiali-external exposed
<span class="token namespace">[root@k8s-master istio-kiali]</span><span class="token comment"># kubectl get svc -n istio-system</span>
NAME                   <span class="token function">TYPE</span>           CLUSTER-IP      EXTERNAL-IP   PORT<span class="token punctuation">(</span>S<span class="token punctuation">)</span>                                                                      AGE
istio-egressgateway    ClusterIP      10<span class="token punctuation">.</span>111<span class="token punctuation">.</span>39<span class="token punctuation">.</span>235   <none>        80/TCP<span class="token punctuation">,</span>443/TCP                                                               21h
istio-ingressgateway   LoadBalancer   10<span class="token punctuation">.</span>103<span class="token punctuation">.</span>45<span class="token punctuation">.</span>216   <pending>     15021:31564/TCP<span class="token punctuation">,</span>80:30704/TCP<span class="token punctuation">,</span>443:30854/TCP<span class="token punctuation">,</span>31400:30301/TCP<span class="token punctuation">,</span>15443:30563/TCP   21h
istiod                 ClusterIP      10<span class="token punctuation">.</span>109<span class="token punctuation">.</span>218<span class="token punctuation">.</span>54   <none>        15010/TCP<span class="token punctuation">,</span>15012/TCP<span class="token punctuation">,</span>443/TCP<span class="token punctuation">,</span>15014/TCP                                        21h
kiali                  ClusterIP      10<span class="token punctuation">.</span>105<span class="token punctuation">.</span>43<span class="token punctuation">.</span>99    <none>        20001/TCP<span class="token punctuation">,</span>9090/TCP                                                           21h
kiali-external         NodePort       10<span class="token punctuation">.</span>110<span class="token punctuation">.</span>49<span class="token punctuation">.</span>251   <none>        20001:31430/TCP<span class="token punctuation">,</span>9090:30588/TCP                                               9s
<span class="token namespace">[root@k8s-master istio-kiali]</span><span class="token comment"># kubectl -n istio-system get service kiali-external -o=jsonpath='{.spec.ports[0].nodePort}'</span>
31430<span class="token namespace">[root@k8s-master istio-kiali]</span><span class="token comment">#</span>
</code></pre> 
  <p>通过集群IP地址+NodePort 访问:<code>http://192.168.153.102:31430/</code></p> 
  <p>要查看追踪数据,必须向服务发送请求。请求的数量取决于 Istio 的采样率。 采样率在安装 Istio 时设置,默认采样速率为 1%。在第一个跟踪可见之前,您需要发送至少 100 个请求。 使用以下命令向 productpage 服务发送 100 个请求:</p> 
  <pre><code class="prism language-powershell"><span class="token keyword">for</span> i in `seq 1 100`<span class="token punctuation">;</span> <span class="token keyword">do</span> curl <span class="token operator">-</span>s <span class="token operator">-</span>o <span class="token operator">/</span>dev/null http:<span class="token operator">/</span><span class="token operator">/</span><span class="token variable">$GATEWAY_URL</span><span class="token operator">/</span>productpage<span class="token punctuation">;</span> done
</code></pre> 
  <p>Kiali 仪表板展示了网格的概览以及 Bookinfo 示例应用的各个服务之间的关系。 它还提供过滤器来可视化流量的流动。<br> <a href="http://img.e-com-net.com/image/info8/0df87b68b4b44841a425a6243fafa11b.jpg" target="_blank"><img src="http://img.e-com-net.com/image/info8/0df87b68b4b44841a425a6243fafa11b.jpg" alt="k8s集群安装Istio过程记录及问题总结_第7张图片" width="650" height="406" style="border:1px solid black;"></a><br> <a href="http://img.e-com-net.com/image/info8/7a39102d0b944d559005320547d8d800.jpg" target="_blank"><img src="http://img.e-com-net.com/image/info8/7a39102d0b944d559005320547d8d800.jpg" alt="k8s集群安装Istio过程记录及问题总结_第8张图片" width="650" height="406" style="border:1px solid black;"></a><br> <a href="http://img.e-com-net.com/image/info8/7b734e2542ac4263970efccb3ce2462a.jpg" target="_blank"><img src="http://img.e-com-net.com/image/info8/7b734e2542ac4263970efccb3ce2462a.jpg" alt="k8s集群安装Istio过程记录及问题总结_第9张图片" width="650" height="406" style="border:1px solid black;"></a></p> 
  <h1>Bug 记录</h1> 
  <h1>部署Bookinfo demo失败</h1> 
  <p>当我使用<code>kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml</code>命令部署Demo时,发现Pod一直启动不下来。</p> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@k8s-master istio-1.18.0]</span><span class="token comment"># kubectl get pods -o wide</span>
NAME                              READY   STATUS                  RESTARTS      AGE     IP              NODE         NOMINATED NODE   READINESS GATES
details-v1-7c7dbcb4b5-lw8hr       0/2     Init:CrashLoopBackOff   5 <span class="token punctuation">(</span>82s ago<span class="token punctuation">)</span>   4m13s   172<span class="token punctuation">.</span>16<span class="token punctuation">.</span>85<span class="token punctuation">.</span>212   k8s-node01   <none>           <none>
productpage-v1-664d44d68d-lgc4k   0/2     Init:CrashLoopBackOff   5 <span class="token punctuation">(</span>69s ago<span class="token punctuation">)</span>   4m12s   172<span class="token punctuation">.</span>16<span class="token punctuation">.</span>58<span class="token punctuation">.</span>203   k8s-node02   <none>           <none>
ratings-v1-844796bf85-7s4zp       0/2     Init:CrashLoopBackOff   5 <span class="token punctuation">(</span>87s ago<span class="token punctuation">)</span>   4m13s   172<span class="token punctuation">.</span>16<span class="token punctuation">.</span>85<span class="token punctuation">.</span>213   k8s-node01   <none>           <none>
reviews-v1-5cf854487-ztl9l        0/2     Init:CrashLoopBackOff   5 <span class="token punctuation">(</span>73s ago<span class="token punctuation">)</span>   4m13s   172<span class="token punctuation">.</span>16<span class="token punctuation">.</span>58<span class="token punctuation">.</span>202   k8s-node02   <none>           <none>
reviews-v2-955b74755-tm6cj        0/2     Init:CrashLoopBackOff   5 <span class="token punctuation">(</span>74s ago<span class="token punctuation">)</span>   4m13s   172<span class="token punctuation">.</span>16<span class="token punctuation">.</span>85<span class="token punctuation">.</span>214   k8s-node01   <none>           <none>
reviews-v3-797fc48bc9-s29zm       0/2     Init:CrashLoopBackOff   5 <span class="token punctuation">(</span>78s ago<span class="token punctuation">)</span>   4m13s   172<span class="token punctuation">.</span>16<span class="token punctuation">.</span>85<span class="token punctuation">.</span>215   k8s-node01   <none>           <none>
</code></pre> 
  <p>开始以为是由于镜像下载不下来,单独下载了镜像</p> 
  <pre><code class="prism language-powershell">crictl pull docker<span class="token punctuation">.</span>io/istio/examples-bookinfo-details-v1:1<span class="token punctuation">.</span>17<span class="token punctuation">.</span>0
crictl pull docker<span class="token punctuation">.</span>io/istio/examples-bookinfo-productpage-v1:1<span class="token punctuation">.</span>17<span class="token punctuation">.</span>0
crictl pull docker<span class="token punctuation">.</span>io/istio/examples-bookinfo-ratings-v1:1<span class="token punctuation">.</span>17<span class="token punctuation">.</span>0
crictl pull docker<span class="token punctuation">.</span>io/istio/examples-bookinfo-reviews-v1:1<span class="token punctuation">.</span>17<span class="token punctuation">.</span>0
crictl pull docker<span class="token punctuation">.</span>io/istio/examples-bookinfo-reviews-v2:1<span class="token punctuation">.</span>17<span class="token punctuation">.</span>0
crictl pull docker<span class="token punctuation">.</span>io/istio/examples-bookinfo-reviews-v3:1<span class="token punctuation">.</span>17<span class="token punctuation">.</span>0
crictl pull docker<span class="token punctuation">.</span>io/istio/proxyv2:1<span class="token punctuation">.</span>18<span class="token punctuation">.</span>0
</code></pre> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@k8s-node02 istio-1.18.0]</span><span class="token comment"># crictl images</span>
IMAGE                                                            TAG                 IMAGE ID            SIZE
docker<span class="token punctuation">.</span>io/calico/cni                                             v3<span class="token punctuation">.</span>25<span class="token punctuation">.</span>0             0bb8d6f033a05       81<span class="token punctuation">.</span>1MB
docker<span class="token punctuation">.</span>io/calico/kube-controllers                                v3<span class="token punctuation">.</span>25<span class="token punctuation">.</span>0             2a83e28de3677       27<span class="token punctuation">.</span>1MB
docker<span class="token punctuation">.</span>io/calico/node                                            v3<span class="token punctuation">.</span>25<span class="token punctuation">.</span>0             8a2dff14388de       82<span class="token punctuation">.</span>2MB
docker<span class="token punctuation">.</span>io/istio/examples-bookinfo-details-v1                     1<span class="token punctuation">.</span>17<span class="token punctuation">.</span>0              8c7b34204cae9       59<span class="token punctuation">.</span>8MB
docker<span class="token punctuation">.</span>io/istio/examples-bookinfo-productpage-v1                 1<span class="token punctuation">.</span>17<span class="token punctuation">.</span>0              348980125f0b0       64<span class="token punctuation">.</span>7MB
docker<span class="token punctuation">.</span>io/istio/examples-bookinfo-ratings-v1                     1<span class="token punctuation">.</span>17<span class="token punctuation">.</span>0              18290de2e4a28       54<span class="token punctuation">.</span>2MB
docker<span class="token punctuation">.</span>io/istio/examples-bookinfo-reviews-v1                     1<span class="token punctuation">.</span>17<span class="token punctuation">.</span>0              9dc1566776c17       412MB
docker<span class="token punctuation">.</span>io/istio/examples-bookinfo-reviews-v2                     1<span class="token punctuation">.</span>17<span class="token punctuation">.</span>0              5233615dc9972       412MB
docker<span class="token punctuation">.</span>io/istio/examples-bookinfo-reviews-v3                     1<span class="token punctuation">.</span>17<span class="token punctuation">.</span>0              fbb7b7ceabf34       412MB
docker<span class="token punctuation">.</span>io/istio/proxyv2                                          1<span class="token punctuation">.</span>18<span class="token punctuation">.</span>0              c901fe029266e       90<span class="token punctuation">.</span>4MB
docker<span class="token punctuation">.</span>io/kubernetesui/dashboard                                 v2<span class="token punctuation">.</span>3<span class="token punctuation">.</span>1              5bb89698273d8       65<span class="token punctuation">.</span>4MB
registry<span class="token punctuation">.</span>aliyuncs<span class="token punctuation">.</span>com/google_containers/pause                    3<span class="token punctuation">.</span>8                 4e42fb3c9d90e       268kB
registry<span class="token punctuation">.</span>cn-hangzhou<span class="token punctuation">.</span>aliyuncs<span class="token punctuation">.</span>com/google_containers/coredns      v1<span class="token punctuation">.</span>10<span class="token punctuation">.</span>1             97e04611ad434       14<span class="token punctuation">.</span>6MB
registry<span class="token punctuation">.</span>cn-hangzhou<span class="token punctuation">.</span>aliyuncs<span class="token punctuation">.</span>com/google_containers/kube-proxy   v1<span class="token punctuation">.</span>27<span class="token punctuation">.</span>3             fb73e92641fd5       21<span class="token punctuation">.</span>4MB
<span class="token namespace">[root@k8s-node02 istio-1.18.0]</span><span class="token comment"># </span>
</code></pre> 
  <p>在三个节点都把镜像下载下来了,但是容器还是无法启动。<br> 后来查看了Pod的日志,发现这个问题:<code>error output: xtables parameter problem: iptables-restore: unable to initialize table 'nat'</code></p> 
  <p>最后找到解决方案:</p> 
  <pre><code class="prism language-powershell"><span class="token function">cat</span> <<EOT >> <span class="token operator">/</span>etc/modules-load<span class="token punctuation">.</span>d/k8s<span class="token punctuation">.</span>conf
overlay
br_netfilter
nf_nat
xt_REDIRECT
xt_owner
iptable_nat
iptable_mangle
iptable_filter
EOT
</code></pre> 
  <pre><code class="prism language-powershell">modprobe br_netfilter <span class="token punctuation">;</span> modprobe nf_nat <span class="token punctuation">;</span> modprobe xt_REDIRECT <span class="token punctuation">;</span> modprobe xt_owner<span class="token punctuation">;</span> modprobe iptable_nat<span class="token punctuation">;</span> modprobe iptable_mangle<span class="token punctuation">;</span> modprobe iptable_filter
</code></pre> 
  <p>https://stackoverflow.com/questions/73473680/service-deployed-with-istio-doesnt-start-minikube-docker-mac-m1</p> 
  <p>https://github.com/istio/istio/issues/36762</p> 
  <p>容器运行成功:</p> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@k8s-master istio-1.18.0]</span><span class="token comment"># kubectl get pods -o wide</span>
NAME                              READY   STATUS    RESTARTS   AGE   IP              NODE         NOMINATED NODE   READINESS GATES
details-v1-7c7dbcb4b5-jx866       2/2     Running   0          12m   172<span class="token punctuation">.</span>16<span class="token punctuation">.</span>85<span class="token punctuation">.</span>220   k8s-node01   <none>           <none>
productpage-v1-664d44d68d-v722l   2/2     Running   0          12m   172<span class="token punctuation">.</span>16<span class="token punctuation">.</span>58<span class="token punctuation">.</span>207   k8s-node02   <none>           <none>
ratings-v1-844796bf85-kktgq       2/2     Running   0          12m   172<span class="token punctuation">.</span>16<span class="token punctuation">.</span>85<span class="token punctuation">.</span>221   k8s-node01   <none>           <none>
reviews-v1-5cf854487-gn6xv        2/2     Running   0          12m   172<span class="token punctuation">.</span>16<span class="token punctuation">.</span>58<span class="token punctuation">.</span>206   k8s-node02   <none>           <none>
reviews-v2-955b74755-rp9b5        2/2     Running   0          12m   172<span class="token punctuation">.</span>16<span class="token punctuation">.</span>85<span class="token punctuation">.</span>222   k8s-node01   <none>           <none>
reviews-v3-797fc48bc9-wspwt       2/2     Running   0          12m   172<span class="token punctuation">.</span>16<span class="token punctuation">.</span>85<span class="token punctuation">.</span>223   k8s-node01   <none>           <none>
<span class="token namespace">[root@k8s-master istio-1.18.0]</span><span class="token comment"># </span>
</code></pre> 
 </div> 
</div>
                            </div>
                        </div>
                    </div>
                    <!--PC和WAP自适应版-->
                    <div id="SOHUCS" sid="1694592648146399232"></div>
                    <script type="text/javascript" src="/views/front/js/chanyan.js"></script>
                    <!-- 文章页-底部 动态广告位 -->
                    <div class="youdao-fixed-ad" id="detail_ad_bottom"></div>
                </div>
                <div class="col-md-3">
                    <div class="row" id="ad">
                        <!-- 文章页-右侧1 动态广告位 -->
                        <div id="right-1" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad">
                            <div class="youdao-fixed-ad" id="detail_ad_1"> </div>
                        </div>
                        <!-- 文章页-右侧2 动态广告位 -->
                        <div id="right-2" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad">
                            <div class="youdao-fixed-ad" id="detail_ad_2"></div>
                        </div>
                        <!-- 文章页-右侧3 动态广告位 -->
                        <div id="right-3" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad">
                            <div class="youdao-fixed-ad" id="detail_ad_3"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="container">
        <h4 class="pt20 mb15 mt0 border-top">你可能感兴趣的:(DevOps,云原生,kubernetes,istio,容器)</h4>
        <div id="paradigm-article-related">
            <div class="recommend-post mb30">
                <ul class="widget-links">
                    <li><a href="/article/1835505228137459712.htm"
                           title="腾讯云技术深度探索:构建高效云原生微服务架构" target="_blank">腾讯云技术深度探索:构建高效云原生微服务架构</a>
                        <span class="text-muted">我的运维人生</span>
<a class="tag" taget="_blank" href="/search/%E4%BA%91%E5%8E%9F%E7%94%9F/1.htm">云原生</a><a class="tag" taget="_blank" href="/search/%E6%9E%B6%E6%9E%84/1.htm">架构</a><a class="tag" taget="_blank" href="/search/%E8%85%BE%E8%AE%AF%E4%BA%91/1.htm">腾讯云</a><a class="tag" taget="_blank" href="/search/%E8%BF%90%E7%BB%B4%E5%BC%80%E5%8F%91/1.htm">运维开发</a><a class="tag" taget="_blank" href="/search/%E6%8A%80%E6%9C%AF%E5%85%B1%E4%BA%AB/1.htm">技术共享</a>
                        <div>腾讯云技术深度探索:构建高效云原生微服务架构在当今快速发展的技术环境中,云原生技术已成为企业数字化转型的关键驱动力。腾讯云作为行业领先的云服务提供商,不断推出创新的产品和技术,助力企业构建高效、可扩展的云原生微服务架构。本文将深入探讨腾讯云在微服务领域的最新进展,并通过一个实际案例展示如何在腾讯云平台上构建云原生应用。腾讯云微服务架构概览腾讯云微服务架构基于云原生理念,旨在帮助企业快速实现应用的容</div>
                    </li>
                    <li><a href="/article/1835495770502033408.htm"
                           title="Day17笔记-高阶函数" target="_blank">Day17笔记-高阶函数</a>
                        <span class="text-muted">~在杰难逃~</span>
<a class="tag" taget="_blank" href="/search/Python/1.htm">Python</a><a class="tag" taget="_blank" href="/search/%E7%AC%94%E8%AE%B0/1.htm">笔记</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a><a class="tag" taget="_blank" href="/search/pycharm/1.htm">pycharm</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90/1.htm">数据分析</a>
                        <div>高阶函数【重点掌握】函数的本质:函数是一个变量,函数名是一个变量名,一个函数可以作为另一个函数的参数或返回值使用如果A函数作为B函数的参数,B函数调用完成之后,会得到一个结果,则B函数被称为高阶函数常用的高阶函数:map(),reduce(),filter(),sorted()1.map()map(func,iterable),返回值是一个iterator【容器,迭代器】func:函数iterab</div>
                    </li>
                    <li><a href="/article/1835485429059645440.htm"
                           title="docker" target="_blank">docker</a>
                        <span class="text-muted">igotyback</span>
<a class="tag" taget="_blank" href="/search/eureka/1.htm">eureka</a><a class="tag" taget="_blank" href="/search/%E4%BA%91%E5%8E%9F%E7%94%9F/1.htm">云原生</a>
                        <div>Docker容器的文件系统是隔离的,但是可以通过挂载卷(Volumes)或绑定挂载(BindMounts)将宿主机的文件系统目录映射到容器内部。要查看Docker容器的映射路径,可以使用以下方法:查看容器配置:使用dockerinspect命令可以查看容器的详细配置信息,包括挂载的卷。例如:bashdockerinspect在输出的JSON格式中,查找"Mounts"部分,这里会列出所有的挂载信息</div>
                    </li>
                    <li><a href="/article/1835457442260021248.htm"
                           title="ArrayList 源码解析" target="_blank">ArrayList 源码解析</a>
                        <span class="text-muted">程序猿进阶</span>
<a class="tag" taget="_blank" href="/search/Java%E5%9F%BA%E7%A1%80/1.htm">Java基础</a><a class="tag" taget="_blank" href="/search/ArrayList/1.htm">ArrayList</a><a class="tag" taget="_blank" href="/search/List/1.htm">List</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E9%9D%A2%E8%AF%95/1.htm">面试</a><a class="tag" taget="_blank" href="/search/%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96/1.htm">性能优化</a><a class="tag" taget="_blank" href="/search/%E6%9E%B6%E6%9E%84%E8%AE%BE%E8%AE%A1/1.htm">架构设计</a><a class="tag" taget="_blank" href="/search/idea/1.htm">idea</a>
                        <div>ArrayList是Java集合框架中的一个动态数组实现,提供了可变大小的数组功能。它继承自AbstractList并实现了List接口,是顺序容器,即元素存放的数据与放进去的顺序相同,允许放入null元素,底层通过数组实现。除该类未实现同步外,其余跟Vector大致相同。每个ArrayList都有一个容量capacity,表示底层数组的实际大小,容器内存储元素的个数不能多于当前容量。当向容器中添</div>
                    </li>
                    <li><a href="/article/1835448111909138432.htm"
                           title="react-intl——react国际化使用方案" target="_blank">react-intl——react国际化使用方案</a>
                        <span class="text-muted">苹果酱0567</span>
<a class="tag" taget="_blank" href="/search/%E9%9D%A2%E8%AF%95%E9%A2%98%E6%B1%87%E6%80%BB%E4%B8%8E%E8%A7%A3%E6%9E%90/1.htm">面试题汇总与解析</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a><a class="tag" taget="_blank" href="/search/%E4%B8%AD%E9%97%B4%E4%BB%B6/1.htm">中间件</a><a class="tag" taget="_blank" href="/search/spring/1.htm">spring</a><a class="tag" taget="_blank" href="/search/boot/1.htm">boot</a><a class="tag" taget="_blank" href="/search/%E5%90%8E%E7%AB%AF/1.htm">后端</a>
                        <div>国际化介绍i18n:internationalization国家化简称,首字母+首尾字母间隔的字母个数+尾字母,类似的还有k8s(Kubernetes)React-intl是React中最受欢迎的库。使用步骤安装#usenpmnpminstallreact-intl-D#useyarn项目入口文件配置//index.tsximportReactfrom"react";importReactDOMf</div>
                    </li>
                    <li><a href="/article/1835422770016645120.htm"
                           title="《 C++ 修炼全景指南:四 》揭秘 C++ List 容器背后的实现原理,带你构建自己的双向链表" target="_blank">《 C++ 修炼全景指南:四 》揭秘 C++ List 容器背后的实现原理,带你构建自己的双向链表</a>
                        <span class="text-muted">Lenyiin</span>
<a class="tag" taget="_blank" href="/search/%E6%8A%80%E6%9C%AF%E6%8C%87%E5%8D%97/1.htm">技术指南</a><a class="tag" taget="_blank" href="/search/C%2B%2B/1.htm">C++</a><a class="tag" taget="_blank" href="/search/%E4%BF%AE%E7%82%BC%E5%85%A8%E6%99%AF%E6%8C%87%E5%8D%97/1.htm">修炼全景指南</a><a class="tag" taget="_blank" href="/search/c%2B%2B/1.htm">c++</a><a class="tag" taget="_blank" href="/search/list/1.htm">list</a><a class="tag" taget="_blank" href="/search/%E9%93%BE%E8%A1%A8/1.htm">链表</a><a class="tag" taget="_blank" href="/search/stl/1.htm">stl</a>
                        <div>本篇博客,我们将详细讲解如何从头实现一个功能齐全且强大的C++List容器,并深入到各个细节。这篇博客将包括每一步的代码实现、解释以及扩展功能的探讨,目标是让初学者也能轻松理解。一、简介1.1、背景介绍在C++中,std::list是一个基于双向链表的容器,允许高效的插入和删除操作,适用于频繁插入和删除操作的场景。与动态数组不同,list允许常数时间内的插入和删除操作,支持双向遍历。这篇文章将详细</div>
                    </li>
                    <li><a href="/article/1835399957885054976.htm"
                           title="docker from指令的含义_多个FROM-含义" target="_blank">docker from指令的含义_多个FROM-含义</a>
                        <span class="text-muted">weixin_39722188</span>
<a class="tag" taget="_blank" href="/search/docker/1.htm">docker</a><a class="tag" taget="_blank" href="/search/from%E6%8C%87%E4%BB%A4%E7%9A%84%E5%90%AB%E4%B9%89/1.htm">from指令的含义</a>
                        <div>小编典典什么是基本图片?一组文件,加上EXPOSE端口ENTRYPOINT和CMD。您可以添加文件并基于该基础图像构建新图像,Dockerfile并以FROM指令开头:后面提到的图像FROM是新图像的“基础图像”。这是否意味着如果我neo4j/neo4j在FROM指令中声明,则在运行映像时,neo数据库将自动运行并且可在端口7474的容器中使用?仅当您不覆盖CMD和时ENTRYPOINT。但是图像</div>
                    </li>
                    <li><a href="/article/1835399831116410880.htm"
                           title="Dockerfile FROM 两个" target="_blank">Dockerfile FROM 两个</a>
                        <span class="text-muted">redDelta</span>

                        <div>Docker相关视频讲解:什么是容器Docker介绍实现"DockerfileFROM两个"的步骤步骤表格步骤操作1创建一个Dockerfile文件2写入FROM指令3构建第一个镜像4创建第二个Dockerfile文件5写入FROM指令6构建第二个镜像7合并两个镜像操作步骤说明步骤1:创建一个Dockerfile文件使用任意文本编辑器创建一个名为Dockerfile的文件。登录后复制#Docker</div>
                    </li>
                    <li><a href="/article/1835395039572881408.htm"
                           title="Dockerfile命令详解之 FROM" target="_blank">Dockerfile命令详解之 FROM</a>
                        <span class="text-muted">清风怎不知意</span>
<a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8%E5%8C%96/1.htm">容器化</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E5%89%8D%E7%AB%AF/1.htm">前端</a><a class="tag" taget="_blank" href="/search/javascript/1.htm">javascript</a>
                        <div>许多同学不知道Dockerfile应该如何写,不清楚Dockerfile中的指令分别有什么意义,能达到什么样的目的,接下来我将在容器化专栏中详细的为大家解释每一个指令的含义以及用法。专栏订阅传送门https://blog.csdn.net/qq_38220908/category_11989778.html指令不区分大小写。但是,按照惯例,它们应该是大写的,以便更容易地将它们与参数区分开来。(引用</div>
                    </li>
                    <li><a href="/article/1835379083945537536.htm"
                           title="leetcode 11. 盛最多水的容器" target="_blank">leetcode 11. 盛最多水的容器</a>
                        <span class="text-muted">Source_Chang</span>

                        <div>leetcode核心思想:双指针,数字小的那个指针移动classSolution{public:intmaxArea(vector&height){intleft=0;intright=height.size()-1;intmaxArea=0;while(left<right){maxArea=max(min(height[left],height[right])*(right-left),max</div>
                    </li>
                    <li><a href="/article/1835378774955356160.htm"
                           title="Istio pilot-discovery服务发现源码解析(1.13版本)" target="_blank">Istio pilot-discovery服务发现源码解析(1.13版本)</a>
                        <span class="text-muted">xidianjiapei001</span>
<a class="tag" taget="_blank" href="/search/%23/1.htm">#</a><a class="tag" taget="_blank" href="/search/Istio/1.htm">Istio</a><a class="tag" taget="_blank" href="/search/istio/1.htm">istio</a><a class="tag" taget="_blank" href="/search/%E4%BA%91%E5%8E%9F%E7%94%9F/1.htm">云原生</a><a class="tag" taget="_blank" href="/search/%E6%9C%8D%E5%8A%A1%E5%8F%91%E7%8E%B0/1.htm">服务发现</a>
                        <div>Istiopilot-discovery服务发现介绍工作机制初始化初始化Config控制器初始化Service控制器controller初始化NamespaceServiceNodePodPilotDiscovery各组件启动流程DiscoveryServer接收Envoy的gRPC连接请求流程Config变化后向Envoy推送更新的流程总结参考介绍IstioPilot的代码分为Pilot-Dis</div>
                    </li>
                    <li><a href="/article/1835375621996376064.htm"
                           title="Kubernetes数据持久化" target="_blank">Kubernetes数据持久化</a>
                        <span class="text-muted">看清所苡看轻</span>
<a class="tag" taget="_blank" href="/search/kubernetes%28k8s%29/1.htm">kubernetes(k8s)</a><a class="tag" taget="_blank" href="/search/emptyDir/1.htm">emptyDir</a><a class="tag" taget="_blank" href="/search/HostPath/1.htm">HostPath</a><a class="tag" taget="_blank" href="/search/pv/1.htm">pv</a><a class="tag" taget="_blank" href="/search/pvc/1.htm">pvc</a><a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a>
                        <div>在k8s中,Volume(数据卷)存在明确的生命周期(与包含该数据卷的容器组(pod)相同)。因此Volume的生命周期比同一容器组(pod)中任意容器的生命周期要更长,不管容器重启了多少次,数据都被保留下来。当然,如果pod不存在了,数据卷自然退出了。此时,根据pod所使用的数据卷类型不同,数据可能随着数据卷的退出而删除,也可能被真正持久化,并在下次容器组重启时仍然可以使用。从根本上来说,一个数</div>
                    </li>
                    <li><a href="/article/1835364027488890880.htm"
                           title="leetcode刷题day13|二叉树Part01(递归遍历、迭代遍历、统一迭代、层序遍历)" target="_blank">leetcode刷题day13|二叉树Part01(递归遍历、迭代遍历、统一迭代、层序遍历)</a>
                        <span class="text-muted">小冉在学习</span>
<a class="tag" taget="_blank" href="/search/leetcode/1.htm">leetcode</a><a class="tag" taget="_blank" href="/search/%E7%AE%97%E6%B3%95/1.htm">算法</a><a class="tag" taget="_blank" href="/search/%E8%81%8C%E5%9C%BA%E5%92%8C%E5%8F%91%E5%B1%95/1.htm">职场和发展</a>
                        <div>递归遍历思路:使用递归的方式比较简单。1、递归函数的传参:因为最后输出一个数组,所以需要传入根节点和一个容器,本来想写数组,但发现长度不能确定,所以选择list。2、终止条件:当访问的节点为空时,return3、递归函数的逻辑:先访问一个节点,递归访问其他节点144.二叉树的前序遍历代码如下:classSolution{publicListpreorderTraversal(TreeNoderoo</div>
                    </li>
                    <li><a href="/article/1835361001260806144.htm"
                           title="Kubernetes部署MySQL数据持久化" target="_blank">Kubernetes部署MySQL数据持久化</a>
                        <span class="text-muted">沫殇-MS</span>
<a class="tag" taget="_blank" href="/search/Kubernetes/1.htm">Kubernetes</a><a class="tag" taget="_blank" href="/search/MySQL%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">MySQL数据库</a><a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a><a class="tag" taget="_blank" href="/search/mysql/1.htm">mysql</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8/1.htm">容器</a>
                        <div>一、安装配置NFS服务端1、安装nfs-kernel-server:sudoapt-yinstallnfs-kernel-server2、服务端创建共享目录#列出所有可用块设备的信息lsblk#格式化磁盘sudomkfs-text4/dev/sdb#创建一个目录:sudomkdir-p/data/nfs/mysql#更改目录权限:sudochown-Rnobody:nogroup/data/nfs</div>
                    </li>
                    <li><a href="/article/1835354574077128704.htm"
                           title="Kubernetes的3种数据持久化方式" target="_blank">Kubernetes的3种数据持久化方式</a>
                        <span class="text-muted">Seal^_^</span>
<a class="tag" taget="_blank" href="/search/%E3%80%90%E4%BA%91%E5%8E%9F%E7%94%9F%E3%80%91%E5%AE%B9%E5%99%A8%E5%8C%96%E4%B8%8E%E7%BC%96%E6%8E%92%E6%8A%80%E6%9C%AF/1.htm">【云原生】容器化与编排技术</a><a class="tag" taget="_blank" href="/search/%E6%8C%81%E7%BB%AD%E9%9B%86%E6%88%90/1.htm">持续集成</a><a class="tag" taget="_blank" href="/search/%23/1.htm">#</a><a class="tag" taget="_blank" href="/search/Kubernetes/1.htm">Kubernetes</a><a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8/1.htm">容器</a><a class="tag" taget="_blank" href="/search/%E4%BA%91%E5%8E%9F%E7%94%9F/1.htm">云原生</a><a class="tag" taget="_blank" href="/search/EmptyDir/1.htm">EmptyDir</a><a class="tag" taget="_blank" href="/search/%E9%9D%A2%E8%AF%95/1.htm">面试</a><a class="tag" taget="_blank" href="/search/HostPath/1.htm">HostPath</a>
                        <div>Kubernetes的3种数据持久化方式1.EmptyDir2.HostPath3.PersistentVolume(PV)TheBegin点点关注,收藏不迷路Kubernetes提供了几种数据持久化方式,以满足不同场景的需求:1.EmptyDir用途:临时数据存储,Pod内容器间共享。特点:生命周期与Pod相同,Pod删除时数据也删除。2.HostPath用途:访问宿主机特定文件或目录。特点:增</div>
                    </li>
                    <li><a href="/article/1835353689854930944.htm"
                           title="【Kubernetes】常见面试题汇总(十一)" target="_blank">【Kubernetes】常见面试题汇总(十一)</a>
                        <span class="text-muted">summer.335</span>
<a class="tag" taget="_blank" href="/search/Kubernetes/1.htm">Kubernetes</a><a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8/1.htm">容器</a><a class="tag" taget="_blank" href="/search/%E4%BA%91%E5%8E%9F%E7%94%9F/1.htm">云原生</a>
                        <div>目录33.简述Kubernetes外部如何访问集群内的服务?34.简述Kubernetesingress?35.简述Kubernetes镜像的下载策略?33.简述Kubernetes外部如何访问集群内的服务?(1)对于Kubernetes,集群外的客户端默认情况,无法通过Pod的IP地址或者Service的虚拟IP地址:虚拟端口号进行访问。(2)通常可以通过以下方式进行访问Kubernetes集群</div>
                    </li>
                    <li><a href="/article/1835351925957160960.htm"
                           title="k8s中Service暴露的种类以及用法" target="_blank">k8s中Service暴露的种类以及用法</a>
                        <span class="text-muted">听说唐僧不吃肉</span>
<a class="tag" taget="_blank" href="/search/K8S/1.htm">K8S</a><a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8/1.htm">容器</a><a class="tag" taget="_blank" href="/search/%E4%BA%91%E5%8E%9F%E7%94%9F/1.htm">云原生</a>
                        <div>一、说明在Kubernetes中,有几种不同的方式可以将服务(Service)暴露给外部流量。这些方式通过定义服务的spec.type字段来确定。二、详解1.ClusterIP定义:默认类型,服务只能在集群内部访问。作用:通过集群内部IP地址暴露服务。示例:spec:type:ClusterIPports:-port:80targetPo</div>
                    </li>
                    <li><a href="/article/1835347257772306432.htm"
                           title="Kubernetes 自定义控制器开发" target="_blank">Kubernetes 自定义控制器开发</a>
                        <span class="text-muted">IT回忆录</span>
<a class="tag" taget="_blank" href="/search/Kubenetes/1.htm">Kubenetes</a><a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a>
                        <div>目录前言一、CRD二、创建数据库表(Mysql)二、控制器开发1.使用kubernetes的examplecontroller模板2.在controller.go中新增数据表监听方法3.修改tools工具生成资源对象结构体定义这里记录开发k8s控制器的一般方式,controller开发主要使用k8s提供的client-go库进行。前言Controller监听集群内部资源对象的变化,编辑资源对象(增</div>
                    </li>
                    <li><a href="/article/1835344356878413824.htm"
                           title="用kubedam搭建的k8s证书过期处理方法" target="_blank">用kubedam搭建的k8s证书过期处理方法</a>
                        <span class="text-muted">我滴鬼鬼呀wks</span>
<a class="tag" taget="_blank" href="/search/k8s/1.htm">k8s</a><a class="tag" taget="_blank" href="/search/1024%E7%A8%8B%E5%BA%8F%E5%91%98%E8%8A%82/1.htm">1024程序员节</a>
                        <div>kubeadm部署的k8s证书过期1、查看证书过期时间kubeadmalphacertscheck-expiration若证书已经过期无法试用kubectl命令建议修改服务器时间到未过期的时间段2、配置kube-controller-manager.yaml文件cat/etc/kubernetes/manifests/kube-controller-manager.yamlapiVersion:v</div>
                    </li>
                    <li><a href="/article/1835340955637608448.htm"
                           title="k8s证书过期问题处理" target="_blank">k8s证书过期问题处理</a>
                        <span class="text-muted">olina_qin</span>
<a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8/1.htm">容器</a><a class="tag" taget="_blank" href="/search/%E4%BA%91%E5%8E%9F%E7%94%9F/1.htm">云原生</a>
                        <div>k8s证书过期问题处理opensslx509-in/etc/kubernetes/pki/apiserver.crt-noout-dateskubeadmcertsrenewallsystemctlrestartkubeleopensslx509-in/etc/kubernetes/pki/apiserver.crt-noout-text|grep"NotAfter"cp/etc/kubernet</div>
                    </li>
                    <li><a href="/article/1835337301350248448.htm"
                           title="Kubernetes Ingress 控制器(Nginx)安装与使用教程" target="_blank">Kubernetes Ingress 控制器(Nginx)安装与使用教程</a>
                        <span class="text-muted">农优影</span>

                        <div>KubernetesIngress控制器(Nginx)安装与使用教程kubernetes-ingressNGINXandNGINXPlusIngressControllersforKubernetes项目地址:https://gitcode.com/gh_mirrors/ku/kubernetes-ingress1.项目目录结构及介绍在nginxinc/kubernetes-ingress仓库中,</div>
                    </li>
                    <li><a href="/article/1835331377520799744.htm"
                           title="【K8s】专题十一:Kubernetes 集群证书过期处理方法" target="_blank">【K8s】专题十一:Kubernetes 集群证书过期处理方法</a>
                        <span class="text-muted">行者Sun1989</span>
<a class="tag" taget="_blank" href="/search/Kubernetes/1.htm">Kubernetes</a><a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a><a class="tag" taget="_blank" href="/search/%E4%BA%91%E5%8E%9F%E7%94%9F/1.htm">云原生</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8/1.htm">容器</a>
                        <div>本文内容均来自个人笔记并重新梳理,如有错误欢迎指正!如果对您有帮助,烦请点赞、关注、转发、订阅专栏!专栏订阅入口Linux专栏|Docker专栏|Kubernetes专栏往期精彩文章【Docker】(全网首发)KylinV10下MySQL容器内存占用异常的解决方法【Docker】(全网首发)KylinV10下MySQL容器内存占用异常的解决方法(续)【Docker】MySQL源码构建Docker镜</div>
                    </li>
                    <li><a href="/article/1835310380474265600.htm"
                           title="Java面试笔记记录6" target="_blank">Java面试笔记记录6</a>
                        <span class="text-muted">今天背八股了吗</span>
<a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E9%9D%A2%E8%AF%95/1.htm">面试</a><a class="tag" taget="_blank" href="/search/%E7%AC%94%E8%AE%B0/1.htm">笔记</a>
                        <div>1.Spring是什么?特性?有哪些模块?Spring是一个轻量级、非入侵式的控制反转Ioc和面向切面AOP的框架。特性:1.Ioc和DISpring的核心就是一个大的工厂容器,可以维护所有对象的创建和依赖关系,Spring工厂用于生成Bean,并且管理Bean的生命周期,实现高内聚低耦合的设计理念。2.AOP编程Spring提供面向切面编程,可以方便实现对程序进行权限拦截、运行监控等切面功能。3</div>
                    </li>
                    <li><a href="/article/1835269935358636032.htm"
                           title="Docker学习十一:Kubernetes概述" target="_blank">Docker学习十一:Kubernetes概述</a>
                        <span class="text-muted">爱打羽球的程序猿</span>
<a class="tag" taget="_blank" href="/search/Docker%E5%AD%A6%E4%B9%A0%E7%B3%BB%E5%88%97/1.htm">Docker学习系列</a><a class="tag" taget="_blank" href="/search/docker/1.htm">docker</a><a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a><a class="tag" taget="_blank" href="/search/%E5%AD%A6%E4%B9%A0/1.htm">学习</a>
                        <div>一、Kubernetes简介2006年,Google提出了云计算的概念,当时的云计算领域还是以虚拟机为代表的云平台。2013年,Docker横空出世,Docker提出了镜像、仓库等核心概念,规范了服务的交付标准,使得复杂服务的落地变得更加简单,之后Docker又定义了OCI标准,Docker在容器领域称为事实的标准。但是,Docker诞生只是帮助定义了开发和交付标准,如果想要在生产环境中大批量的使</div>
                    </li>
                    <li><a href="/article/1835269304761806848.htm"
                           title="Cloud Native Weekly | 华为云抢先发布Redis5.0,红帽宣布收购混合云提供商" target="_blank">Cloud Native Weekly | 华为云抢先发布Redis5.0,红帽宣布收购混合云提供商</a>
                        <span class="text-muted">weixin_34302561</span>
<a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">数据库</a><a class="tag" taget="_blank" href="/search/devops/1.htm">devops</a><a class="tag" taget="_blank" href="/search/%E5%A4%A7%E6%95%B0%E6%8D%AE/1.htm">大数据</a>
                        <div>1——华为云抢先发布Redis5.02——DigitalOceanK8s服务正式上线3——红帽宣布收购混合云提供商NooBaa4——微软发布多项AzureKubernetes服务更新1华为云抢先发布Redis5.012月17日,华为云在DCS2.0的基础上,快人一步,抢先推出了新的Redis5.0产品,这是一个崭新的突破。目前国内在缓存领域的发展普遍停留在Redis4.0阶段,华为云率先发布了Re</div>
                    </li>
                    <li><a href="/article/1835267665455837184.htm"
                           title="Halo 开发者指南——容器私有化部署" target="_blank">Halo 开发者指南——容器私有化部署</a>
                        <span class="text-muted">SHENHUANJIE</span>
<a class="tag" taget="_blank" href="/search/Docker/1.htm">Docker</a><a class="tag" taget="_blank" href="/search/Halo/1.htm">Halo</a><a class="tag" taget="_blank" href="/search/%E5%8D%8E%E4%B8%BA%E4%BA%91/1.htm">华为云</a><a class="tag" taget="_blank" href="/search/SWR/1.htm">SWR</a><a class="tag" taget="_blank" href="/search/Registry/1.htm">Registry</a>
                        <div>华为云SWR私有化部署镜像构建dockerbuild-thalo-dev/halo:2.20.0.上传镜像镜像标签sudodockertag{镜像名称}:{版本名称}swr.cn-south-1.myhuaweicloud.com/{组织名称}/{镜像名称}:{版本名称}sudodockertaghalo-dev/halo:2.20.0swr.cn-south-1.myhuaweicloud.co</div>
                    </li>
                    <li><a href="/article/1835262244313722880.htm"
                           title="SpringBoot整合ES搜索引擎 实现网站热搜词及热度计算" target="_blank">SpringBoot整合ES搜索引擎 实现网站热搜词及热度计算</a>
                        <span class="text-muted">码踏云端</span>
<a class="tag" taget="_blank" href="/search/springboot/1.htm">springboot</a><a class="tag" taget="_blank" href="/search/Elasticsearch/1.htm">Elasticsearch</a><a class="tag" taget="_blank" href="/search/spring/1.htm">spring</a><a class="tag" taget="_blank" href="/search/boot/1.htm">boot</a><a class="tag" taget="_blank" href="/search/elasticsearch/1.htm">elasticsearch</a><a class="tag" taget="_blank" href="/search/%E5%90%8E%E7%AB%AF/1.htm">后端</a><a class="tag" taget="_blank" href="/search/%E7%83%AD%E6%90%9C%E8%AF%8D/1.htm">热搜词</a><a class="tag" taget="_blank" href="/search/%E7%83%AD%E5%BA%A6%E8%AE%A1%E7%AE%97/1.htm">热度计算</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a>
                        <div>博主简介:历代文学网(PC端可以访问:https://literature.sinhy.com/#/literature?__c=1000,移动端可微信小程序搜索“历代文学”)总架构师,15年工作经验,精通Java编程,高并发设计,Springboot和微服务,熟悉Linux,ESXI虚拟化以及云原生Docker和K8s,热衷于探索科技的边界,并将理论知识转化为实际应用。保持对新技术的好奇心,乐于</div>
                    </li>
                    <li><a href="/article/1835259716809355264.htm"
                           title="小白 | 华为云docker设置镜像加速器" target="_blank">小白 | 华为云docker设置镜像加速器</a>
                        <span class="text-muted">伏一</span>
<a class="tag" taget="_blank" href="/search/%E5%B7%A5%E5%85%B7%E5%AE%89%E8%A3%85/1.htm">工具安装</a><a class="tag" taget="_blank" href="/search/%E5%8D%8E%E4%B8%BA%E4%BA%91/1.htm">华为云</a><a class="tag" taget="_blank" href="/search/docker/1.htm">docker</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8/1.htm">容器</a>
                        <div>一、操作场景通过dockerpull命令下载镜像中心的公有镜像时,往往会因为网络原因而需要很长时间,甚至可能因超时而下载失败。为此,容器镜像服务提供了镜像下载加速功能,帮助您获得更快的下载体验。二、约束与限制构建镜像的客户端所安装的容器引擎(Docker)版本必须为1.11.2及以上。“华北-乌兰察布一”、“亚太-雅加达”、“拉美-墨西哥城一”、“拉美-墨西哥城二”和“拉美-圣保罗一”区域不支持该</div>
                    </li>
                    <li><a href="/article/1835245099416645632.htm"
                           title="docker改容器IP的两种方法" target="_blank">docker改容器IP的两种方法</a>
                        <span class="text-muted">redmond88</span>
<a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/docker/1.htm">docker</a><a class="tag" taget="_blank" href="/search/tcp%2Fip/1.htm">tcp/ip</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8/1.htm">容器</a>
                        <div>最简单实用的方法:docker默认的内网网段为172.17.0.0/16,如果公司内网网段也是172.17.x.x的话,就会发生路由冲突。解决办法改路由比较办法,可以一开始就将docker配置的bip改成169.254.0.1/24,可以避免冲突。在daemon配置文件里加个"bip":“169.254.0.1/24”,重启docker就可以了1234[root@st-dev6~]#vim/etc</div>
                    </li>
                    <li><a href="/article/1835225687028494336.htm"
                           title="java获取applicationcontext,SpringBoot获取ApplicationContext的3种方式" target="_blank">java获取applicationcontext,SpringBoot获取ApplicationContext的3种方式</a>
                        <span class="text-muted">花儿街参考</span>

                        <div>ApplicationContext是什么?简单来说就是Spring中的容器,可以用来获取容器中的各种bean组件,注册监听事件,加载资源文件等功能。ApplicationContext获取的几种方式1直接使用Autowired注入@ComponentpublicclassBook1{@AutowiredprivateApplicationContextapplicationContext;pub</div>
                    </li>
                                <li><a href="/article/71.htm"
                                       title="Linux的Initrd机制" target="_blank">Linux的Initrd机制</a>
                                    <span class="text-muted">被触发</span>
<a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a>
                                    <div>Linux 的 initrd 技术是一个非常普遍使用的机制,linux2.6 内核的 initrd 的文件格式由原来的文件系统镜像文件转变成了 cpio 格式,变化不仅反映在文件格式上, linux 内核对这两种格式的 initrd 的处理有着截然的不同。本文首先介绍了什么是 initrd 技术,然后分别介绍了 Linux2.4 内核和 2.6 内核的 initrd 的处理流程。最后通过对 Lin</div>
                                </li>
                                <li><a href="/article/198.htm"
                                       title="maven本地仓库路径修改" target="_blank">maven本地仓库路径修改</a>
                                    <span class="text-muted">bitcarter</span>
<a class="tag" taget="_blank" href="/search/maven/1.htm">maven</a>
                                    <div>默认maven本地仓库路径:C:\Users\Administrator\.m2 
 
修改maven本地仓库路径方法: 
    
1.打开E:\maven\apache-maven-2.2.1\conf\settings.xml 
    
2.找到 
       </div>
                                </li>
                                <li><a href="/article/325.htm"
                                       title="XSD和XML中的命名空间" target="_blank">XSD和XML中的命名空间</a>
                                    <span class="text-muted">darrenzhu</span>
<a class="tag" taget="_blank" href="/search/xml/1.htm">xml</a><a class="tag" taget="_blank" href="/search/xsd/1.htm">xsd</a><a class="tag" taget="_blank" href="/search/schema/1.htm">schema</a><a class="tag" taget="_blank" href="/search/namespace/1.htm">namespace</a><a class="tag" taget="_blank" href="/search/%E5%91%BD%E5%90%8D%E7%A9%BA%E9%97%B4/1.htm">命名空间</a>
                                    <div>http://www.360doc.com/content/12/0418/10/9437165_204585479.shtml 

http://blog.csdn.net/wanghuan203/article/details/9203621 

http://blog.csdn.net/wanghuan203/article/details/9204337 
 

http://www.cn</div>
                                </li>
                                <li><a href="/article/452.htm"
                                       title="Java 求素数运算" target="_blank">Java 求素数运算</a>
                                    <span class="text-muted">周凡杨</span>
<a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E7%AE%97%E6%B3%95/1.htm">算法</a><a class="tag" taget="_blank" href="/search/%E7%B4%A0%E6%95%B0/1.htm">素数</a>
                                    <div>网络上对求素数之解数不胜数,我在此总结归纳一下,同时对一些编码,加以改进,效率有成倍热提高。   
第一种:    
  
原理: 6N(+-)1法              任何一个自然数,总可以表示成为如下的形式之一: 6N,6N+1,6N+2,6N+3,6N+4,6N+5 (N=0,1,2,…)    </div>
                                </li>
                                <li><a href="/article/579.htm"
                                       title="java 单例模式" target="_blank">java 单例模式</a>
                                    <span class="text-muted">g21121</span>
<a class="tag" taget="_blank" href="/search/java/1.htm">java</a>
                                    <div>想必单例模式大家都不会陌生,有如下两种方式来实现单例模式: 
  
class Singleton {
  private static Singleton instance=new Singleton();
  private Singleton(){}
  static Singleton getInstance() {
      return instance;
  }</div>
                                </li>
                                <li><a href="/article/706.htm"
                                       title="Linux下Mysql源码安装" target="_blank">Linux下Mysql源码安装</a>
                                    <span class="text-muted">510888780</span>
<a class="tag" taget="_blank" href="/search/mysql/1.htm">mysql</a>
                                    <div>1.假设已经有mysql-5.6.23-linux-glibc2.5-x86_64.tar.gz 
 
(1)创建mysql的安装目录及数据库存放目录       
解压缩下载的源码包,目录结构,特殊指定的目录除外: 
          </div>
                                </li>
                                <li><a href="/article/833.htm"
                                       title="32位和64位操作系统" target="_blank">32位和64位操作系统</a>
                                    <span class="text-muted">墙头上一根草</span>
<a class="tag" taget="_blank" href="/search/32%E4%BD%8D%E5%92%8C64%E4%BD%8D%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/1.htm">32位和64位操作系统</a>
                                    <div>32位和64位操作系统是指:CPU一次处理数据的能力是32位还是64位。现在市场上的CPU一般都是64位的,但是这些CPU并不是真正意义上的64 位CPU,里面依然保留了大部分32位的技术,只是进行了部分64位的改进。32位和64位的区别还涉及了内存的寻址方面,32位系统的最大寻址空间是2 的32次方= 4294967296(bit)= 4(GB)左右,而64位系统的最大寻址空间的寻址空间则达到了</div>
                                </li>
                                <li><a href="/article/960.htm"
                                       title="我的spring学习笔记10-轻量级_Spring框架" target="_blank">我的spring学习笔记10-轻量级_Spring框架</a>
                                    <span class="text-muted">aijuans</span>
<a class="tag" taget="_blank" href="/search/Spring+3/1.htm">Spring 3</a>
                                    <div>一、问题提问: 
 
    → 请简单介绍一下什么是轻量级? 
 
    轻量级(Leightweight)是相对于一些重量级的容器来说的,比如Spring的核心是一个轻量级的容器,Spring的核心包在文件容量上只有不到1M大小,使用Spring核心包所需要的资源也是很少的,您甚至可以在小型设备中使用Spring。 
 
 </div>
                                </li>
                                <li><a href="/article/1087.htm"
                                       title="mongodb 环境搭建及简单CURD" target="_blank">mongodb 环境搭建及简单CURD</a>
                                    <span class="text-muted">antlove</span>
<a class="tag" taget="_blank" href="/search/Web/1.htm">Web</a><a class="tag" taget="_blank" href="/search/Install/1.htm">Install</a><a class="tag" taget="_blank" href="/search/curd/1.htm">curd</a><a class="tag" taget="_blank" href="/search/NoSQL/1.htm">NoSQL</a><a class="tag" taget="_blank" href="/search/mongo/1.htm">mongo</a>
                                    <div>一 搭建mongodb环境 
1. 在mongo官网下载mongodb 
2. 在本地创建目录 "D:\Program Files\mongodb-win32-i386-2.6.4\data\db" 
3. 运行mongodb服务 [mongod.exe --dbpath "D:\Program Files\mongodb-win32-i386-2.6.4\data\</div>
                                </li>
                                <li><a href="/article/1214.htm"
                                       title="数据字典和动态视图" target="_blank">数据字典和动态视图</a>
                                    <span class="text-muted">百合不是茶</span>
<a class="tag" taget="_blank" href="/search/oracle/1.htm">oracle</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%AD%97%E5%85%B8/1.htm">数据字典</a><a class="tag" taget="_blank" href="/search/%E5%8A%A8%E6%80%81%E8%A7%86%E5%9B%BE/1.htm">动态视图</a><a class="tag" taget="_blank" href="/search/%E7%B3%BB%E7%BB%9F%E5%92%8C%E5%AF%B9%E8%B1%A1%E6%9D%83%E9%99%90/1.htm">系统和对象权限</a>
                                    <div>数据字典(data dictionary)是 Oracle 数据库的一个重要组成部分,这是一组用于记录数据库信息的只读(read-only)表。随着数据库的启动而启动,数据库关闭时数据字典也关闭   数据字典中包含 
  
 
 数据库中所有方案对象(schema object)的定义(包括表,视图,索引,簇,同义词,序列,过程,函数,包,触发器等等) 
 数据库为一</div>
                                </li>
                                <li><a href="/article/1341.htm"
                                       title="多线程编程一般规则" target="_blank">多线程编程一般规则</a>
                                    <span class="text-muted">bijian1013</span>
<a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/thread/1.htm">thread</a><a class="tag" taget="_blank" href="/search/%E5%A4%9A%E7%BA%BF%E7%A8%8B/1.htm">多线程</a><a class="tag" taget="_blank" href="/search/java%E5%A4%9A%E7%BA%BF%E7%A8%8B/1.htm">java多线程</a>
                                    <div>       如果两个工两个以上的线程都修改一个对象,那么把执行修改的方法定义为被同步的,如果对象更新影响到只读方法,那么只读方法也要定义成同步的。 
       不要滥用同步。如果在一个对象内的不同的方法访问的不是同一个数据,就不要将方法设置为synchronized的。 
</div>
                                </li>
                                <li><a href="/article/1468.htm"
                                       title="将文件或目录拷贝到另一个Linux系统的命令scp" target="_blank">将文件或目录拷贝到另一个Linux系统的命令scp</a>
                                    <span class="text-muted">bijian1013</span>
<a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/unix/1.htm">unix</a><a class="tag" taget="_blank" href="/search/scp/1.htm">scp</a>
                                    <div>一.功能说明        scp就是security copy,用于将文件或者目录从一个Linux系统拷贝到另一个Linux系统下。scp传输数据用的是SSH协议,保证了数据传输的安全,其格式如下:        scp 远程用户名@IP地址:文件的绝对路径</div>
                                </li>
                                <li><a href="/article/1595.htm"
                                       title="【持久化框架MyBatis3五】MyBatis3一对多关联查询" target="_blank">【持久化框架MyBatis3五】MyBatis3一对多关联查询</a>
                                    <span class="text-muted">bit1129</span>
<a class="tag" taget="_blank" href="/search/Mybatis3/1.htm">Mybatis3</a>
                                    <div>以教员和课程为例介绍一对多关联关系,在这里认为一个教员可以叫多门课程,而一门课程只有1个教员教,这种关系在实际中不太常见,通过教员和课程是多对多的关系。 
  示例数据:
  
  
地址表: 
  
CREATE TABLE ADDRESSES 
(
  ADDR_ID INT(11) NOT NULL AUTO_INCREMENT,
  STREET VAR</div>
                                </li>
                                <li><a href="/article/1722.htm"
                                       title="cookie状态判断引发的查找问题" target="_blank">cookie状态判断引发的查找问题</a>
                                    <span class="text-muted">bitcarter</span>
<a class="tag" taget="_blank" href="/search/form/1.htm">form</a><a class="tag" taget="_blank" href="/search/cgi/1.htm">cgi</a>
                                    <div>先说一下我们的业务背景: 
1.前台将图片和文本通过form表单提交到后台,图片我们都做了base64的编码,并且前台图片进行了压缩 
2.form中action是一个cgi服务 
3.后台cgi服务同时供PC,H5,APP 
4.后台cgi中调用公共的cookie状态判断方法(公共的,大家都用,几年了没有问题) 
 
问题:(折腾两天。。。。) 
1.PC端cgi服务正常调用,cookie判断没</div>
                                </li>
                                <li><a href="/article/1849.htm"
                                       title="通过Nginx,Tomcat访问日志(access log)记录请求耗时" target="_blank">通过Nginx,Tomcat访问日志(access log)记录请求耗时</a>
                                    <span class="text-muted">ronin47</span>

                                    <div>一、Nginx通过$upstream_response_time $request_time统计请求和后台服务响应时间 
nginx.conf使用配置方式: 
log_format main '$remote_addr - $remote_user [$time_local] "$request" ''$status $body_bytes_sent "$http_r</div>
                                </li>
                                <li><a href="/article/1976.htm"
                                       title="java-67- n个骰子的点数。 把n个骰子扔在地上,所有骰子朝上一面的点数之和为S。输入n,打印出S的所有可能的值出现的概率。" target="_blank">java-67- n个骰子的点数。 把n个骰子扔在地上,所有骰子朝上一面的点数之和为S。输入n,打印出S的所有可能的值出现的概率。</a>
                                    <span class="text-muted">bylijinnan</span>
<a class="tag" taget="_blank" href="/search/java/1.htm">java</a>
                                    <div>

public class ProbabilityOfDice {

	/**
	 * Q67 n个骰子的点数
	 * 把n个骰子扔在地上,所有骰子朝上一面的点数之和为S。输入n,打印出S的所有可能的值出现的概率。
	 * 在以下求解过程中,我们把骰子看作是有序的。
	 * 例如当n=2时,我们认为(1,2)和(2,1)是两种不同的情况
	 */
	private stati</div>
                                </li>
                                <li><a href="/article/2103.htm"
                                       title="看别人的博客,觉得心情很好" target="_blank">看别人的博客,觉得心情很好</a>
                                    <span class="text-muted">Cb123456</span>
<a class="tag" taget="_blank" href="/search/%E5%8D%9A%E5%AE%A2/1.htm">博客</a><a class="tag" taget="_blank" href="/search/%E5%BF%83%E6%83%85/1.htm">心情</a>
                                    <div>   以为写博客,就是总结,就和日记一样吧,同时也在督促自己。今天看了好长时间博客: 
   职业规划: 
   http://www.iteye.com/blogs/subjects/zhiyeguihua 
  
   android学习: 
   1.http://byandby.i</div>
                                </li>
                                <li><a href="/article/2230.htm"
                                       title="[JWFD开源工作流]尝试用原生代码引擎实现循环反馈拓扑分析" target="_blank">[JWFD开源工作流]尝试用原生代码引擎实现循环反馈拓扑分析</a>
                                    <span class="text-muted">comsci</span>
<a class="tag" taget="_blank" href="/search/%E5%B7%A5%E4%BD%9C%E6%B5%81/1.htm">工作流</a>
                                    <div> 
    我们已经不满足于仅仅跳跃一次,通过对引擎的升级,今天我测试了一下循环反馈模式,大概跑了200圈,引擎报一个溢出错误 
 
     在一个流程图的结束节点中嵌入一段方程,每次引擎运行到这个节点的时候,通过实时编译器GM模块,计算这个方程,计算结果与预设值进行比较,符合条件则跳跃到开始节点,继续新一轮拓扑分析,直到遇到</div>
                                </li>
                                <li><a href="/article/2357.htm"
                                       title="JS常用的事件及方法" target="_blank">JS常用的事件及方法</a>
                                    <span class="text-muted">cwqcwqmax9</span>
<a class="tag" taget="_blank" href="/search/js/1.htm">js</a>
                                    <div>事件 描述 
onactivate 当对象设置为活动元素时触发。 
onafterupdate 当成功更新数据源对象中的关联对象后在数据绑定对象上触发。 
onbeforeactivate 对象要被设置为当前元素前立即触发。 
onbeforecut 当选中区从文档中删除之前在源对象触发。 
onbeforedeactivate 在 activeElement 从当前对象变为父文档其它对象之前立即</div>
                                </li>
                                <li><a href="/article/2484.htm"
                                       title="正则表达式验证日期格式" target="_blank">正则表达式验证日期格式</a>
                                    <span class="text-muted">dashuaifu</span>
<a class="tag" taget="_blank" href="/search/%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F/1.htm">正则表达式</a><a class="tag" taget="_blank" href="/search/IT%E5%85%B6%E5%AE%83/1.htm">IT其它</a><a class="tag" taget="_blank" href="/search/java%E5%85%B6%E5%AE%83/1.htm">java其它</a>
                                    <div>                 正则表达式验证日期格式

function isDate(d){
 var v = d.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/i);
 if(!v) {
  this.focus();
  return false;
 }
}
<input value="2000-8-8" onblu</div>
                                </li>
                                <li><a href="/article/2611.htm"
                                       title="Yii CModel.rules() 方法 、validate预定义完整列表、以及说说验证" target="_blank">Yii CModel.rules() 方法 、validate预定义完整列表、以及说说验证</a>
                                    <span class="text-muted">dcj3sjt126com</span>
<a class="tag" taget="_blank" href="/search/yii/1.htm">yii</a>
                                    <div>public array rules () {return} array 要调用 validate() 时应用的有效性规则。 返回属性的有效性规则。声明验证规则,应重写此方法。 每个规则是数组具有以下结构:array('attribute list', 'validator name', 'on'=>'scenario name', ...validation </div>
                                </li>
                                <li><a href="/article/2738.htm"
                                       title="UITextAttributeTextColor = deprecated in iOS 7.0" target="_blank">UITextAttributeTextColor = deprecated in iOS 7.0</a>
                                    <span class="text-muted">dcj3sjt126com</span>
<a class="tag" taget="_blank" href="/search/ios/1.htm">ios</a>
                                    <div>In this lesson we used the key "UITextAttributeTextColor" to change the color of the UINavigationBar appearance to white. This prompts a warning "first deprecated in iOS 7.0." 
Ins</div>
                                </li>
                                <li><a href="/article/2865.htm"
                                       title="判断一个数是质数的几种方法" target="_blank">判断一个数是质数的几种方法</a>
                                    <span class="text-muted">EmmaZhao</span>
<a class="tag" taget="_blank" href="/search/Math/1.htm">Math</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a>
                                    <div>质数也叫素数,是只能被1和它本身整除的正整数,最小的质数是2,目前发现的最大的质数是p=2^57885161-1【注1】。 
判断一个数是质数的最简单的方法如下: 
 

def isPrime1(n):
	for i in range(2, n):
		if n % i == 0:
			return False
	return True
 
但是在上面的方法中有一些冗余的计算,所以</div>
                                </li>
                                <li><a href="/article/2992.htm"
                                       title="SpringSecurity工作原理小解读" target="_blank">SpringSecurity工作原理小解读</a>
                                    <span class="text-muted">坏我一锅粥</span>
<a class="tag" taget="_blank" href="/search/SpringSecurity/1.htm">SpringSecurity</a>
                                    <div> 
   SecurityContextPersistenceFilter 
   ConcurrentSessionFilter 
   WebAsyncManagerIntegrationFilter 
   HeaderWriterFilter 
   CsrfFilter 
   LogoutFilter 
   Use</div>
                                </li>
                                <li><a href="/article/3119.htm"
                                       title="JS实现自适应宽度的Tag切换" target="_blank">JS实现自适应宽度的Tag切换</a>
                                    <span class="text-muted">ini</span>
<a class="tag" taget="_blank" href="/search/JavaScript/1.htm">JavaScript</a><a class="tag" taget="_blank" href="/search/html/1.htm">html</a><a class="tag" taget="_blank" href="/search/Web/1.htm">Web</a><a class="tag" taget="_blank" href="/search/css/1.htm">css</a><a class="tag" taget="_blank" href="/search/html5/1.htm">html5</a>
                                    <div>效果体验:http://hovertree.com/texiao/js/3.htm 
  
该效果使用纯JavaScript代码,实现TAB页切换效果,TAB标签根据内容自适应宽度,点击TAB标签切换内容页。 
HTML文件代码: 
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"</div>
                                </li>
                                <li><a href="/article/3246.htm"
                                       title="Hbase Rest API : 数据查询" target="_blank">Hbase Rest API : 数据查询</a>
                                    <span class="text-muted">kane_xie</span>
<a class="tag" taget="_blank" href="/search/REST/1.htm">REST</a><a class="tag" taget="_blank" href="/search/hbase/1.htm">hbase</a>
                                    <div>hbase(hadoop)是用java编写的,有些语言(例如python)能够对它提供良好的支持,但也有很多语言使用起来并不是那么方便,比如c#只能通过thrift访问。Rest就能很好的解决这个问题。Hbase的org.apache.hadoop.hbase.rest包提供了rest接口,它内嵌了jetty作为servlet容器。 
  
启动命令:./bin/hbase rest s</div>
                                </li>
                                <li><a href="/article/3373.htm"
                                       title="JQuery实现鼠标拖动元素移动位置(源码+注释)" target="_blank">JQuery实现鼠标拖动元素移动位置(源码+注释)</a>
                                    <span class="text-muted">明子健</span>
<a class="tag" taget="_blank" href="/search/jquery/1.htm">jquery</a><a class="tag" taget="_blank" href="/search/js/1.htm">js</a><a class="tag" taget="_blank" href="/search/%E6%BA%90%E7%A0%81/1.htm">源码</a><a class="tag" taget="_blank" href="/search/%E6%8B%96%E5%8A%A8/1.htm">拖动</a><a class="tag" taget="_blank" href="/search/%E9%BC%A0%E6%A0%87/1.htm">鼠标</a>
                                    <div>欢迎讨论指正! 
  
print.html代码: 
<!DOCTYPE html>
<html>
<head>
<meta http-equiv=Content-Type content="text/html;charset=utf-8">
<title>发票打印</title>
&l</div>
                                </li>
                                <li><a href="/article/3500.htm"
                                       title="Postgresql 连表更新字段语法 update" target="_blank">Postgresql 连表更新字段语法 update</a>
                                    <span class="text-muted">qifeifei</span>
<a class="tag" taget="_blank" href="/search/PostgreSQL/1.htm">PostgreSQL</a>
                                    <div>下面这段sql本来目的是想更新条件下的数据,可是这段sql却更新了整个表的数据。sql如下: 
UPDATE tops_visa.visa_order
SET op_audit_abort_pass_date = now()
FROM
	tops_visa.visa_order as  t1
INNER JOIN tops_visa.visa_visitor as t2 
ON t1. </div>
                                </li>
                                <li><a href="/article/3627.htm"
                                       title="将redis,memcache结合使用的方案?" target="_blank">将redis,memcache结合使用的方案?</a>
                                    <span class="text-muted">tcrct</span>
<a class="tag" taget="_blank" href="/search/redis/1.htm">redis</a><a class="tag" taget="_blank" href="/search/cache/1.htm">cache</a>
                                    <div>公司架构上使用了阿里云的服务,由于阿里的kvstore收费相当高,打算自建,自建后就需要自己维护,所以就有了一个想法,针对kvstore(redis)及ocs(memcache)的特点,想自己开发一个cache层,将需要用到list,set,map等redis方法的继续使用redis来完成,将整条记录放在memcache下,即findbyid,save等时就memcache,其它就对应使用redi</div>
                                </li>
                                <li><a href="/article/3754.htm"
                                       title="开发中遇到的诡异的bug" target="_blank">开发中遇到的诡异的bug</a>
                                    <span class="text-muted">wudixiaotie</span>
<a class="tag" taget="_blank" href="/search/bug/1.htm">bug</a>
                                    <div>今天我们服务器组遇到个问题: 
我们的服务是从Kafka里面取出数据,然后把offset存储到ssdb中,每个topic和partition都对应ssdb中不同的key,服务启动之后,每次kafka数据更新我们这边收到消息,然后存储之后就发现ssdb的值偶尔是-2,这就奇怪了,最开始我们是在代码中打印存储的日志,发现没什么问题,后来去查看ssdb的日志,才发现里面每次set的时候都会对同一个key</div>
                                </li>
                </ul>
            </div>
        </div>
    </div>

<div>
    <div class="container">
        <div class="indexes">
            <strong>按字母分类:</strong>
            <a href="/tags/A/1.htm" target="_blank">A</a><a href="/tags/B/1.htm" target="_blank">B</a><a href="/tags/C/1.htm" target="_blank">C</a><a
                href="/tags/D/1.htm" target="_blank">D</a><a href="/tags/E/1.htm" target="_blank">E</a><a href="/tags/F/1.htm" target="_blank">F</a><a
                href="/tags/G/1.htm" target="_blank">G</a><a href="/tags/H/1.htm" target="_blank">H</a><a href="/tags/I/1.htm" target="_blank">I</a><a
                href="/tags/J/1.htm" target="_blank">J</a><a href="/tags/K/1.htm" target="_blank">K</a><a href="/tags/L/1.htm" target="_blank">L</a><a
                href="/tags/M/1.htm" target="_blank">M</a><a href="/tags/N/1.htm" target="_blank">N</a><a href="/tags/O/1.htm" target="_blank">O</a><a
                href="/tags/P/1.htm" target="_blank">P</a><a href="/tags/Q/1.htm" target="_blank">Q</a><a href="/tags/R/1.htm" target="_blank">R</a><a
                href="/tags/S/1.htm" target="_blank">S</a><a href="/tags/T/1.htm" target="_blank">T</a><a href="/tags/U/1.htm" target="_blank">U</a><a
                href="/tags/V/1.htm" target="_blank">V</a><a href="/tags/W/1.htm" target="_blank">W</a><a href="/tags/X/1.htm" target="_blank">X</a><a
                href="/tags/Y/1.htm" target="_blank">Y</a><a href="/tags/Z/1.htm" target="_blank">Z</a><a href="/tags/0/1.htm" target="_blank">其他</a>
        </div>
    </div>
</div>
<footer id="footer" class="mb30 mt30">
    <div class="container">
        <div class="footBglm">
            <a target="_blank" href="/">首页</a> -
            <a target="_blank" href="/custom/about.htm">关于我们</a> -
            <a target="_blank" href="/search/Java/1.htm">站内搜索</a> -
            <a target="_blank" href="/sitemap.txt">Sitemap</a> -
            <a target="_blank" href="/custom/delete.htm">侵权投诉</a>
        </div>
        <div class="copyright">版权所有 IT知识库 CopyRight © 2000-2050 E-COM-NET.COM , All Rights Reserved.
<!--            <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">京ICP备09083238号</a><br>-->
        </div>
    </div>
</footer>
<!-- 代码高亮 -->
<script type="text/javascript" src="/static/syntaxhighlighter/scripts/shCore.js"></script>
<script type="text/javascript" src="/static/syntaxhighlighter/scripts/shLegacy.js"></script>
<script type="text/javascript" src="/static/syntaxhighlighter/scripts/shAutoloader.js"></script>
<link type="text/css" rel="stylesheet" href="/static/syntaxhighlighter/styles/shCoreDefault.css"/>
<script type="text/javascript" src="/static/syntaxhighlighter/src/my_start_1.js"></script>





</body>

</html>