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

clusterduck-redis

v0.1.34

Published

clusterduck-redis [![total downloads of clusterduck-redis](https://img.shields.io/npm/dt/clusterduck-redis.svg)](https://www.npmjs.com/package/clusterduck-redis) ======= [![clusterduck-redis's License](https://img.shields.io/npm/l/clusterduck-redis.svg)](

Downloads

10

Readme

clusterduck-redis total downloads of clusterduck-redis

clusterduck-redis's License latest version of clusterduck-redis

A Redis extension for Clusterduck which includes:

Table Of Contents

Installation

Clusterduck is required.

npm i -g clusterduck-redis

Configuration

Let's define a Redis cluster named my_redis_cluster:

# clusters:

my_redis_cluster:
  type: clusterduck-redis

Nodes

Then let's define some nodes:

    # List of nodes
    nodes:
      - addr: 127.0.0.1:6379
      - addr: 127.0.0.1:6380

Note that you can omit this altogether if you want to only add nodes dynamically.

Health checks

Now let's set up a simple health check.

    health_checks:

      - type: basic
        timeout: 1s
        every: 1s
        commands:
          - [ 'SET', 'x', 'y' ]

Now every second each node in the cluster will get checked on.

Envoy balancer

Envoy is required to be installed.

Let's write up a config:

  balancers:

    my_balancer:
      type: envoy
      listen: 0.0.0.0:9999

      # This section is optional
      admin:
        access_log_path: "/tmp/admin_access.log"
        address:
          socket_address:
            address: "127.0.0.1"
            port_value: 9901

Note: clusterduck will run envoy with an according configuration. Hot restarting works out-of-box so that envoy is always kept in sync with clusterduck. It requires no middleware or additional configuration.

Redis server wrapper

If you want to run multiple Redis instances you can use redis-server-wrapper to make life easier.

Let's start a Redis instance:

CLUSTER=redis_cache redis-server-wrapper start -d

It will pick an unused port from the range, spawn a Redis instance, and add the address to your Clusterduck cluster.

If you want to stop a Redis instance, just run clusterduck stop [port] and it will remove it from the cluster first, then wait a bit, so the traffic is off the instance and then gracefully shutdown Redis.

Debug

For debugging purposes use DEBUG environmental variable: DEBUG=ioredis*,envoy clusterduck

Cluster events

Event | Description --------------------|------------------------------------------------------ nodes | Set of nodes has changed active | Set of active nodes has changed

Node events

Event | Description --------------------|------------------------------------------------------ state | Node state has changed

Dependencies

Envoy balancer

License

LGPL 3.0 or later.