New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

haswitch

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

haswitch

DRBD + LVM + LXC Raid10 Switcher

latest
Source
npmnpm
Version
1.0.7
Version published
Maintainers
1
Created
Source

haswitch is a Linux high availability tool to manage VM synchronization in a RAID 10 environment (machine-to-machine). Its primary goal is to switch LXC virtual machines onto LVM + DRBD. Its secondary goal is to manage the network coming with virtual machines then it manages iptables and bridges. haswitch also supports OVH's failover API which allow to switch failover ip during the migration.

Install

sudo npm install -g haswitch

Operations

Show configuration

haswitch show

Start all resources

haswitch start

Stop ha0 resource

haswitch start ha0

Start VM vm1ha0 on ha0 resource

haswitch start ha0 vm1ha0

Stop VM vm1ha0 on ha0 without execution

haswitch -e stop ha0 vm1ha0

LXC

Install LXC

sudo apt-get install lxc lxc-templates wget bridge-utils

Prepare LXC

Disable the default bridge “lxcbr0“, got created as part of LXC installation.

sudo nano /etc/default/lxc-net

Set “USE_LXC_BRIDGE” to “false“.

USE_LXC_BRIDGE="false"

DRBD

I suggest you to follow the guide from Zarafa:

  • https://doc.zarafa.com/trunk/Zarafa_HA_Manual/en-US/html/_drbd_device_initialization.html

The DRBD resource name must have the same name as a haswitch resource.

ISP Integration

OVH

Edit your /etc/haswitch.json and add:

ovh: {
  "me": "nsXXX.ovh.net",
  "endpoint": "ovh-eu",
  "appKey": "APP_KEY",
  "appSecret": "APP_SECRET",
}

Customer Key will come after running the credential checker.

haswitch ovh auth

A validation URL will be given You will have to follow it in order to activate the application. Once you have done that you will have the customer key:

ovh: {
  "me": "nsXXX.ovh.net",
  "endpoint": "ovh-eu",
  "appKey": "APP_KEY",
  "appSecret": "APP_SECRET",
  "consumerKey": "Given consumerKey",
}

Now you have to activate OVH failover on the LXC container

{
  "ovh": true,
  "vm": "vm1ha0",
  "public": {
    "internal": "192.168.0.6",
    "external": "1.2.3.2",
    "internal6": "fd67:d076:089a:8da3::",
    "external6": "2003:dead:beef:f80c::",
  }
}

Once you have configured you can check the OVH's failover status:

haswitch ovh check

To redirect all failover IP in every resources on Me (see ovh.me):

haswitch ovh failover

Or for a specific resource:

haswitch ovh failover ha0

Keywords

drbd

FAQs

Package last updated on 18 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts