memberlist

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Memberlist

A basic http key/value example of how to use hashicorp/memberlist

Install

go get github.com/asim/memberlist

Usage

memberlist
-members="": comma seperated list of members
-port=4001: http port
Create Cluster

Start first node

memberlist

Make a note of the local member address

Local member 192.168.1.64:60496
Listening on :4001

Start second node with first node as part of the member list

memberlist --members=192.168.1.64:60496 --port=4002

You should see the output

2015/10/17 22:13:49 [DEBUG] memberlist: Initiating push/pull sync with: 192.168.1.64:60496
Local member 192.168.1.64:60499
Listening on :4002

First node output will log the new connection

2015/10/17 22:13:49 [DEBUG] memberlist: TCP connection from: 192.168.1.64:60500
2015/10/17 22:13:52 [DEBUG] memberlist: Initiating push/pull sync with: 192.168.1.64:60499

Key/Value Api

HTTP API

  • /add - add value
  • /get - get value
  • /del - delete value

Query params expected are key and val

# add
curl "http://localhost:4001/add?key=foo&val=bar"

# get
curl "http://localhost:4001/get?key=foo"

# delete
curl "http://localhost:4001/del?key=foo"

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL