西维蜀黍

【macOS】网络管理

Install

Alternative ip

$ brew install iproute2mac
$ ip link show
$ ip -s link 

Interfaces

List Devices with the Interface Number

$ networksetup -listnetworkserviceorder
(1) Ethernet
(Hardware Port: Ethernet, Device: en0)

(2) USB 10/100/1000 LAN
(Hardware Port: USB 10/100/1000 LAN, Device: en5)

(3) Wi-Fi
(Hardware Port: Wi-Fi, Device: en2)

(4) Bluetooth PAN
(Hardware Port: Bluetooth PAN, Device: en3)

Route

View The Routing Table

$ netstat -nr
Routing tables

Internet:

Destination     Gateway        Flags      Refs     Use     Netif Expire
default         10.1.1.1       UGSc       36       65      jnc0
default         192.168.0.1    UGScI      20       0       en1
  ...


【Docker】Container 常用命令 - network

网络端口映射

Docker网络端口映射使得通过访问宿主机器上的某个端口,可以访问到某个Docker容器上的端口。这样Docker容器就可以对外提供服务了。

查看某个容器的端口映射情况

$ docker port [containerId]

https://docs.docker.com/engine/reference/commandline/run/

  ...


【Distributed System】Partitioning

Partitioning

Replication—that is, having multiple copies of the same data on different nodes. For very large datasets, or very high query throughput, that is not sufficient: we need to break the data up into partitions, also known as sharding.

Normally, partitions are defined in such a way that each piece of data (each record, row, or document) belongs to exactly one partition. There are various ways of achieving this. In effect, each partition is a small database of its own, although the database may support operations that touch multiple partitions at the same time.

The main reason for wanting to partition data is scalability. Different partitions can be placed on different nodes in a shared-nothing cluster. Thus, a large dataset can be distributed across many disks, and the query load can be distributed across many processors.

  ...


【Engineering】Fault Tolerance

Fault Tolerance

Fault tolerance is the property that enables a system to continue operating properly in the event of the failure of one or more faults within some of its components. If its operating quality decreases at all, the decrease is proportional to the severity of the failure, as compared to a naively designed system, in which even a small failure can cause total breakdown. Fault tolerance is particularly sought after in high-availability, mission-critical, or even life-critical systems. The ability of maintaining functionality when portions of a system break down is referred to as graceful degradation.

A fault-tolerant design enables a system to continue its intended operation, possibly at a reduced level, rather than failing completely, when some part of the system fails. The term is most commonly used to describe computer systems designed to continue more or less fully operational with, perhaps, a reduction in throughput or an increase in response time in the event of some partial failure. That is, the system as a whole is not stopped due to problems either in the hardware or the software. An example in another field is a motor vehicle designed so it will continue to be drivable if one of the tires is punctured, or a structure that is able to retain its integrity in the presence of damage due to causes such as fatigue, corrosion, manufacturing flaws, or impact.

Within the scope of an individual system, fault tolerance can be achieved by anticipating exceptional conditions and building the system to cope with them, and, in general, aiming for self-stabilization so that the system converges towards an error-free state. However, if the consequences of a system failure are catastrophic, or the cost of making it sufficiently reliable is very high, a better solution may be to use some form of duplication. In any case, if the consequence of a system failure is so catastrophic, the system must be able to use reversion to fall back to a safe mode. This is similar to roll-back recovery but can be a human action if humans are present in the loop.

  ...


【Distributed System】Replication

Why Replication

Replication means keeping a copy of the same data on multiple machines that are connected via a network. There are several reasons why you might want to replicate data:

  1. To keep data geographically close to your users (and thus reduce latency)
  2. To allow the system to continue working even if some of its parts have failed (and thus increase availability)
  3. To scale out the number of machines that can serve read queries (and thus increase read throughput)

What is Replication

Replication in computing can refer to:

Replication in space or in time is often linked to scheduling algorithms.

  ...