Python:从入门到实践
本文主要介绍 Python 的概念与特性、环境部署、基本语法、标准库、第三方库、科学分析工具、Python 工程工具、实战技巧和踩过的一些坑。
本文主要介绍 Python 的概念与特性、环境部署、基本语法、标准库、第三方库、科学分析工具、Python 工程工具、实战技巧和踩过的一些坑。
Apache Flink™ is a framework and distributed processing engine for stateful computations over unbounded and bounded data streams. Flink has been designed to run in all common cluster environments, perform computations at in-memory speed and at any scale.
Docker™ provides a way to run applications securely isolated in a container, packaged with all its dependencies and libraries.
1 | # https://docs.docker.com/desktop/mac/install/ |
从 Toolbox 的 Archive 页面找到 DockerToolbox-19.03.1.exe 并下载
注意安装组件的时候,选择 Full installation
,其他的均使用默认的选项,即可
1 | $ vim ~/.docker/config.json |
1 | { |
ZooKeeper 是一个基于 Google Chubby 论文实现的一款解决分布式数据一致性问题的开源实现,方便了依赖 ZooKeeper 的应用实现 数据发布 / 订阅
、负载均衡
、服务注册与发现
、分布式协调
、事件通知
、集群管理
、Leader 选举
、 分布式锁和队列
等功能
一般的,在分布式系统中,构成集群的每一台机器都有自己的角色,最为典型的集群模式就是 Master / Slave
主备模式。在该模式中,我们把能够处理所有写操作
的机器称为 Master
节点,并把所有通过异步复制
方式获取最新数据、提供读服务
的机器称为 Slave
节点
而 ZooKeeper 中,则是引入了 领导者(Leader)
、跟随者(Follower)
、观察者(Observer)
三种角色 和 领导(Leading)
、跟随(Following)
、观察(Observing)
、寻找(Looking)
等相应的状态。在 ZooKeeper 集群中的通过一种 Leader 选举
的过程,来选定某个节点作为 Leader
节点,该节点为客户端提供读
和写
服务。而 Follower
和 Observer
节点,则都能提供读
服务,唯一的区别在于,Observer
机器不参与 Leader 选举
过程 和 写操作
的"过半写成功"
策略,Observer
只会被告知已经 commit 的 proposal。因此 Observer
可以在不影响写性能
的情况下提升集群的读性能
(详见下文 “性能优化 - 优化策略 - Observer 模式” 部分)