npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

haswitch

v1.0.7

Published

DRBD + LVM + LXC Raid10 Switcher

Downloads

22

Readme

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