摘要: mariadbbackup.sh #!/bin/bash ########################################################################### # File Name: mariadbbackup.sh # Author: Paavo 阅读全文
posted @ 2020-06-02 23:58 $world 阅读(788) 评论(1) 推荐(0)
摘要: 1.编辑全量备份脚本/root/sh/mariabackup-full.sh,内容如下: #!/bin/bash user=root userPWD='dreamtechIT2019' mysqlPort=3306 host=10.47.92.186 mysqlHome=$mysqlHome DAT 阅读全文
posted @ 2020-06-02 23:57 $world 阅读(640) 评论(0) 推荐(0)
摘要: 1.重命名已经丢失frm文件的数据库安装目录cd /appmv mariadb mariadb-bak 2.安装一个空数据库,注意安装的新数据库要与丢失frm文件的数据库版本一致#!/bin/bashyum install -y libaiorpm -qa | grep mysqlrpm -e `r 阅读全文
posted @ 2020-06-02 23:53 $world 阅读(288) 评论(0) 推荐(0)
摘要: 一.istio是什么 Istio 提供一种简单的方式来为已部署的服务建立网络,该网络具有负载均衡、服务间认证、监控等功能,而不需要对服务的代码做任何改动。 1.istio 适用于容器或虚拟机环境(特别是 k8s),兼容异构架构。2.istio 使用 sidecard(边车模式)代理服务的网络,不需要 阅读全文
posted @ 2020-06-02 23:52 $world 阅读(370) 评论(0) 推荐(0)
摘要: Kubernetes过一系列机制来实现集群的安全机制,包括API Server的认证、授权、准入控制机制等。集群的安全性必须考虑以下的几个目标: 保证容器与其所在宿主机的隔离; 限制容器给基础设施及其他容器带来消极影响的能力; 最小权限原则,合理限制所有组件权限,确保组件只执行它被授权的行为,通过限 阅读全文
posted @ 2020-06-02 23:50 $world 阅读(1897) 评论(0) 推荐(0)
摘要: port The port that the service is exposed on the service’s cluster ip (virsual ip). Port is the service port which is accessed by others with cluster 阅读全文
posted @ 2020-06-02 23:48 $world 阅读(499) 评论(0) 推荐(0)
摘要: 1、基础架构 1.1 Master Master节点上面主要由四个模块组成:APIServer、scheduler、controller manager、etcd。 APIServer。APIServer负责对外提供RESTful的Kubernetes API服务,它是系统管理指令的统一入口,任何对 阅读全文
posted @ 2020-06-02 23:47 $world 阅读(120) 评论(0) 推荐(0)
摘要: 一.准备kubernetes-dashboard-amd64:v1.10.0#拉取镜像docker pull mirrorgooglecontainers/kubernetes-dashboard-amd64:v1.10.0 #重新打标签docker tag mirrorgooglecontaine 阅读全文
posted @ 2020-06-02 23:46 $world 阅读(468) 评论(0) 推荐(0)
摘要: 一.建立kubernetes dashboard的查询权限token 1.rbac-zxy.yaml的内容如下 kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: name: role-zxy rules: - a 阅读全文
posted @ 2020-06-02 23:44 $world 阅读(262) 评论(0) 推荐(0)
摘要: 1.明明kube-proxy设置了ipvs模式,确始终用的iptables模式 [root@iZcu9m4x2htrgoZ bin]# cat /etc/kubernetes/kube-proxy.config.yamlapiVersion: kubeproxy.config.k8s.io/v1al 阅读全文
posted @ 2020-06-02 23:42 $world 阅读(2399) 评论(0) 推荐(0)
摘要: 1.kube-proxy出现无法代理的情况 proxier.go:1369] Failed to delete stale service IP 10.254.0.2 connections, error: error deleting connection tracking state for U 阅读全文
posted @ 2020-06-02 23:40 $world 阅读(1089) 评论(0) 推荐(0)
摘要: 一.第一种解决方法 1.修改/etc/systemd/system/kube-controller-manager.service添加或者修改如下内容--experimental-cluster-signing-duration=87600h \ 然后执行以下命令重启kube-controller- 阅读全文
posted @ 2020-06-02 23:39 $world 阅读(2002) 评论(0) 推荐(0)
摘要: 1.为kubelet,system进程预留充足的cpu,内存,磁盘以防pod把node节点的资源全部用完,导致k8s宕机,需要加上如下红色字体的配置配置 vi /etc/systemd/system/kubelet.service [Unit]Description=Kubernetes Kubel 阅读全文
posted @ 2020-06-02 23:37 $world 阅读(4132) 评论(0) 推荐(0)
摘要: 1.从下图可以看出node:10.81.163.21的内存使用率93%,该节点总共有7821M(Capacity Memory)物理内存,然后k8s的可分配内存(Allocatable Memory)为5399696Ki 那这个98%是怎么来的? [root@iZcwfshg0bs9fxZ syst 阅读全文
posted @ 2020-06-02 23:36 $world 阅读(2424) 评论(0) 推荐(0)
摘要: 1.kube-controller-manager显示不健康,报如下错误 kube-controller-manager[3234]: I0723 10:26:35.027041 3234 log.go:172] http: TLS handshake error from 127.0.0.1:40 阅读全文
posted @ 2020-06-02 23:35 $world 阅读(921) 评论(0) 推荐(0)
摘要: 1.什么是IPVS?IPVS (IP Virtual Server,IP虚拟服务器)是基于Netfilter的、作为linux内核的一部分实现传输层负载均衡的技术,通常称为第4层LAN交换。 IPVS集成在LVS(Linux Virtual Server)中,它在主机中运行,并在真实服务器集群前充当 阅读全文
posted @ 2020-06-02 23:34 $world 阅读(5409) 评论(1) 推荐(2)
摘要: 1.masterIP为k8s master的IP,nodeIP为k8s node的IP,CLUSTER_CIDR为etcd设置的pod网段 2.建立k8s node与k8s master的ssh 信任关系,让k8s node 可以免密ssh k8s master 3.运行如下脚本,添加1.16.1的 阅读全文
posted @ 2020-06-02 23:33 $world 阅读(130) 评论(0) 推荐(0)
摘要: 1.masterIP为k8s master的IP,nodeIP为k8s node的IP,CLUSTER_CIDR为etcd设置的pod网段 2.建立k8s node与k8s master的ssh 信任关系,让k8s node 可以免密ssh k8s master 3.运行如下脚本,添加1.13.1的 阅读全文
posted @ 2020-06-02 23:32 $world 阅读(24) 评论(0) 推荐(0)
摘要: 一.traefick简介 Traefik是一个用Golang开发的轻量级的Http反向代理和负载均衡器。由于可以自动配置和刷新backend节点,目前可以被绝大部分容器平台支持,例如Kubernetes,Swarm,Rancher等。由于traefik会实时与Kubernetes API交互,所以对 阅读全文
posted @ 2020-06-02 23:29 $world 阅读(222) 评论(0) 推荐(0)
摘要: 1.如何获取集群中的服务 Kubernetes 暴露服务的方式目前只有三种:LoadBlancer Service、NodePort Service、Ingress;前两种估计都应该很熟悉,下面详细的了解下这个 Ingress Ingress由两部分组成:Ingress Controller 和 I 阅读全文
posted @ 2020-06-02 23:27 $world 阅读(269) 评论(0) 推荐(0)
摘要: 1.haproxy-ingress.yaml apiVersion: v1 kind: Namespace metadata: name: ingress-controller apiVersion: v1 kind: ServiceAccount metadata: name: ingress-c 阅读全文
posted @ 2020-06-02 23:25 $world 阅读(639) 评论(0) 推荐(0)
摘要: 安装metric-server 启用HPA功能首先得安装metric-server(kubernetes 1.11 之后已经完全启用 heapster) 附件metrics-server.zip exec 1 2 3 4 5 unzip metrics-server.zip cd metrics-s 阅读全文
posted @ 2020-06-02 23:11 $world 阅读(214) 评论(0) 推荐(0)
摘要: 1.修改/etc/grafana/grafana.ini,注意要删除最前面的分号 [smtp] enabled = true host = smtp.exmail.qq.com:25 user = "lihaichun@netschina.com" # If the password contain 阅读全文
posted @ 2020-06-02 23:09 $world 阅读(1061) 评论(0) 推荐(0)
摘要: 1.准备2台服务器,/etc/hosts的内容如下10.47.92.186 master-18610.46.76.31 node-31 2.安装glusterfsyum install centos-release-gluster -yyum install -y glusterfs gluster 阅读全文
posted @ 2020-06-02 23:07 $world 阅读(106) 评论(0) 推荐(0)
摘要: 1.当k8s node节点的磁盘空间使用率超过85%的时候,pod启动会出现DiskPressure错误,导致pod无法启动,需要删除k8s node的文件以释放空间 2.参考文档 https://kubernetes.io/docs/tasks/administer-cluster/out-of- 阅读全文
posted @ 2020-06-02 23:06 $world 阅读(630) 评论(0) 推荐(0)
摘要: 一.需求 让每个pod访问dhyxtest.ceair.com可以定位到47.97.32.251 即相当于/etc/hosts中有47.97.32.251 dhyxtest.ceair.com 二.解决方案 1.在coredns.yaml中添加 hosts {47.97.32.251 dhyxtes 阅读全文
posted @ 2020-06-02 23:05 $world 阅读(5249) 评论(0) 推荐(0)
摘要: 一.问题现象 启动zookeeper,redis,进入业务pod无法ping zookeeper,ping redis 二.解决方案 1.修改所有k8s node的/etc/kubernetes/kube-proxy.config.yaml ,将 clusterCIDR: 171.22.0.0/16 阅读全文
posted @ 2020-06-02 23:04 $world 阅读(974) 评论(0) 推荐(0)
摘要: 1.连接上etcd服务器,查看etcd证书的存放路径 root 12392 1 3 Feb13 ? 6-08:37:00 /usr/local/bin/etcd --data-dir=/var/lib/etcd --name=kube-node1 --cert-file=/etc/etcd/cert 阅读全文
posted @ 2020-06-02 23:02 $world 阅读(3280) 评论(0) 推荐(0)
摘要: 一.架构图 这种架构解决了 Logstash 在各服务器节点上占用系统资源高的问题。相比 Logstash,Beats 所占系统的 CPU 和内存几乎可以忽略不计。另外,Beats 和 Logstash 之间支持 SSL/TLS 加密传输,客户端和服务器双向认证,保证了通信安全。 因此这种架构适合对 阅读全文
posted @ 2020-06-02 23:00 $world 阅读(0) 评论(0) 推荐(0)
摘要: 1.yum remove docker \docker-client \docker-client-latest \docker-common \docker-latest \docker-latest-logrotate \docker-logrotate \docker-engine 2.rm 阅读全文
posted @ 2020-06-02 22:56 $world 阅读(302) 评论(0) 推荐(0)
摘要: docker镜像默认存储路径在 /var/lib/docker/ 下 ,在实际部署中,经常碰到客户的 / 分区只给到20g , 甚至更小,而我们的每个镜像又达到1G ,这就需要我们在部署的时候根据磁盘空间合理选择存储目录。 在ExecStart 后面加上参数如下,将docker的默认存储目录改至 / 阅读全文
posted @ 2020-06-02 22:55 $world 阅读(2170) 评论(0) 推荐(1)
摘要: 提到虚拟化技术,我们首先想到的一定是 Docker,经过四年的快速发展 Docker 已经成为了很多公司的标配,也不再是一个只能在开发阶段使用的玩具了。作为在生产环境中广泛应用的产品,Docker 有着非常成熟的社区以及大量的使用者,代码库中的内容也变得非常庞大。 同样,由于项目的发展、功能的拆分以 阅读全文
posted @ 2020-06-02 22:52 $world 阅读(221) 评论(0) 推荐(0)
摘要: 1.问题背景nginx服务器192.168.1.249能上网,可以拉镜像docker.registry.com:5000/message-send:v201808270153-master,192.168.1.184无法上互联网,也想拉该镜像,为了实现该目标,需要做如下操作(116.62.97.13 阅读全文
posted @ 2020-06-02 22:50 $world 阅读(1151) 评论(0) 推荐(0)