随机算法关于生日悖论的求值

In probability theory, the birthday problem, or birthday paradox This not a paradox in the sense of leading to a logical contradiction, but is called a paradox because the mathematical truth contradicts naive intuition: most people estimate that the chance is much lower than 50%. pertains to the probalility that in a set of randomly chosen people some pair of them will have the same birthday. In a group of at least 23 randomly chosen people, there is more than 50% probalility that some pair of them will both have been born on the same day. For 57 or more people, the probability is more than 99%, and it reachese 100% when the number of people reaches 366 (by the pigeon hole principle, ignoring leap yeas). The mathematics behind this problem lead to a well-known cryptographic attack call the birthday attack.

Read more

在CentOS7快速构建Ceph集群

Ceph是一个分布式、可扩展、高可用、性能优异的存储系统平台,支持块设备、文件系统和REST三种存储接口。它是一个高度可配置的系统,并提供了一个命令行界面用于监视和控制其存储集群。Ceph还包含认证和授权功能,可兼容多种存储网关接口,如OpenStack Swift和Amazon S3。

Read more

kubernetes 设计理念及主要概念之Volume(四)

Kubernetes存储卷

默认情况下容器的数据都是非持久化的,在容器消亡以后数据也跟着丢失,所以Docker提供了Volume机制以便将数据持久化存储。类似的,Kubernetes提供了更强大的Volume机制和丰富的插件,解决了容器数据持久化和容器间共享数据的问题。

与Docker不同,Kubernetes Volume的生命周期与Pod绑定

  • 容器挂掉后Kubelet再次重启容器时,Volume的数据依然还在
  • 而Pod删除时,Volume才会清理。数据是否丢失取决于具体的Volume类型,比如emptyDir的数据会丢失,而PV的数据不会丢失
Read more

kubernetes 设计理念及主要概念之Service(三)

服务发现与负载均衡

Kubernetes提供有服务发现和负载均衡机制,提供了Service资源,并通过kube-proxy配合cloud provider来适应不同的应用场景。

目前,Kubernetes中的负载均衡大致可以分为以下几种机制,每种机制都有其特定的应用场景:

  • Service:直接用Service提供cluster内部的负载均衡,并借助cloud provider提供的LB提供外部访问
  • Ingress Controller:还是用Service提供cluster内部的负载均衡,但是通过自定义LB提供外部访问
  • Service Load Balancer:把load balancer直接跑在容器中,实现Bare Metal的Service Load Balancer
  • Custom Load Balancer:自定义负载均衡,并替代kube-proxy,一般在物理部署Kubernetes时使用,方便接入公司已有的外部服务
Read more

kubernetes 设计理念及主要概念之Pod(二)

Kubernetes使用共享网络将多个物理机或虚拟机汇集到一个集群中,在各服务器之间进行通信,该集群时配置Kubernetes的所有组件、功能和工作负载的物理平台。集群中一台服务器(或高可用部署中的一组服务器)作为Master,负责管理整个集群,其余作为Worker Node,集群中的主机可以是物理服务器,也可以是虚拟机(包括云VPS)。

Read more