一個網卡是能夠添加多個IP的。node
就是多個主機工做在 同一個集羣中,即兩臺主機以上。每臺機器除了本身的實IP外,會設置一個浮動IP,浮動IP與主機的服務(HTTP服務/郵箱服務)綁在一塊兒的。即應用服務在哪臺機器上啓動,浮動IP也在這臺機器上激活,這臺機器看上去就有兩個IP地址。對於客戶端它只需訪問浮動IP便可。ios
即便主機端的機器因爲故障發生切換,客戶端只要鏈接上浮動IP,就能夠找到主機端的服務。git
好處就是一旦其中一臺機器不能工做了,能夠很快的將服務切換到另一臺主機上。提升系統的冗餘性。web
當業務比較繁忙時候,能夠經過float IP在主機之間實現負載均衡。服務器
實際實現可能會用到ARP欺騙技術來解決MAC地址的問題。網絡
--------------------------------------------------併發
在作雙機的時候,設定的一個IP,經過訪問這個IP,具體到後臺哪臺機器,由系統指定。浮動IP是隨資源一塊兒走的。app
其實就是由軟件根據具體狀況把該IP設置在某一臺機器上,對外提供服務爲了不由於一臺機器宕機而致使不能對外提供服務,導致業務中斷,使用兩臺機器進行提供服務,可是用戶怎麼知道本身使用哪一個IP進行鏈接呢?使用其中的一個,若是這個宕機了,就仍然會中斷服務。因而就使用一個ha軟件,其根據主機狀況,指定一個IP在兩臺主機中的任何一個,若是一臺主機宕掉了,就把這個IP自動切換到另一臺機器上,這樣用戶仍然只須要使用這個IP,任何一臺主機掛掉了,都不會致使服務中斷.說白了,就是這個IP能夠根據具體狀況,自動的在不一樣的N臺機器間進行設置。負載均衡
浮動IP,顧名思義就是飄渺不定的IP,這個IP地址能夠漂浮在任一一臺主機上,可是IP地址自己數字不會發生變化!通常的集羣軟件都會使用浮動IP對外服務,對用戶也是透明的。
---------------------
做者:雁城布衣
來源:CSDN
原文:https://blog.csdn.net/xtank_nie/article/details/47000537
版權聲明:本文爲博主原創文章,轉載請附上博文連接!less
=============================
源地址:https://www.1and1.com/digitalguide/server/know-how/what-is-a-floating-ip/
What is a floating IP?
什麼是浮動IP
The internet – plainly put – consists of many computers connected by cables, fiber optic cables, and wireless receivers. They exchange data based on a common ‘language'. This common standard is known as the Internet Protocol (IP). Data is arranged in such a way that computers, which understand the common protocol, can interpret it.
因特網簡單來講說是許多計算機由電纜、光纖、無線接收器鏈接組成的網絡。網絡中設備間數據交互是經過IP協議進行,數據以IP封裝其餘計算根據協議才能解析數據。
An IP address, also referred to as an 'IP', makes digital devices detectable in a network. It is a crucial prerequisite so that electronic data packets can be delivered reliably. The devices communicate with one another, for example, over the internet. The IP address ensures that data from the sender reaches the correct recipient – for example, from a web browser to a web server or vice versa. An IP address can be assigned to both single and multiple devices at the same time. Likewise, a single device can have multiple IP addresses at the same time.
IP地址簡稱IP,數字設備以此做爲身份標識,才能被其餘設備發現和識別。IP地址是設備間交互數據的先決條件。IP地址保證數據的發送者發出的數據能正確到相應的接收者,反之也是如此。一個IP地址可分配多個設備,一個設備也可擁有多個IP。
However, in order to be able to understand exactly what a floating IP is, you first need to know the difference between dynamic and static IP addresses.
爲了更好的弄明白什麼是浮動IP,首先須要搞明靜態IP和動態IP之間的區別。
Contents
1. Dynamic IP
2. Static IP
3. Floating IP – definition
4. How is a floating IP generated?
5. When are floating IPs used?
6. Failover and switchover
7. What advantages does a floating IP offer?
Dynamic IP
動態IP
When a computer connects to the internet, in most cases the Internet Service Provider (ISP) assigns a dynamic IP address to it. Dynamic IP addresses are the most cost-effective standard for users and providers. They are characterized by the fact that they are only assigned temporarily and change after a certain time, which is either fixed (e.g. for 24 hours), or is irregular. The user then receives a new dynamic IP address for their computer from the respective internet service provider and the previous address will then be signed to a different user.
當一個計算機接入到互聯網,網絡服務接入商會分配一個動態IP給這臺計算機。動態IP對用戶和接入商來講都是最經濟的。動態IP是不固定的,過一段時間會變。過一段時間用戶的電腦會收到一個新的IP地址,原來的IP地址有能夠已經分配給了別的電腦。
Static IP
靜態IP
A static IP, on the other hand, is a fixed address and is permanently assigned to a device. Static IP addresses are found mainly in the web server or e-mail server area, or wherever offers or website content must be accessible via a fixed URL , so that users or processes can (re)find them without any problems. Computers in a network or peripheral devices (such as printers) have fixed IPs, so that the individual devices within the network can easily communicate with one another.
從一個方面來講,靜態IP是 一個固定的IP地址,被永久的分配給一個設備。靜態IP多用於Web服務器或者電子郵件服務器或者一個網站。這些網站經過一個固定的URL進行訪問,用戶能夠經過URL找到IP地址。在一個網絡中的計算機或者外圍設備都有固定的IP,這樣設備間才能很容易的交互數據。
So that users don’t have to remember complex numbers, it’s possible to assign a domain name to a static IP address e.g. www.example.org. The numerical IP, the 'connection number' of a device in the network, is therefore translated into a name that can easily be remembered. This is generally only reserved for static IPs. It doesn’t make much sense for dynamic IPs since the user changes so frequently.
給一個靜態IP分配域名後,用戶就不須要記住複雜的IP地址。使用域名IP地址被轉成了容易記憶的名字。域名通常只用於靜態IP,因動態IP頻繁變更使用域名意義不大。
Floating IP – definition
浮動IP
A floating IP is usually a public, routable IP address that is not automatically assigned to an entity. Instead, a project owner assigns them to one or more entities temporarily. The respective entity has an automatically assigned, static IP for communication between instances in a private, non-routable network area, as well as via a manually assigned floating IP. This makes the entity’s services outside a cloud or network recognizable and therefore achievable.
一個浮動IP一般是一個公開的、能夠路由到的IP地址,而且不會自動分配給實體設備。項目管理者臨時分配動態IP到一個或者多個實體設備。這個實體設備有自動分配的靜態IP用於內部網間設備的通信。這個內部網使用私有地址,這些私有地址不能被路由到。經過浮動IP內網實體的服務才能被外網識別和訪問。
In appropriately configured failover scenarios, an IP 'floats' to another active unit in the network so that it can take on the function of a dormant entity without a time delay, and can then answer incoming requests.
在一個配置好浮點IP的切換場景是,IP地址飄到網絡中的另外一臺設備。新設備無延遲的接替當掉的設備,並對外提供服務。
How is a floating IP generated?
浮點IP是如何產生的?
Users obtain floating IPs for their projects from different pools that the system administrator configures and provides as server resources. As soon as a user receives a floating IP, they become the 'owner'. They can assign it to an entity, remove it, and then assign it to another at any time. Even if an entity is terminated, the user does not 'lose' the associated floating IP. It remains as a resource and can still be assigned to another entity when needed.
用戶從系統管理員配置的資源池中爲他們的項目獲取IP地址。一旦用戶獲取一個浮動IP,就擁有了這個IP。他能夠分配這個IP到一個計算實體,或者在任一時間移除分配給其餘設備。就算設備關機,用戶還擁有他屬於他的浮動IP。浮動IP就像一種資源,當須要時能夠分配給其餘設備。
A major reason for using several parallel floating IP pools is that each pool can be operated by another internet service provider or can also be assigned by other external networks. This ensures that the connectivity or availability is maintainable even if an internet service provider should fail due to a malfunction.
使用多個平行的浮動IP主要是爲了防止當其中的一個不可能用時使用其餘地址以保證服務的正常可用。
When are floating IPs used?
何時會用浮動IP
Maximum availability is one of the key factors in every production environment. In the communication network, however, a single error can cause applications to fail. Developers do sleep better knowing that their applications are designed to withstand any conceivable error scenarios. The goal is to provide a highly available piece of infrastructure with minimal downtime.
最大的可用性是浮動IP在生產環境中使用的一個關鍵因素。在網絡中,單個錯誤可能會致使應用的不可用。若是系統能成功應對任何能夠想到的應用場景,開發人員就能夠安枕無憂。浮動IP的目標就最小當機下提供高可用的基礎設施。
A floating IP can serve as a flexible load balancing address, helping to balance peak loads by distributing incoming network traffic to different network nodes. Network nodes are devices which connect two (or more) transmission paths of a telecommunication network. As with a computer that distributes workflows across multiple processors, load balancing also handles large amounts of simultaneous requests or more complex calculations by splitting the load across multiple parallel systems.
浮動IP能夠用於靈活的負載均衡地址,用於高峯時的負載均衡,分流訪問流量到不一樣的網絡節點。網絡節點是鏈接到兩個或者多個通信網絡。就像一臺電腦分配工做流到不一樣的處理器,負載均衡大量併發的請求或者複雜的計算分配到並行系統中。
Failover and switchover
故障恢復和地址切換
If a primary load balancer or a central application server in a cluster fails on one side, a floating IP can be immediately assigned a redundant application server or a secondary load balancer in a correspondingly configured system. The IP 'floats' to the active unit, which immediately carries out the desired processes. An unplanned change between network services is referred to as 'failover'. This kind of protection is especially recommended for critical applications.
若是一個主要的負載均衡器或者集羣中一個主要的業務服務器當掉,浮動IP當即被分配到冗餘的應用器或者備用的負載均衡器,這些都須要提早配置好。當浮動IP飄到一個活動單元,活動單元當即承擔相應的業務。故障恢復指的是非計劃的網絡服務切換。這種特別的保護推薦用於關鍵應用。
A planned change from a primary to a secondary system is referred to as a 'switchover'. The targeted transmission of services is not triggered by errors, but is usually controlled by a system administrator. A classic reason for a switchover is, for example, routine maintenance of the primary or secondary systems where a parallel instance temporarily takes over its function.
一個有計劃的從主切換到從,一般被稱爲切換。切換不是由故障或者錯誤引發,而是系統管理員操做完成。切換的典型應用場景時,當對一個系統時行例常的維護時,由另外一服務接替他的功能。
What advantages does a floating IP offer?
浮動IP優勢
One of the main advantages of floating IPs is their flexibility – the free and needs-oriented assignability. Floating IPs are therefore suitable for use in both failover and switchover environments – for example, for performing upgrades of applications or entire sites with minimal downtime. While an upgrade is applied to one entity, another one takes on the traffic. Once the upgrade has been successfully completed, the traffic is redirected to the updated unit.
浮動IP的主要優勢是靈活,自由的根據須要分配。浮動IP即適用於故障恢復又適用於服務切換。好比對某個應用或者整個站點的升級,並能保證對業務有最小的影響。當對一個應用升級時,另外一個應用分配輸入流量。一旦升級完成,流量會被從新導入到升級節點。
Another advantage: even if several or even many different entities are concealed behind a service being offered, the floating IP appears on the surface to users (who make use of the service) rather than the server’s IP that offers the respective service.
另外一個優勢是:浮動IP對外提供統一的IP,而不是實際對外提供服務的IP地址。
=============================
又稱ARP毒化(ARP poisoning,網上上多譯爲ARP病毒)或ARP攻擊,是針對以太網地址解析協議(ARP)的一種攻擊技術。此種攻擊可以讓攻擊者獲取局域網上的數據包甚至可篡改數據包,且可以讓網上上特定計算機或全部計算機沒法正常連線。最先探討ARP欺騙的文章是由Yuri Volobuev所寫的《ARP與ICMP轉向遊戲》(ARP and ICMP redirection games)。