Awesome! Building Redis source code in parallel across 4 Linux servers can dramatically speed up compilation, especially on lower-power machines. Redis is a C-based project that uses a Makefile, so it works great with distributed compilation tools like distcc.
- You have 4 Linux servers:
192.168.1.101to192.168.1.104 - You want to build Redis on the main node (
192.168.1.101), using the CPU power of all 4 nodes - All nodes are in a trusted local network
- You want to compile Redis source code (from https://github.com/redis/redis)
distcc: For distributed compilationgcc/make: Already needed for Redis buildrsync(optional): For code syncing if needed
Run this on all 4 servers:
sudo apt update
sudo apt install distcc gcc g++ make -yOn each worker node:
- Allow the master IP (
192.168.1.101) in the config (optional):
sudo nano /etc/distcc/hostsAdd:
192.168.1.101
- Start the
distccdaemon:
sudo distccd --daemon --allow 192.168.1.101 --log-level infoYou can also make it start on boot if you want:
sudo systemctl enable distccgit clone https://github.com/redis/redis.git
cd redisexport DISTCC_HOSTS="192.168.1.102 192.168.1.103 192.168.1.104"
export CC="distcc gcc"
export CXX="distcc g++"You can also add this to .bashrc or a build script.
make -j16-j16: Run 16 compilation jobs in parallel (adjust based on total cores across your 4 servers).
src/redis-server --versionThis will show the Redis version if it compiled successfully.
-
If
distccis not working, try compiling with logging:export DISTCC_LOG=/tmp/distcc.logCheck
/tmp/distcc.logfor errors. -
You can monitor distcc activity with:
distccmon-text 1
Would you like a Bash script to:
- Set up distcc across the nodes
- Trigger compilation
- Monitor progress
Let me know — I can generate that for your exact IPs.