首页 \ 问答 \ GitLab高可用性(主动 - 被动)(GitLab High Availability (Active - Passive))

GitLab高可用性(主动 - 被动)(GitLab High Availability (Active - Passive))

我的客户要求我使用两个数据中心为GitLab提供高可用性解决方案。 之后阅读文档并使用谷歌,我非常迷失。

有活动主动的高可用性GitLab文档看起来不错,但主动被动只有5行,GitLab说:“使用DRBD”。

有人与GitLab解决方案合作,具有高可用性吗?

谢谢!


My client asked me for a high availability solution for GitLab using two data center. After to read documentation and to use google, I´m very very lost.

The GitLab documentation for High Availability with active active seems good but the active passive is only 5 lines where GitLab says: "Use DRBD".

Someone has worked with GitLab solutions with high availability?.

Thanks!


原文:https://stackoverflow.com/questions/44634523
更新时间:2023-08-29 20:08

最满意答案

如果您想使用与基类相同的代码并使用额外的功能扩展它,那么从基类继承是非常有用的。

与此有关的是虚拟的和抽象的。 您可以使用基本实现制作虚拟方法。 后代类可以(可选)更改或添加到此实现。 抽象类本身是不完整的基类。 抽象方法被声明,但尚未实现。 后代类必须提供一个实现。 如果基类实现一个流,但这个流的一部分需要由另一个类来实现,这非常有用。 基类需要能够调用那个部分,这是宣布一个抽象方法的地方。

接口是一个不同的故事。 接口是一个关于哪些方法存在于类中的合约,但它们可以由两个完全无关的类来实现。 这很方便,因为您可以为小部分功能制作小型界面。 例如,可以保存的东西可以实现ISavable,它只是强制执行方法'Save'的存在。 两个完全不同的类可以实现这一点,例如允许保存所有功能来保存可以保存的所有内容。

多重继承是一种特定的语言功能,虽然在许多语言中您可以通过使用接口和委托设计模式获得类似的效果,但在许多语言中都不可用。


Inheriting from a base class is useful if you want to use the same code as the base class and extend it with extra functionality.

Vitual and abstract are related to this. You can make a virtual method with a base implementation. A descendant class can (optionally) change or add to this implementation. An abstract class is a base class that is incomplete in itself. An abstract method is declared, but has no implementation yet. A descendant class must provide an implementation. This is useful if the base class implements a flow, but a part of that flow needs to be implemented by another class. The base class needs to be able to call that part, which is where declaring an abstract method comes in sight.

Interfaces are a different story. An interface is a contract about which methods exist in a class, but they can be implemented by two completely unrelated classes. This is convenient, because you can make small interfaces for small pieces of functionality. For example, something that can be saved can implement ISavable, which just enforces the existence of the method 'Save'. Two completely different classes can implement this, allowing for instance a Save All functionality to just save everything that can be saved.

Multiple inheritance is a specific language feature, that is not available in many languages, although in many languages you can have a similar effect by using interfaces and the delegate design pattern.

相关问答

