今天在测试一台vps,结果他家的模板系统分区太不好了(就不喷了),本来想让人家客服看看处理下,结果人家直接来了一句自己分。所以才有了这篇笔记,顺便也可以复习下LVM。 硬盘总空间是30G的SSD,根分区给了10G,剩下的20G空间挂载到了/home下。 [root@MyCloudServer ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/centos-root 8.5G 93
默认情况下,运行容器使用容器内的临时存储。Pods由一个或多个容器组成,这些容器一起部署,共享相同的存储和其他资源,可以在任何时候创建、启动、停止或销毁。使用临时存储意味着,当容器停止时,写入容器内的文件系统的数据将丢失。
registry和image是修改镜像仓库和镜像名为阿里云的仓库(该仓库为个人用户仓库)。官方镜像国内网络基本拉取不下来,默认配置使用Deployment控制器,副本数为1。你可以修改为DaemonSet,每个节点部署一个pod,此处使用nodeSelector将ingress控制器固定在master上
PS.本文基于JDK1.8 前言 大家都知道HashMap是线程不安全的,想要在并发的环境中使用,用什么呢?HashTable?采用syncgronized加锁,导致效率及其底下.在java5之后jd
Local PV出现之前,使用本地磁盘的方法是HostPath Volume,同为使用本地磁盘,区别在哪呢?
在本教程中,您将学习如何创建与 Longhorn 卷对应的持久卷 (PV) 和持久卷声明 (PVC) 的 Kubernetes 持久存储资源。您将使用 kubectl 为使用 Longhorn 存储类(storage class)的工作负载动态配置存储。
大家好,我是架构君,一个会写代码吟诗的架构师。今天说一说Linux运维面试题[通俗易懂],希望能够帮助大家进步!!!
Kubernetes 是一个开源的容器编排工具,可以用来管理和部署分布式应用程序。而 ZooKeeper 是一个分布式的开源协调服务,它可以用于协调分布式系统的各种操作,如数据同步、状态监控、配置管理等。在 Kubernetes 中,可以使用 StatefulSet 对 ZooKeeper 进行集群部署和管理,下面我们来详细介绍如何在 Kubernetes 中安装 ZooKeeper 集群。
在虚拟机操作系统内的命令行终端上再次执行“fdisk -l”,发现虚拟磁盘总共有416101个柱面,但只使用了其中的208051个柱面,未被使用的柱面就是扩容之后的磁盘,下面需要为未被使用的柱面创建分区。
Rancher会监测角色是否齐全,如果不齐全,它会一直等待,只有我们创建的节点包含所有角色,才会去创建K8s服务
继上一篇博客介绍了完整部署CentOS7.2+OpenStack+kvm 云平台环境(1)--基础环境搭建,本篇继续讲述后续部分的内容 1 虚拟机相关 1.1 虚拟机位置介绍 openstack上创建的虚拟机实例存放位置是/var/lib/nova/instances 如下,可以查看到虚拟机的ID [root@linux-node2 ~]# nova list +--------------------------------------+---------------+--------+--------
在这份CKAD考试实操指南中,我将为你详细介绍如何利用CKAD-exercises项目和知十平台进行CKAD考试的准备和复习。通过CKAD-exercises提供的练习题,你可以在知十平台的云原生环境中进行实践和模拟。在这个过程中,你将熟悉Kubernetes的各种操作和场景,并在实践中加深对知识的理解。这种结合实践和理论的学习方式将为你在考试中取得优异成绩提供强有力的支持。
Master指的是集群控制节点,在每个Kubernetes集群里都需要有一个Master来负责整个集群的管理和控制,基本上Kubernetes的所有控制命令都发给它,它负责具体的执行过程,我们后面执行的所有命令基本都是在Master上运行的
一. k8s介绍 1. 是什么 kubernetes:古希腊“舵手”的意思(指引鲸鱼-docker) Production-Grade Container Orchestration:生产级别的容器编排系统 is an open-source system for automating deployment, scaling, and management of containerized applications:用于自动部署,扩展和管理容器化应用程序的开源系统 2. 发展历程 google内部使用十年之
MutationObserver 是用于监视 DOM 树内的特定节点的 Web API 接口,一旦监测到节点发生变化,就会通知回调函数执行相应的逻辑。该 API 的兼容性很好,但由于如今流行的 JS 框架都旨在“数据驱动视图”,使得这个 API 容易被大众遗忘。本文将介绍 MutationObserver 的基本原理、使用方法和应用场景,帮助读者更好地理解和应用这个灵活且强大的 API。
注意:for-each循环在java 5中被引入所以该方法只能应用于java 5或更高的版本中。如果你遍历的是一个空的map对象,for-each循环将抛出NullPointerException,因此在遍历前你总是应该检查空引用。
Longhorn 设计有两层:数据平面(data plane)和控制平面(control plane)。Longhorn Engine 是存储控制器对应数据平面,Longhorn Manager 对应控制平面。
Kubernetes 里的 Master 指的是集群的控制节点,负责整个集群的管理和控制。 在 Master 上运行中以下关键进程:
LVM是 Logical Volume Manager(逻辑卷管理)的简写,它是Linux环境下对磁盘分区进行管理的一种机制。LVM将一个或多个磁盘分区(PV)虚拟为一个卷组(VG),相当于一个大的硬盘,我们可以在上面划分一些逻辑卷(LV)。当卷组的空间不够使用时,可以将新的磁盘分区加入进来。我们还可以从卷组剩余空间上划分一些空间给空间不够用的逻辑卷使用。
Kubernetes 中使用节点的本地存储资源有 emptyDir、hostPath、Local PV 等几种方式。这之中,emptyDir 无法持久化数据,hostPath 方式需要手动管理卷的生命周期,运维压力大。因此在某些场景下,如果用户出于性能和运维成本考虑需要使用本地存储,Local PV 似乎是唯一选择。
Helm是一个Kubemetes包管理器(类似于OS包管理器,比如Linux中的yum、apt,或者MacOS中的 homebrew)。
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/aixiaoyang168/article/details/78999851
本文主要介绍进程间通信(IPC,Inter Process Communication)的一些方式,包括:
LVM是逻辑盘卷管理(LogicalVolumeManager)的简称,在Linux环境下对磁盘分区进行管理的一种机制,LVM是建立在硬盘和 分区之上的一个逻辑层,来提高磁盘分区管理的灵活性。通过LVM系统管理员可以轻松管理磁盘分区,如:将若干个磁盘分区连接为一个整块的卷(volumegroup),形成一个存储池。管理员可以在卷组上随意创建逻辑卷组(logicalvolumes),并进一步在逻辑卷组上创建文件系统。
此次主要进行了/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
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/aixiaoyang168/article/details/83988253
Kubernetes 使用Persistent Volume和Persistent Volume Claim 两种API资源来管理存储。
阅读建议:本文偏干货类文章,对于从事数据分析同学,建议整段时间完整阅读;对于数据分析爱好者,可考虑直接阅读案例分析。
使用hostPath会发现当删除一个pod,并且下一个pod使用了指向主机上相同路径的hostPath卷,则新pod将会发现上一个pod留下的数据,但前提是必须将其调度到与第一个pod相同的节点上。
Kubernetes中的大部分概念如Node, Pod,Replication Controller, Service等都可以看作一种“资源对象”几乎所有的资源对象都可以通过Kubernetes提供的kubect工具(或者API编程调用)执行增、删、改、查等操作并将其保存在etcd中持久化存储。从这个角度来看,Kubernetes其实是一个高度自动化的资源控制系统,它通过`跟踪对比etcd库里保存的“资源期望状态”与当前环境中的“实际资源状态”的差异来实现自动控制和自动纠错的高级功能。
Container 中的文件在磁盘上是临时存放的,这给 Container 中运行的较重要的应用程序带来一些问题:
PersistentVolume (PV) 是由管理员设置的存储,它是群集的一部分。就像节点是集群中的资源一样,PV 也是集群中的资源。 PV 是Volume 之类的卷插件,但具有独立于使用 PV 的 Pod 的生命周期。此 API 对象包含存储实现的细节,即 NFS、iSCSI 或特定于云供应商的存储系统。
数据的持久化一直都是需要我们非常关心的问题,docker如此,K8s也不例外。在k8s中,有一个数据卷的概念。
如果pod出问题导致重启而从原本的节点运行至其他节点,这个时候新节点没有原本节点的目录导致数据不一致或者其他问题,怎么办?使用NFS网络存储
Redis(代表REmote DIctionary Server)是一种开源的内存中数据存储,通常用作数据库,缓存或消息代理。它可以存储和操作高级数据类型,例如列表,地图,集合和排序集合。由于Redis接受多种格式的密钥,因此可以在服务器上执行操作,从而减少了客户端的工作量。它仅将磁盘用于持久性,而将数据库完全保存在内存中。Redis是一种流行的数据存储解决方案,并被GitHub,Pinterest,Snapchat,Twitter,StackOverflow,Flickr等技术巨头所使用。
上一篇文章中kubernetes系列教程(九)初识Pod存储管理介绍了kubernetes中存储Volume的使用,volume支持多种不同的内置驱动,使用volumes需要知道后端驱动的细节,使用起来不方便,因此社区提出了PV概念,即通过管理员定义好PV,通过PVC使用PV;随着PV数量的不断增加,管理员需要频繁定义PV,因此提出了动态存储StorageClass,通过PVC中调用StorageClass动态创建PV,接下来介绍kubernetes系列教程高级进阶PV/PVC。
持久卷(PersistentVolume,PV) 是集群中的一块存储,可以由管理员事先制备, 或者使用存储类(Storage Class)来动态制备。 持久卷是集群资源,就像节点也是集群资源一样。PV 持久卷和普通的 Volume 一样, 也是使用卷插件来实现的,只是它们拥有独立于任何使用 PV 的 Pod 的生命周期。
我不会仅限于理论上的解释,我还将展示在 Linux 中创建和管理 LVM 的动手示例。
LVM是逻辑盘卷管理(LogicalVolumeManager)的简称,在Linux环境下对磁盘分区进行管理的一种机制,LVM是建立在硬盘和分区之上的一个逻辑层,来提高磁盘分区管理的灵活性。通过LVM系统管理员可以轻松管理磁盘分区,扩容文件系统,LVM将若干个磁盘分区连接为一个整块的卷(volumegroup),形成一个存储池。管理员可以在卷组上随意创建逻辑卷组(logicalvolumes),并进一步在逻辑卷组上创建文件系统。
PV 的全称是:PersistentVolume(持久化卷),是对底层共享存储的一种抽象,PV 由管理员进行创建和配置,是一个全局资源,包含存储的类型,存储的大小和访问模式等。它和具体的底层的共享存储技术的实现方式有关,比如 Ceph、GlusterFS、NFS、hostPath 等,都是通过插件机制完成与共享存储的对接。
https://kubernetes.io/docs/concepts/storage/persistent-volumes/
问卷链接(https://www.wjx.cn/jq/97146486.aspx)
导语 | 当今容器化技术发展盛行。本文将介绍从单机容器化技术Docker到分布式容器化架构方案Kubernetes,主要面向小白读者,旨在快速带领读者了解Docker、Kubernetes的架构、原理、组件及相关使用场景。 一、Docker (一)什么是Docker Docker是一个开源的应用容器引擎,是一种资源虚拟化技术,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的Linux机器上。虚拟化技术演历路径可分为三个时代: 物理机时代,多个应用程序可能跑在一台物理机器上
现在,OpenEBS是kubernetes下与容器原生和容器附加存储类型相关通用的领先开源项目之一。通过为每个工作负载指定专用的存储控制器,OpenEBS遵循容器附加存储或CAS的脚步。为了向用户提供更多功能,OpenEBS具有精细的存储策略和隔离功能, 可帮助用户根据工作负载选择存储。该项目不依赖Linux内核模块,而是在用户空间中运行。它属于Cloud Native Computing Foundation沙箱,在各种情况下都非常有用,例如在公共云中运行的群集, 在隔离环境中运行的无间隙群集以及本地群集。
作者:honghaohu,腾讯 PCG 后台开发工程师 从单机容器化技术 Docker 到分布式容器化架构方案 Kubernetes,当今容器化技术发展盛行。本文面向小白读者,旨在快速带领读者了解 Docker、Kubernetes 的架构、原理、组件及相关使用场景。 Docker 1.什么是 Docker Docker 是一个开源的应用容器引擎,是一种资源虚拟化技术,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上。虚拟化技术演历路径可分为三个时代:
k8s最初用于管理无状态的服务,单随着越来越多的应用迁移的k8s平台,管理存储资源成为一个非常重要的功能。
MongoDB 将数据存储为一个文档,数据结构由键值(key=>value)对组成。MongoDB 文档类似于 JSON 对象。字段值可以包含其他文档,数组及文档数组
EmptyDir是基础的Volume类型,一个EmptyDir就是Host上的一个空目录。EmptyDir是在Pod被分配到节点时创建的,它的初始化内容为空,并且无需指定宿主机上对应的目录文件,因为Kubernetes会自动的为他分配一个目录。当Pod被销毁的时候,EmptyDir中的数据也会永久的被删除。
领取专属 10元无门槛券
手把手带您无忧上云