需求:原本在腾讯云上100G硬盘不够用,另外购买了500G的硬盘,如果只是将500G挂载到程序文件目录,只能用得上500G,100G用不上,有点浪费空间
原创 Linux操作系统 作者:chenfeng 时间:2017-04-06 10:35:18 13377 0
版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
王涛,腾讯云专家工程师,从事Kubernetes容器平台的研发近6年,目前主要负责腾讯海量自研业务容器化上云的平台研发。在利用云原生技术构建DevOps、ServiceMesh、AI、大数据平台等场景有丰富经验。
1.先在Vmware上,把虚拟机硬盘做扩展,如果有快照存在,磁盘可能是不可编辑状态,先删除快照后再扩展。
20.使扩容的空间写入文件系统,如果文件系统格式是xfs则用xfs_growfs命令
在系统运维过程中,对磁盘扩缩容是常见的操作。如何高效的管理磁盘容量,lvm提供了很好的解决方案。
Horizontal Pod Autoscaler(HPA)控制器, 用于实现基于 CPU 使用率进行自动 Pod 扩缩容的功能。HPA 控制器基于 Master 的 kube-controller-manager 服务启动参数 --horizontal-pod-autoscaler-sync-period 定义的探测周期(默认值为 15s) , 周期性地监测目标 Pod 的资源性能指标, 并与 HPA 资源对象中的扩缩容条件进行对比, 在满足条件时对 Pod 副本数量进行调整。
Kubernetes从1.1版本开始, 新增了名为Horizontal Pod Autoscaler(HPA) 的控制器, 用于实现基于CPU使用率进行自动Pod扩缩容的功能。 HPA控制器基于Master的kube-controller-manager服务启动参数–horizontal-pod-autoscaler-sync-period定义的探测周期(默认值为15s) , 周期性地监测目标Pod的资源性能指标, 并与HPA资源对象中的扩缩容条件进行对比, 在满足条件时对Pod副本数量进行调整。Kubernetes在早期版本中, 只能基于Pod的CPU使用率进行自动扩缩容操作, 关于CPU使用率的数据来源于Heapster组件。 Kubernetes从1.6版本开始, 引入了基于应用自定义性能指标的HPA机制, 并在1.9版本之后逐步成熟。
上篇文章中,我们介绍了 TiDB Operator 的 Controller Manager 的设计和实现,了解了各个 Controller 如何接受和处理变更。在这篇文章中,我们将讨论组件的 Controller 的实现。TiDBCluster Controller 负责了 TiDB 主要组件的生命周期管理,我们将以此为例, 介绍组件控制循环的编排设计。我们将会了解到完成 TiDB 集群的生命周期管理过程中,各种控制循环事件经过了怎样的编排,这些事件中又完成了哪些资源管理操作。在阅读时,大家了解这些工作的大致过程和定义即可,我们将在下一篇文章中具体介绍各个组件如何套用下面的范式。
LVM动态卷管理,可以将多个硬盘和硬盘分区做成一个逻辑卷,并把这个逻辑卷作为一个整体来统一管理,动态对分区进行扩缩空间大小,安全快捷方便管理
一. k8s介绍 1. 是什么 kubernetes:古希腊“舵手”的意思(指引鲸鱼-docker) Production-Grade Container Orchestration:生产级别的容器编排系统 is an open-source system for automating deployment, scaling, and management of containerized applications:用于自动部署,扩展和管理容器化应用程序的开源系统 2. 发展历程 google内部使用十年之
Master指的是集群控制节点,在每个Kubernetes集群里都需要有一个Master来负责整个集群的管理和控制,基本上Kubernetes的所有控制命令都发给它,它负责具体的执行过程,我们后面执行的所有命令基本都是在Master上运行的
描述:LVM——Logical Volume Manager就是动态卷管理在Linux2.4内核以上实现的磁盘管理技术,它可以将多个硬盘和硬盘分区做成一个逻辑卷,并把这个逻辑卷作为一个整体来统一管理,动态对分区进行扩缩空间大小,安全快捷方便管理。
PersistentVolume(PV):集群内的存储资源,例如节点是集群的资源。PV 独立于 Pod 的生命周期,根据不同的 StorageClass 类型创建不同类型的 PV。 PersistentVolumeClaim(PVC):集群内的存储请求。例如,PV 是 Pod 使用节点资源,PVC 则声明使用 PV 资源。当 PV 资源不足时,PVC 也可以动态创建 PV。
在学习StatefulSet之前, 我们先看下什么是有状态应用, 什么是无状态应用。
Docker 是基于容器技术实现的,容器技术最开始是基于 Linux Container(简称 LXC)技术实现的,通过内核提供的 Namespace 和 Cgroup 机制,实现了对应用程序的隔离以及物理资源的分配。
Kubernetes是Google开源的一个容器编排引擎,它支持自动化部署、大规模可伸缩、应用容器化管理。伴随着云原生技术的迅速崛起,如今Kubernetes 事实上已经成为应用容器化平台的标准,越来越受到企业的青睐,在生产中也应用的也越来越广泛。 我们的容器平台建设从2016年开始,大致经历了探索预研、体系建设和平台落地这样三个阶段。
最近遇到一个问题:statefulset 部署能否只是升级部分的 pod?问题本身不难,但我发现没有说过有关 statefulset 的介绍,于是本文将介绍一些有关 statefulset 的点。 问题的答案则放在文章的最后,这也是 statefulset 一个很有用的特性。
K8S 部署reids 集群,nocos集群,rocketMQ 集群等需要理解的重要概念
Pod 是一组互相协作的容器,是我们可以在 Kubernetes 中创建和管理的最小可部署单元。同一个 pod 内的容器共享网络和存储,并且作为一个整体被寻址和调度。当我们在 Kubernetes 中创建一个 pod 会创建 pod 内的所有容器,并且将容器的所有资源都被分配到一个节点上。
上一部分我们分享到了使用 RS 没有办法让自己管理的多个 pod 都有一个独立的持久化声明,RS 没有办法在指定模板中对不同的 pod 做差异化处理
上一部分我们说到如何使用 Statefulset 部署有状态的应用,Statefulset 可以做到部署的 每一个 pod 能够独立的拥有一个持久卷声明和持久卷
使用Kubernetes来调度无状态的应用非常简单,那Kubernetes如何来管理调度有状态的应用呢?Kubernetes中提供了一个StatefulSet控制器来管理有状态的应用,本文就介绍StatefulSet的应用,解决以下几个问题:
导语 | 当今容器化技术发展盛行。本文将介绍从单机容器化技术Docker到分布式容器化架构方案Kubernetes,主要面向小白读者,旨在快速带领读者了解Docker、Kubernetes的架构、原理、组件及相关使用场景。 一、Docker (一)什么是Docker Docker是一个开源的应用容器引擎,是一种资源虚拟化技术,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的Linux机器上。虚拟化技术演历路径可分为三个时代: 物理机时代,多个应用程序可能跑在一台物理机器上
作者:honghaohu,腾讯 PCG 后台开发工程师 从单机容器化技术 Docker 到分布式容器化架构方案 Kubernetes,当今容器化技术发展盛行。本文面向小白读者,旨在快速带领读者了解 Docker、Kubernetes 的架构、原理、组件及相关使用场景。 Docker 1.什么是 Docker Docker 是一个开源的应用容器引擎,是一种资源虚拟化技术,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上。虚拟化技术演历路径可分为三个时代:
设备驱动程序是软件概念和硬件电路之间的一个抽象层,软件操作硬件的关键就是对寄存器的操作。笔者使用的S5PV210是IO与内存统一编址的,在裸机中直接操作IO端口的物理地址,而在驱动中必须使用虚拟地址。直接基于IO的虚拟地址用指针解引用的方式来读写有两种方式,静态映射和动态映射。除了可以直接将指针解引用的方式,内核中提供了专用的读写接口来读写寄存器。考虑到GPIO作为硬件资源,存在着被多个驱动使用,还有复用的问题,所以内核提供了GPIO驱动gpiolib框架来统一管控GPIO资源,gpiolib在内核中作为一个驱动所实现。
作者:kevinyfsun(孙勇福) 腾讯CSIG云产品研发工程师 导语| 随着2B行业的蓬勃发展,数据库产品中心原有烟囱式发展模式,在资源调度和统一管控上面临的挑战越来越多。同时腾讯云IaaS产品经过十几年的发展,可以提供可靠稳定的服务。当前 Kubernetes 已经成为资源编排的事实标准,TKE 产品形态在腾讯公有云运行多年,基于 TKE 实现数据库领域的 PaaS on IaaS 成为一个可行方案。 本文主要分享数据库产品中心基于 TKE 实现 PaaS On IaaS 的实践整体过程,未来会有
在 Kubernetes 项目中,pkg/controller目录下的子目录通常包含控制器相关的代码和逻辑。控制器是 Kubernetes 中用于管理资源的核心组件之一。它们负责监控资源的状态,并确保其符合所定义的期望状态。下面是对这些子目录的一些常见作用的解释:
在这篇文章中和 Carla Schroder 一起探索 Linux 中的一些鲜为人知的强大工具。 本文是一篇关于一些有趣但鲜为人知的工具 termsaver、pv 和 calendar 的文章。 termsaver 是一个终端 ASCII 屏保,pv能够测量数据吞吐量并模拟输入。Debian 的 calendar 拥有许多不同的日历,并且你还可以制定你自己的日历。 工具1:终端屏保 难道只有图形桌面能够拥有有趣的屏保吗? 现在,你可以通过安装 termsaver 来享受 ASCII 屏保,比如 matr
家人们,今天我们来分享一下关于虚拟机磁盘大小变更后,在Ubuntu操作系统中如何进行动态分区调整。随着虚拟化技术的发展,虚拟机已经成为许多开发者和系统管理员的首选工具之一。在使用虚拟机过程中,可能会遇到需要扩展磁盘容量的情况,而Ubuntu作为一种常见的操作系统,我们将介绍如何动态调整分区以适应磁盘大小的变更。
在 GNU/Linux 中的两个系统之间通过网络快速传输大文件 确保你在系统上安装了netcat和pv应用程序。如果尚未安装它们,你可以如下所示安装它们。大多数 Linux 系统默认提供tar包,不必额外安装。 在 Arch Linux 及其衍生产品上: $ sudo pacman -S netcat pv 在 RHEL、CentOS、Fedora 上: $ sudo yum install epel-release $ sudo yum install nc pv 或 $ sudo dnf inst
唐聪,腾讯云资深工程师,极客时间专栏《etcd实战课》作者,etcd活跃贡献者,主要负责腾讯云大规模K8s/etcd平台、有状态服务容器化、在离线混部等产品研发设计工作。 背景 随着 Kubernetes 成为云原生的最热门的解决方案,越来越多的传统服务从虚拟机、物理机迁移到 Kubernetes,各云厂商如腾讯自研上云也主推业务通过Kubernetes来部署服务,享受 Kubernetes 带来的弹性扩缩容、高可用、自动化调度、多平台支持等益处。然而,目前大部分基于 Kubernetes 的部署的服务都是
本文给大家介绍几个有趣的Linux命令。 1. pv 命令 有时候我们在电影屏幕上看到一些字幕一个个匀速显示出来,像有人在边敲键盘,边显示一样。Linux上的pv命令可以实现这种效果。 默认情况下,Linux是没有pv命令的,需要自行安装。 首先安装命令: # yum install pv [On RedHat based Systems] # sudo apt-get install pv [On Debian based Systems] 现在运行如下命令: $ echo "Tecmint[d
之前在中通负责过缓存平台的建设工作,当时的缓存系统使用搜狐 TV 开源的 CacheCloud 缓存服务平台进行托管,但随着公司业务发展,随着而来的是资源隔离、集群访问权限粒度、资源不均衡、仅支持 Redis 类型的集群等问题,为了解决公司当下使用缓存的痛点,当时决定构建下一代缓存服务平台,它是基于 Kubernetes Operator 自动化部署与运维的思想,当时还写下了一篇文章:「中通缓存服务平台基于 Kubernetes Operator 的服务化实践」。
此专栏是为了“补货”一些官网没有的操作文档,大家走过路过,可以留言告诉我,哪里写的不清不楚的地方,洒家给他整明白了、
本文以属于Linux系统基本概念,如果以查找教程教程,解决问题为主,只需要查看本文后半部分。如需要系统性学习请查看本文前半部分。
1. pv 命令 有时候我们在电影屏幕上看到一些字幕一个个匀速显示出来,像有人在边敲键盘,边显示一样。Linux上的pv命令可以实现这种效果。 默认情况下,Linux是没有pv命令的,需要自行安装。 首先安装命令: 1 2 3 # yum install pv [On RedHat based Systems] # sudo apt-get install pv [On Debian based Systems] 现在运行如下命令: 1 $ echo "Tecm
版权声明:本文为木偶人shaon原创文章,转载请注明原文地址,非常感谢。 https://blog.csdn.net/wh211212/article/details/53992360
首先创建好lvm分区 # fdisk /dev/vdb -l Disk /dev/vdb: 42.9 GB, 42949672960 bytes 16 heads, 63 sectors/track, 83220 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 byte
在Kubernetes(K8s)环境中部署有状态应用(Stateful Applications)涉及到一些特别的考虑和策略。有状态应用与无状态应用的主要区别在于它们需要维护数据状态,这使得它们在部署和管理上有特殊的需求。
基本的逻辑卷管理概念: PV(Physical Volume)- 物理卷 物理卷在逻辑卷管理中处于最底层,它可以是实际物理硬盘上的分区,也可以是整个物理硬盘,也可以是raid设备。 VG(Volumne Group)- 卷组 卷组建立在物理卷之上,一个卷组中至少要包括一个物理卷,在卷组建立之后可动态添加物理卷到卷组中。一个逻辑卷管理系统工程中可以只有一个卷组,也可以拥有多个卷组。 LV(Logical Volume)- 逻辑卷 逻辑卷建立在卷组之上,卷组中的未分配空间可以用于建立新的逻辑卷,逻辑卷建立后可以动态地扩展和缩小空间。系统中的多个逻辑卷可以属于同一个卷组,也可以属于不同的多个卷组。
TiDB Operator 是 TiDB 在 Kubernetes 平台上的自动化部署运维工具。目前,TiDB Operator 已正式开源(pingcap/tidb-operator)。借助 TiDB Operator,TiDB 可以无缝运行在公有云厂商提供的 Kubernetes 平台上,让 TiDB 成为真正的 Cloud-Native 数据库。
LVM是 Logical Volume Manager(逻辑卷管理)的简写,它是Linux环境下对磁盘分区进行管理的一种机制。LVM将一个或多个磁盘分区(PV)虚拟为一个卷组(VG),相当于一个大的硬盘,我们可以在上面划分一些逻辑卷(LV)。当卷组的空间不够使用时,可以将新的磁盘分区加入进来。我们还可以从卷组剩余空间上划分一些空间给空间不够用的逻辑卷使用。
今天发现虚拟机磁盘满了报警了,明明 50 GiB 可以用很久,怎么会这么快满了呢,找了各种数据库日志文件等半天始终找不出不对劲的文件。
此次主要进行了/dev/sdb从默认系统转换到lvm系统模式。期间备份恢复数据,不同磁盘下的不同分区创建pv加入同一vg组,放大lv容量,从vg中删除单个pv,通过实验验证lvm2突破了在lvm1版本时pe size大小限制vg大小的限制,自动挂载lv等。 期间经历重启由于fstab文件忘记修改导致无法开机,后进入单用户救援模式修改/etc/fstab后恢复,经过此番折腾更加深入了解了linux的磁盘文件系统模式。 1、查看现有系统信息。 [root@localhost ~]# df 文件系统 1K-块 已用 可用 已用% 挂载点 /dev/sda2 99190032 4077672 89992368 5% / /dev/sdb1 567161764 246748 537640172 1% /opt /dev/sda1 99098 12238 81743 14% /boot tmpfs 8196244 0 8196244 0% /dev/shm [root@localhost ~]# fdisk /dev/sdb The number of cylinders for this disk is set to 72891. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): p Disk /dev/sdb: 599.5 GB, 599550590976 bytes 255 heads, 63 sectors/track, 72891 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 * 1 72891 585496926 83 Linux 2、备份数据,将原先/opt下的文件复制到新建的mkdir /optbak下,已做备份。 [root@localhost ~]# ll /opt/ 总计 32 drwxr-xr-x 2 root root 4096 01-27 15:20 disk drwx------ 2 root root 16384 01-22 15:40 lost+found drwxr-xr-x 3 root root 4096 01-23 12:54 svn drwxrwxrwx 3 root root 4096 02-02 16:50 svntongbu drwxr-xr-x 5 root root 4096 01-30 14:43 wzcs 执行cp -r /opt /optbak后 [root@localhost ~]# ll /optbak/opt/ 总计 20 drwxr-xr-x 2 root root 4096 02-08 15:48 disk drwx------ 2 root root 4096 02-08 15:48 lost+found drwxr-xr-x 3 root root 4096 02-08 15:48 svn drwxr-xr-x 3 root root 4096 02-08 15:48 svntongbu drwxr-xr-x 5 root root 4096 02-08 15:48 wzcs 3、执行umount /opt 写在文件挂载,这时/opt 目录下的文件已经看不到了,因为它所挂载的硬盘已被从文件系统卸载了。但是/opt目录仍然存在,只是成空文件夹了。 [root@localhost ~]# df -h 文件系统 容量 已用 可用 已用% 挂载点 /dev/sda2 95G 4.0G 86G 5% / /dev/sda1 97M 12M 80M 14% /boot tmpfs 7.9G 0 7.9G 0% /dev/shm 4、现在开始执行将原有磁盘系统转化为lvm,因为服务器原先有两块磁盘sda sdb,sda为系统盘 其中sda3已经设置为了lvm分区,sdb这块磁盘由于我只分了一个区现在我需要把它删了重建。 [root@localhost ~]# fdisk /dev/sdb T
LVM创建 pv—>vg—->lv—->快照 创建前准备了四块1g硬盘分别为:sdb sdc sdd sde,并分别给四块盘划分了1G的空间,并指定了分区系统类型为8e(即Linux LVM) [root@localhost ~]# fdisk /dev/sdb Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-13
k8s是一个开源的容器集群管理系统,可以实现容器集群的自动化部署、自动扩缩容、维护等功能。
领取专属 10元无门槛券
手把手带您无忧上云