更多
  • 这里: public class ConreteFunctionality:AbstractFunctionality { public void Method() { Console.WriteLine("Concrete stuff" + "\n"); } } ...你不会覆盖现有的方法。 你正在创建一个隐藏现有的方法。 (你也应该得到一个警告,如果你真的想要这个行为,建议使用new修饰符。)接口在AbstractFunctionality中实现,所以接口映射表 ...
  • 抽象类允许您为其余代码创建基石。 您可以创建部分实现的类,然后允许用户创建更具体的需求的具体实例。 常用功能保留在抽象类中。 真实世界的比喻是汽车租赁店。 他们雇用'汽车'。 “汽车”的概念是一个抽象类,可以在他们的系统中有各种方法,允许雇用和返回,以及保险集团,每日费率等属性。但是, 没有客户会去租用商店并雇用'汽车'。 他们雇用了福特福克斯,梅赛德斯,斯柯达法比亚等等。 所以这些是抽象类的具体实例,并且很可能在面向对象的系统中表示,该系统具有从'car'派生的特定类。 另一方面,接口允许多态性 。 这是 ...
  • 实例方法和字段由super类的派生类继承 ,但并不意味着它们也可以访问 。 在super类中被标记为private并且由sub类继承的字段是sub类的对象的一部分,但是不能在sub类中进行修改 [不推荐的解决方案] 实例字段应始终声明为“私人”。 不这样做是一个坏习惯。 但是为了理解观点,我提出了3分以下的推荐方式。 您需要将该字段声明为非私有的,以便子类可以访问它。 您可以将超类中的字段声明为protected。 受保护的字段可在子类中访问。 如果子类和超类共享相同的包,则不能应用修饰符(默认包级别)。 ...
  • 运行时永远不会创建基类和派生类的单独实例 - 只是派生类实例也具有基类的所有变量等,并在初始化过程中运行基类构造函数。 “普通”基类和抽象基类之间没有区别。 The runtime never creates separate instances of the base class and the derived class - it's just that the derived class instance also has all the variables etc of the base class ...
  • var fake = (IOtherInterface) A.Fake(builder => builder.Implements(typeof(IOtherInterface))); A.CallTo(() => fake.DoSomething()).CallsBaseMethod(); fake.DoSomething(); Implements仅适用于接口,因此使用它的正确方法是伪造接口或类并使用Imple ...
  • 来自java教程 : ..接口中的所有抽象,默认和静态方法都是隐式公共的,因此您可以省略public修饰符。 这意味着除非您将接口可见性限制为包,否则您不能这样做。 但我想你不能。 package foo; interface Foo { } 我想你可以写一个自定义注释(像@InstanciableOnlyInMyPackage这样的@InstanciableOnlyInMyPackage )并将它放在界面上。 然后使用注释处理工具使用引发编译器错误。 From the java tutorial: . ...
  • 如果您想使用与基类相同的代码并使用额外的功能扩展它,那么从基类继承是非常有用的。 与此有关的是虚拟的和抽象的。 您可以使用基本实现制作虚拟方法。 后代类可以(可选)更改或添加到此实现。 抽象类本身是不完整的基类。 抽象方法被声明,但尚未实现。 后代类必须提供一个实现。 如果基类实现一个流,但这个流的一部分需要由另一个类来实现,这非常有用。 基类需要能够调用那个部分,这是宣布一个抽象方法的地方。 接口是一个不同的故事。 接口是一个关于哪些方法存在于类中的合约,但它们可以由两个完全无关的类来实现。 这很方便,因 ...
  • 你不能这样做。 类型系统正在反对您尝试更改覆盖类中的方法类型。 IChildThing可能来自IBaseThing,但它不是一回事。 例如,您可以稍后向IChildThing添加更多方法。 然后,一个类(Concrete)将承诺返回的对象具有与基类不同的签名 - 这是类型错误。 如果您在某些情况下需要参考IChildThing,请执行以下操作: internal class Concrete : Base { public override IBaseThing
  • 纯虚方法总是必须在派生类中重新实现? 实际上是一个将要实例化的派生类。 在你的代码中,你没有从Derived创建一个对象,所以没关系。 我可以写这样的东西吗? 是。 你纠正了一些小错误: class BaseInterface { public: virtual void fun_a() = 0; virtual void fun_b() = 0; virtual ~BaseInterface() {}; // You forget this }; class Derived ...
  • 这是不允许的,因为你可以用抽象类来做更多的事情。 允许多重继承是没有意义的,只要你可以使用一个接口就可以使用抽象类。 只使用抽象类来处理不能用接口做的事情更简单,在这种情况下,你将无法使用两个抽象父类。 注意:对于Java 8来说,用接口无法做到这一点,可以通过实现来使用公共实例和静态方法。 在Java 9中,您将能够在接口中使用private方法;) This is not allowed because you can do more than this with abstract classes. I ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)