1. 程式人生 > >centos7 redis分散式叢集問題總結

centos7 redis分散式叢集問題總結

使用的包

http://download.redis.io/releases/redis-4.0.11.tar.gz

https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.3.tar.gz

https://rubygems.org/rubygems/rubygems-2.7.7.tgz

https://rubygems.org/downloads/redis-4.0.1.gem

環境部署步驟參照我之前的部落格

步驟已做完:

redis編譯安裝完成,服務已啟動

ruby編譯安裝完成

因為建立叢集需要gem的支援

如果連外網的請款下直接執行gem install redis就可以了,但是我的是內網環境

# tar -zxf rubygems-2.7.7.tgz

# cd rubygems-2.7.7

# ruby setup.rb

報錯:

/data/packages/rubygems-2.7.7/lib/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- zlib (LoadError)

解決zlib問題:

# yum install zlib zlib-devel

# cd ruby-2.5.3/

# cd ext/

# cd zlib/

# ruby extconf.rb

# make

make: *** No rule to make target `/include/ruby.h', needed by `zlib.o'.  Stop.

# vi Makefile

zlib.o: $(top_srcdir)/include/ruby.h

>>

zlib.o: ../../include/ruby.h

# make && make install

# ruby setup.rb

zlib問題解決

# gem install redis-4.0.1.gem

ERROR:  While executing gem ... (Gem::Exception)

    Unable to require openssl, install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources

解決openssl問題

# yum install openssl openssl-devel

# cd ruby-2.5.3/

# cd ext/

# cd openssl/

# ruby extconf.rb

# make

make: *** No rule to make target `/include/ruby.h', needed by `ossl.o'.  Stop.

這裡要修改的地方太多,直接替換

# vi Makefile

:1,1457 s #$(top_srcdir)#../..

1457是最後的行號,具體按實際做

# make && make install

參考:

https://blog.csdn.net/xiyujianxia/article/details/79773743

https://blog.csdn.net/zhengwei125/article/details/80019887