By default, Memcached uses port 11211 for both TCP and UDP protocols. This can be changed by modifying the Memcached configuration file and specifying a different port number.
Here's an example of how to start a Memcached instance on port 11212 using the memcached
command-line tool:
memcached -p 11212
To verify that Memcached is listening on the correct port, you can use the netstat
command:
netstat -tln | grep 11212
This should display a line similar to the following if Memcached is running and listening on port 11212:
tcp 0 0 0.0.0.0:11212 0.0.0.0:* LISTEN
It's worth noting that some hosting providers may block certain ports for security reasons, so it's always a good idea to check with your hosting provider if you're having trouble connecting to Memcached.
Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement.