一千萬個為什麽

搜索

SnowFlakes服務器,Phoenix服務器和不可變服務器的優缺點是什麽?



我對矩陣比較好奇,比如每種服務器的安全性/易管理性/取證能力。我可能會忘記每種類型的更多關鍵特征。

我對這些類型有一個總體的想法,但是在某些情況下(例如,當應用程序的自動化變得復雜時),在它們之間進行選擇時,參考矩陣會有幫助。

為了避免擔心它太寬泛,我覺得把它分成多個問題會分散信息,並且關於安全比較的問題也需要對每種類型進行比較。

轉載註明原文: SnowFlakes服務器,Phoenix服務器和不可變服務器的優缺點是什麽?

一共有 3 個回答:

“鳳凰城服務器”這個詞是由Martin Fowler的一位同事創造出來的,所有這三個詞在Martin的bliki的短文中都有描述。

文章中描述了每臺服務器的優缺點。主要區別在於服務器的管理方式。

服務器的存在是為了滿足某些應用程序容器的角色。由於應用程序經常更改,通常需要更改容器的某些屬性 - 例如包,配置等。有時還需要更改容器本身的屬性,因為外部原因,例如需要修補程序的安全漏洞被安裝。

有幾種方法可以更改現有的服務器:

  1. 最初手動創建服務器,然後每次需要更改時都要更改其內容(變更)。
  2. 通常以自動方式(不是手動方式)根據配方“烘焙”服務器的映像。然後從該圖像創建服務器。在每次更改時重復此過程。

前者被稱為Snowflake,而後者則允許Phoenix和Immutable服務器類型。不可變的狀態表明一旦創建它就不會對現有服務器進行更改,並且Phoenix意味著服務器完全被破壞,並且在更改過程中使用新服務器替換服務器。

由於我更多地考慮每種類型的優缺點,下面是我的觀點(並非詳盡無遺,在我看來這是重要的運營):

  1. Snowflakes Servers

    • What they are: Systems with their specific configuration, no other servers in the data centre have the exact same parameters. They are usually manually administered.

    • Advantages:

      • Fitted to the needs of what's running on them.
      • Long-lived, updates are usually shorts.
      • Adapted to special cases where the tweaks are well documented by the product hosted.
    • Drawbacks:

      • Sometimes updates leave unused files, the cleanup could be complex.
      • When the changes have to be made to multiples machines it takes a while.
      • Nothing prevents undocumented change.
      • In the case of corruption, you have to rebuild a base OS and restore, some OS tweaks can't be restored and should be reapplied, it's easy to slip over a line and forget an important tweak.
      • Usually long to provision due to the manual configuration.
  2. Phoenix Servers

    • What they are: Automatically configured by some code.
    • Advantages:

      • Defined by code, version-able.
      • Easily replicated to a point in time.
      • Long-lived, short updates also.
      • Changes to controlled files are documented and can't be forgotten.
    • Drawbacks:

    • Sometimes updates leave unused files, the cleanup could be complex.
    • Not everything is under code management, some tweaks by a human can be missed if not included into the automation.
  3. Immutable Servers

    • What they are:
      • Automated one-time provisioning from a master image with generally no access.
    • Advantages:

      • Defined by code, version-able.
      • Easily replicated to a point in time.
      • Reduced attack surface due to the usual removal of remote access.
      • Fixed configuration, no change can break something
      • Easily scalable 'on demand' from the master image.
    • Drawbacks:

      • They are immutable, you have to ensure you can roll an update quickly in case of a 0day flaw impacting you.
      • Not all applications fit well inside this model (Databases, for example, a complete replace on same data is not always possible, there's migration to handle).
      • Brings some new challenges for forensic analysis of crash and log management.

這些模式都不是唯一的,你必須根據你的實際需要選擇最好的模式。在災難後恢復的情況下,雪花會帶來很多擔憂,所以Phoenix和Immutable之間的選擇通常更多。

所有這三種模式都是各種各樣的模式,但不是挑選和選擇在任何特定情況下使用的情況,而是知道何時識別可以幫助或傷害您的模式的情況。

雪花服務器

A 雪花服務器 is very much an anti-pattern representing the case when a server evolves in an uncontrolled manner to the point when it cannot be easily reproduced.

我在生產中已經有了這種服務器的大量入口,它們很容易被發現,因為通常會有大量失敗的更改和評論,例如“它(更改)在Development/Test/UAT/Staging中起作用”。

鳳凰施維雅

鳳凰服務器比馬丁福勒所說的模式更重要:

服務器應該像鳳凰一樣,經常從灰燼中升起。 [a]

如果您要將IT服務管理(ITSM)或ITIL語言應用於相同的情況,您可能會將其稱為

每項服務的單獨計劃應為事件的每個階段提供詳細的程序和分步指南,以便恢復團隊能夠恢復服務並由此滿足商定的流程和組件RTO。

不可變的服務器

An

不可變的服務器 or Immutable Infrastructure is the process by which we treat all deployed infrastructure, configuration and code as utterly immutable, i.e. unchanging. When we deploy anything new we spin up new infrastructure and deploy the code to this. Interestingly this mostly satisfies the needs traditionally fulfilled by Evergreening.


筆記

  • a: Martin's colleague Kornelis Sietsma came up with the term "Phoenix Server" on an internal discussion list.