摘要: docker基础相关知识和docker常用操作 ####镜像相关 #####获取镜像 docker pull … docker pull NAME[:TAG] 不指定tag,默认选择latest最新 docker pull nginx (获取最新版非稳定版) docker pull hub.c.16 阅读全文
posted @ 2022-02-21 14:48 tangshow 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 在centos7上安装docker最新版本 ####环境准备 系统centso7.9 ####关闭selinux setenforce 0 sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config;cat /etc/seli 阅读全文
posted @ 2022-02-21 14:33 tangshow 阅读(334) 评论(0) 推荐(0) 编辑
摘要: ####修改默认ssh端口 https://www.cnblogs.com/tangshow/p/15882408.html ####修改ssh空闲时间 https://www.cnblogs.com/tangshow/p/15882408.html ####防ddos 见ddos表 ####中断指 阅读全文
posted @ 2022-02-21 14:22 tangshow 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 在 centos7上使用crontab定时任务,自动定时执行脚本 ####添加/编辑 Crontab crontab -e crontab [-u username] -e 默认情况下,系统会编辑当前用户的crontab命令集合 ####查看Crontab crontab -l crontab [- 阅读全文
posted @ 2022-02-21 14:09 tangshow 阅读(2102) 评论(0) 推荐(0) 编辑
摘要: CentOS7 /根目录空间不足,/home目录空间剩余较多。现需要将/home的空闲空间,分配给/。 基础知识:linux /dev/mapper目录浅谈 https://www.cnblogs.com/amoyzhu/p/6626423.html ####0 环境 系统centos7,安装时使用 阅读全文
posted @ 2022-02-21 11:22 tangshow 阅读(2539) 评论(1) 推荐(0) 编辑
摘要: centos7系统内核升级到最新的kernel-ml5.x ##准备 ######查看系统版本 cat /etc/redhat-release ######看当前操作系统版本信息 cat /proc/version ######查看版本当前操作系统内核信息 uname -a 输出 Linux 140 阅读全文
posted @ 2022-02-11 11:22 tangshow 阅读(637) 评论(0) 推荐(0) 编辑
摘要: linux centos7 ssh 常用管理和配置 默认放行ssh服务,不受firewalld-cmd的规则限制 ####远程连接 使用当前宿主用户的名称登录 ssh ip 指定用户名 ssh name@ip 指定本机的ip(多ip情况下切换) ssh -b ip name@ip 当前服务器A远程登 阅读全文
posted @ 2022-02-11 11:10 tangshow 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 富规则官方文档 https://firewalld.org/documentation/man-pages/firewalld.richlanguage.html 可表达firewalld的基本语法中未涵盖的自定义防火墙规则 ####语法 [source] [destination] service 阅读全文
posted @ 2022-02-11 10:23 tangshow 阅读(2543) 评论(0) 推荐(0) 编辑
摘要: ####系统操作 加入开机启动 systemctl enable firewalld 启、停 systemctl start firewalld systemctl stop firewalld 重启、重载 systemctl restart firewalld firewall-cmd --rel 阅读全文
posted @ 2022-02-11 10:14 tangshow 阅读(122) 评论(0) 推荐(0) 编辑
摘要: ##管理类 ####kubectl 工具用法 kubectl 子命令 资源对象类型 资源对象名称 子命令可选参数 查看版本 kubectl version 查看集群node kubectl get nodes 查看命名空间 kubectl get namespace 查看命名空间下的对象,不加参数- 阅读全文
posted @ 2022-02-11 09:45 tangshow 阅读(80) 评论(0) 推荐(0) 编辑
摘要: ##快照 ####创建快照 拍摄快照需要虚拟机处于开启状态,否则无法拍摄快照 virsh save --bypass-cache c7-test01 /kvm/photo/c7-01-pho1 ####查看快照文件,以m显示文件大小 du -m /var/lib/libvirt/images/sav 阅读全文
posted @ 2022-02-11 09:21 tangshow 阅读(92) 评论(0) 推荐(0) 编辑
摘要: kvm常用命令 列出虚拟机 virsh list virsh list -all 进入指定的虚拟机,进入的时候还需要按一下回车 virsh console study01 启动虚拟机 virsh start study01 关闭虚拟机 virsh shutdown study01 强制停止虚拟机 v 阅读全文
posted @ 2022-02-10 17:28 tangshow 阅读(514) 评论(0) 推荐(0) 编辑
摘要: kvm安装win10虚拟机,并配置内网ip实现远程连接 准备 kvm环境,win10镜像 kvm安装win10需要准备驱动 wget https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/vir 阅读全文
posted @ 2022-02-10 17:21 tangshow 阅读(2668) 评论(0) 推荐(0) 编辑
摘要: kvm安装centos7虚拟机,并配置内网ip实现远程连接 准备 kvm环境,centos7镜像 centos7镜像地址: http://mirrors.163.com/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso #htt 阅读全文
posted @ 2022-02-10 17:01 tangshow 阅读(392) 评论(0) 推荐(0) 编辑
摘要: 在本地服务器主机安装kvm环境,然后安装多个系统,供内网用户使用 环境准备 系统centos7.9 主机24C128G 磁盘6T ##1 安装准备 ####1.1 查看CPU是否支持虚拟化 grep -E 'svm|vmx' /proc/cpuinfo ####1.2关闭SElinux vim /e 阅读全文
posted @ 2022-02-10 16:30 tangshow 阅读(523) 评论(0) 推荐(0) 编辑
摘要: k8s命令脚本1-快捷查看所有pod、services、deployment、pv、pvc、ep ####功能: 将常用的k8s查看命令写入脚本,使用sh命令执行,方便快捷查看k8s状态 echo -e "\033[34m nodes————————————————————————————————— 阅读全文
posted @ 2022-01-27 09:49 tangshow 阅读(3703) 评论(0) 推荐(0) 编辑
摘要: 最近部署了k8s,默认使用的主机存储。主机/目录默认空间较小,并且部分容器对磁盘io要求较高。遂搭建glusterfs文件系统,并配置给k8s使用。 glusterfs搭建步骤见 https://www.cnblogs.com/tangshow/p/15930784.html ##环境 cetons 阅读全文
posted @ 2022-01-26 15:34 tangshow 阅读(430) 评论(0) 推荐(0) 编辑
摘要: ##需求 在一台宿主机上运行多个docker容器,并且自动给容器分配和宿主机同网段的局域网ip ##环境 centos7、docker 、python2.7.x、pipework centos7直连路由器,且该网段内还有未分配的ip ##一 新建 python脚本 /root/cron/docker 阅读全文
posted @ 2022-01-25 14:17 tangshow 阅读(668) 评论(0) 推荐(0) 编辑
摘要: ## -*- coding: utf-8 -*-#获取路由器下可用ip,分配给各个容器,循环检查分配是否正常 import osimport timefrom itertools import isliceimport os.path #网关ip_gate = "192.168.124.1"mask 阅读全文
posted @ 2022-01-25 11:53 tangshow 阅读(35) 评论(0) 推荐(0) 编辑
摘要: centos7搭建k8s集群(v1.19.x) ##一、部署环境 共有3台服务器 1台master,2台node。 ##二、安装准备工作 ####1 关闭防火墙 systemctl stop firewalld && systemctl disable firewalld ####2 永久关闭sel 阅读全文
posted @ 2022-01-25 10:58 tangshow 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 需求 需要让docker容器使用路由器提供的内网ip,使用内网ip直接访问容器。 环境准备 centos7系统、docker。 1.宿主机安装pipework wget -O pipework-master.zip https://codeload.github.com/jpetazzo/pipew 阅读全文
posted @ 2022-01-24 16:54 tangshow 阅读(986) 评论(0) 推荐(0) 编辑
摘要: #linux能访问http页面,无法访问https网页 ##问题描述 centos6 设备比较老了,硬件时钟不准确,导致无论都无法访问https页面,例如使用 curl 、wget 、docekr login都不能正常访问。 网上都是说下载这个https://curl.haxx.se/ca/cace 阅读全文
posted @ 2021-08-30 08:48 tangshow 阅读(2382) 评论(0) 推荐(0) 编辑