已在/etc/riak安装Riak KV 2.2.0,如何在同一主机装另一版本?
Alright, let's tackle installing a second Riak KV instance alongside your existing 2.2.0 on that CentOS 6 system. I’ve broken this down into clear, actionable steps tailored to your setup:
1. Pre-requisites & Planning
- First, decide which Riak KV version you want to install (pick one compatible with CentOS 6 x86_64, since your system runs the 2.6.32 kernel).
- Choose a separate installation directory to avoid overwriting your existing
/etc/riaksetup — I recommend something like/opt/riak-[VERSION](e.g.,/opt/riak-2.1.4) for clarity.
2. Install the Second Riak Instance
- Download the RPM package for your target Riak version (make sure it’s built for CentOS 6 x86_64).
- Install it to your custom directory using the
--prefixflag withrpm— this ensures no overlap with your existing 2.2.0 installation:
Replacerpm -ivh --prefix=/opt/riak-2.1.4 riak-[TARGET_VERSION]-1.el6.x86_64.rpm[TARGET_VERSION]with your chosen version number (e.g.,2.1.4).
3. Configure the New Instance to Avoid Conflicts
This is critical — if you skip this, the two instances will fight over ports, data directories, and resources. Head to the new instance’s config directory:
cd /opt/riak-2.1.4/etc/riak
Edit the riak.conf file (Riak 2.x uses this by default) and update these key settings:
- Node Name: Change it to something unique (your existing instance is likely
riak@127.0.0.1):nodename = riak2@127.0.0.1 - Ports: Update all network ports to avoid collisions:
http.port = 8099 # Default is 8098 (used by your 2.2.0 instance) pb.port = 8088 # Default is 8087 handoff.port = 8100 # Default is 8099 cluster_mgr.port = 9081 # Default is 9080 - Data & Log Directories: Point them to the new instance’s directory to keep data isolated:
platform_data_dir = /opt/riak-2.1.4/data platform_log_dir = /opt/riak-2.1.4/log - Erlang Cookie (Optional): If you want to cluster the two instances together, set this to match your existing instance’s cookie (check
/etc/riak/riak.conffordistributed_cookie). If you just want separate standalone instances, you can leave it as is.
4. Start & Verify Both Instances
- To start the new instance:
/opt/riak-2.1.4/bin/riak start - Check its status to confirm it’s running:
/opt/riak-2.1.4/bin/riak status - Your original 2.2.0 instance will continue to work as normal using the standard
riak start/statuscommands.
Pro Tips
- Create a shell alias for the new instance to save typing:
Now you can runecho "alias riak2='/opt/riak-2.1.4/bin/riak'" >> ~/.bashrc source ~/.bashrcriak2 statusinstead of the full path. - If you need external access to the new instance, update your CentOS 6 firewall to allow traffic on the new ports (8099, 8088, etc.).
内容的提问来源于stack exchange,提问作者Алексей Сидорин
相关产品推荐
相关产品推荐

