1.安装ruby
yum install -y ruby yum install -y ruby-devel yum install -y rubygems
2.替换rubygems源
gem sources --add https://ruby.taobao.org/ --remove http://rubygems.org/ gem sources -l
3.安装redis-stat
Git clone https://github.com/junegunn/redis-stat.git gem install redis-stat
会提示 Building native extensions. This could take a while...
Building native extensions. This could take a while... Building native extensions. This could take a while... ERROR: Error installing redis-stat: redis-stat requires daemons (~> 1.1.9, runtime) 卸载daemonsgem uninstall daemons gem install daemons gem install redis-stat cd /usr/redis-stat/bin ./redis-stat 1
再次报错: ERROR: Error installing redis-stat:
redis-stat requires daemons (~> 1.1.9, runtime) 说明安装了两个daemons,需要卸掉一个:gem uninstall daemons Select gem to uninstall: 1. daemons-1.1.9 2. daemons-1.2.3 3. All versions> 2 //<=========卸载daemons-1.2.3Successfully uninstalled daemons-1.2.3
再启动redis-stat
./redis-stat 1
报错:Faraday: you may want to install system_timer for reliable timeouts 说明需要安装SystemTimer
gem install SystemTimer
然后报错/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found之类的东西 说明gcc安装后库还没有升级
运行
strings /usr/lib64/libstdc++.so.6 | grep GLIBC
出现: GLIBCXX3.4 GLIBCXX3.4.1
GLIBCXX3.4.2 GLIBCXX3.4.3 GLIBCXX3.4.4 GLIBCXX3.4.5 GLIBCXX3.4.6 GLIBCXX3.4.7 GLIBCXX3.4.8 GLIBCXX3.4.9 GLIBCXX3.4.10 GLIBCXX3.4.11 GLIBCXX3.4.12 GLIBCXX3.4.13 GLIBCXXFORCENEW GLIBCXXDEBUGMESSAGE_LENGTH明显没有GLIBCXX_3.4.21库文件 执行以下命令,查找编译gcc时生成的最新动态库:
find / -name "libstdc++.so*"
我选择了/mydata/soft/gcc-build-5.3.0/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.21
,有什么讲究具体不清楚 把这个文件复制到/usr/lib64/文件夹里
gem install SystemTimer
然后重定向软链接:
strings /usr/lib64/libstdc++.so.6 | grep GLIBC
然后再strings /usr/lib64/libstdc++.so.6 | grep GLIBC
GLIBCXX3.4 GLIBCXX3.4.1
GLIBCXX3.4.2 GLIBCXX3.4.3 GLIBCXX3.4.4 GLIBCXX3.4.5 GLIBCXX3.4.6 GLIBCXX3.4.7 GLIBCXX3.4.8 GLIBCXX3.4.9 GLIBCXX3.4.10 GLIBCXX3.4.11 GLIBCXX3.4.12 GLIBCXX3.4.13 GLIBCXX3.4.14 GLIBCXX3.4.15 GLIBCXX3.4.16 GLIBCXX3.4.17 GLIBCXX3.4.18 GLIBCXX3.4.19 GLIBCXX3.4.20 GLIBCXX3.4.21 GLIBC2.3 GLIBC2.2.5 GLIBC_2.3.2 GLIBCXX_FORCE_NEW GLIBCXX_DEBUG_MESSAGE_LENGTH就有新库文件了
最后重启redis-stat 1 auth
,成功