wtuyss 发表于 2016-12-18 06:03:42

redis服务器安装使用

  1  wget http://download.redis.io/releases/redis-2.8.12.tar.gz
  tar xzf redis-2.8.12.tar.gz
  cd redis-2.8.12
  make 
  2 可能会报错: 
  jemalloc/jemalloc.h: No such file or directory
  解决办法是: make MALLOC=libc
  如果不能用则清理一下:make distclean
  3 提供提示 Hint: To run 'make test' is a good idea 
  则:运行make test  去测试一下,
  4 测试可能报错:You need 'tclsh8.5' in order to run the Redis test
  则安装tcl8.5 接口 
  5 test 没问题后 用:make install 出现以下提示,没有错误,则安装成功
  Hint: To run 'make test' is a good idea ;)
  INSTALL install
  INSTALL install
  INSTALL install
  INSTALL install
  INSTALL install
  make: Leaving directory `/opt/soft/redis-2.8.12/src'
  6 在utils目录中有install_server.sh 执行 ./install_server 安装服务
  Port           : 6379
  Config file    : /etc/redis/6379.conf
  Log file       : /var/log/redis_6379.log
  Data dir       : /var/lib/redis/6379
  Executable     : /usr/local/bin/redis-server
  Cli Executable : /usr/local/bin/redis-cli
  Is this ok? Then press ENTER to go on or Ctrl-C to abort.
  Copied /tmp/6379.conf => /etc/init.d/redis_6379 
  7 启动服务,进入执行文件目录/usr/local/bin/ 
  ./redis-server /etc/redis/6379.conf 
  8 查看服务器是否已经启动 
  ps -ef | grep redis 出现以下则服务正在启动 
  0:00:00 /usr/local/bin/redis-server *:6379   
  9 service redis start 启动
  service redis stop  停止 
  或 关闭某个端口上的服务:redis-cli -p port shutdown 
  或: 启动某个配置的服务:redis-server /etc/redis.conf 
  10 启动使用 ./usr/local/bin/redis-cli
页: [1]
查看完整版本: redis服务器安装使用