GithubHelp home page GithubHelp logo

Comments (4)

whitfin avatar whitfin commented on June 23, 2024

@Sotorin I believe the problem is that your first call needs to declare a nodes key rather than what you're currently using. All nodes should really declare all nodes they expect to talk to.

So in both terminals you would start with the same call to:

Cachex.start_link([ name: :my_cache, nodes: [ :one@Artur, :two@Artur ] ])

Please can you see if this works?

Cachex.add_node/2 is really only for internal use as it will erase other nodes, so you should be careful. If you declare your nodes at startup this is no longer and issue as they're already empty when connecting.

Also, you don't have to connect the nodes yourself, Cachex will take care of that for you :)

from cachex.

Sotorin avatar Sotorin commented on June 23, 2024

@zackehh - Yeah, this worked like a charm! Thank you very much! I was only running it from IEx as part of getting familiar with the library. Ultimately it will be used in a Phoenix app, which will be deployed in distributed environment with intent of having users share the cache regardless of which node they actually connect to. Multi-Layered caching will be the next feature I'll experiment with, looks really cool.

I was using Cachex.add_node/2 because I couldn't connect it using Cachex.start_link and thus my original post. I'll use the same config settings in my Phoenix app and try testing in distributed setup. Normally I have to connect the nodes for Phoenix Pub/Sub to work but if Cachex will do it for me then there will be one less thing to worry about. Thanks again, great job!

screen shot 2016-04-27 at 7 34 42 pm

screen shot 2016-04-27 at 7 34 58 pm

from cachex.

whitfin avatar whitfin commented on June 23, 2024

@Sotorin glad to help :) Adding a node is a very manual way to go about it - such as if you ssh into the remote console on the node because you have a new physical node to add. Usually you'll just want to define them up front - even if they don't exist yet, it'll connect properly when they spin up.

from cachex.

whitfin avatar whitfin commented on June 23, 2024

For what it's worth, I added a commit 8660da1 which will add a bit more info if you try and replicate using add_node/2 and it doesn't work.

from cachex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.