Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    Robert Buck

    When using Serf as a library, I more or less followed how Consul uses Serf. To learn more about how to use Serf, I first wanted to create a small example app with the basic structure in place that Consul has, assuming it's the recommended pattern, and then test basic failure scenarios to see if all the plumbing is set up properly. So my code is up on Github at: https://github.com/rbuck/serf-sample. Here's my question. After I start up two nodes as follows:

    ./test --advertise-address --bind-port 11000 --advertise-port 11000 --data-dir alpha
    ./test --advertise-address --bind-port 12000 --advertise-port 12000 --data-dir beta --join

    When I interrupt the process to shut it down, I occasionally see these error messages in the log output:

    2017/12/03 13:21:44 [ERR] memberlist: Failed to send gossip to write udp [::]:11000-> use of closed network connection
    2017/12/03 13:21:44 [ERR] memberlist: Failed to send ping: write udp [::]:11000-> use of closed network connection

    Are these harmless?
    To me it seems like Serf doesn't properly shutdown the memberlist layer and so it's using closed connections. Am I missing something?

    Anthony Lapenna
    Hi there, playing with Serf as a library right now ! I wonder if there is a way to tune the log level as it seems to be pretty verbose by default ?
    I can see a lot of DEBUG messages
    Figured it out by looking at the README here: https://github.com/hashicorp/logutils
    Anthony Lapenna
    Hmmm actually, nope, still outputting DEBUG logs
    Jason Bukowski
    Im exploring the idea of using Serf to to manage the peer/member list in an application that runs as a distributed network of nodes. One requirement is that anyone must be able to download/clone our app, run it, and join the distributed network free from authentication/authorization. I fear, however, that a bad actor could join the network, alter our app's code, and spam the network with queries and/or user events. I understand that user events are fire-and-forget, so code will not be able to inspect the content of the user event before making a decision to propagate it further. Is it possible to simply disable user events and queries altogether, limiting gossip to the minimum needed to maintain the member lists on each member of the cluster?
    Stevo Slavić
    @rbuck have you tried handling interrupt/signal, to gracefully shutdown the instance by leaving the serf cluster first?
    Shashi Bhushan
    hi, i was trying to build Serf over google cloud VM, but getting errors like "client/rpc_client.go:7:2: cannot find package "github.com/hashicorp/logutils" ". I verified GoPath , GoBin variables are correctly set. Does anyone face such issue and any possible solution
    Zeno Grandi
    hi everyone, I'm stumbling on what is probably some misunderstanding of mine, but can't quite figure it out: in a (VM on Vagrant) tiny cluster of 3 machines I'm running serf query load, but I receive "Total Acks: 3 Total Responses: 0", despite serf members, serf reachability and all serf rtt ... working fine
    Zeno Grandi
    I just realised that it's just an example, and there are no handlers defined by default (?); I've manually defined it in the configuration and it works :+1:
    I can't find IRC channel for asking things anywhere.
    Can someone give me the address ? Thanks
    Webert de Souza Lima
    hey, does serf has any API endpoints so I could easily get my application talking to it?
    @webertrlz you can talk to Serf using his RPC protocol, that can be found here https://www.serf.io/docs/agent/rpc.html
    Webert de Souza Lima
    can serf be embedded in commercial code? doing changes to it, without exposing the code?
    thanks Stevo, what does it mean? yes or no ?
    Stevo Slavić
    see permissions and conditions in top paragraph there
    Colin But
    hey, just got a general question. How does serf fit into the hashicorp ecosystem suite of products? From the main hashicorp website i don't see any reference to serf. All i see is the 6 main products (vagrant, packer, terraform, consul, nomad, vault)
    Webert de Souza Lima
    @colinbut serf is the base of Consul
    Colin But
    @webertrlz so we shouldn't use Serf? Is it just an internal thing? And how come Serf is not promoted as much as their other 6 products?
    Webert de Souza Lima
    @colinbut you can use serf as it is an Open Source solution as you wish, but it may be for very specific use cases
    @colinbut I have an ongoing service discovery architecture built on top of Serf. You can read through the docs. But Consul is a very robust service discovery itself.
    I thin Docker uses Serf as well for discovering containers on nodes of a cluster.
    Frederiko Costa
    Hi guys, quick question: Serf is awesome for node membership management. I am interested in membership mgmt based on the health of a process on a member. Consul would be the way to go, IMO, but I wonder if anyone knows an implementation of that.
    Eric Anderson
    I've been playing with the Serf RPC API and when I query for members, the results I get back all make sense ... except that the Addr fields are all in some "raw" binary notation that I can't make sense of. Has anybody here seen anything similar?
    Frost Red Lee
    Hi guys, What is the difference between Serf.Create and Agent.Create? Which one should I use?
    Dan Bent

    Hi serf team,

    Dan from CodeLingo here. Our @CodeLingoBot found some issues in serf and hashicorp/serf#540 to fix them. Is this useful? Would you like @CodeLingoBot to continue on and fix other issues it's found?

    Happy Coding!
    Dan & CodeLingo Team

    Nathan Dataguake Basanese
    Does Serf use the Raft protocol?
    Webert de Souza Lima
    @v6 yes
    I mean, its consensus protocol is based on raft
    Bjørn Borud
    are there any good, minimal examples of using serf as a library?

    I am trying to create APIs using terraform for cloud(azure/aws/google/others) communication. Let me elaborate it bit more with an example.

    I want to create a VM on azure and VM name to be input by user at runtime(like: from POSTMAN) from my API. Once user input the name of VM then it should call terraform behind the scene and create VM.

    I am looking to create above workflow . Kindly suggest.

    I'm seeing a decoder error on the serf agent when trying to send a Query request - [ERR] agent.ipc: Failed to evaluate request: decode fail
    ed: codec.decoder: Unhandled single-byte unsigned integer value: Unrecognized descriptor byte: aa. I'm not sure why. I've described the Query request as below in C#
    public class QueryRequestBody
    public List<string> FilterNodes;
        public Dictionary<string, string> FilterTags;
        public bool RequestAck;
        public ulong Timeout;
        public string Name;
        public byte[] Payload;
    Hello, I'm new here and trying to build Serf for the first time. I'm developing for Windows. After installing Go, MinGW, and the Serf repo, I try "make" and get an error telling me that only OSX is supported Can't setup interfaces on non-Mac. Error!. Is it possible to build for Windows on a Windows box, or will I need a Mac to do this?
    PS - specifically, I'm trying to build an Arm64 version for Windows. Thanks.
    Hows everyone doing
    hi community,
    serf is implemented in GO, right?
    could serf be used in a C++ program, i.e. is there a C++ binding available?
    Steven Tran
    hi, I am interested in using serf for failure detection in a large cluster (>10k nodes). Would serf be able to handle this kind of scale?
    Michael Aldridge
    @stetra yes, Serf has been proven in a very large cluster as part of the Nomad C1M exercise
    Michael Aldridge
    @brmarkus you could do what you want by making a small Go library that exposes the functionality you want and compiling it as a shared object, but I don't know of any go project actually that builds full bindings for another language
    Michael Aldridge
    Are there any docs for using serf effectively to build the backing datastore of an application? My max size for the entire store is 64M, which I think should be well within the gossip limits.
    For serf encryption/decryption using keyring file, Let's have we have Node1 , Node 2, Node 3 with primary key k1. Now Node 3 goes down.....In the meantime,,Node1 did (keygen,install,use) operations..So Node 1, Node 2 are with K2(Primary key),K1(Secondary key)....Now Node 3 comes up..1) will he able to decrypt the messages coming from Node 1/Node 2....2) How do we say serf supports one key can encrypt a message, but many keys can decrypt a message.