安装redis:
安装的前提条件:
需要安装gcc:yum install gcc-c++
wget http://download.redis.io/releases/redis-3.2.8.tar.gz tar -zxvf redis-3.2.8.tar.gz cd redis-3.2.8 #安装目录 make install PREFIX=/usr/local/redis 如提示make无效需要安装gcc 安装完成
复制配置文件redis.conf 到安装目录
修改配置文件
daemonize yes 后台启动
requirepass redis 设置密码为redis
启动
[[email protected] bin]# ./redis-server redis.conf
安装zookeeper
安装之前要安装jdk 略
wget http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.3.6/zookeeper-3.3.6.tar.gz #解压 tar -zxvf zookeeper-3.3.6.tar.gz cd zookeeper-3.3.6/conf 拷贝zoo_samle.cfg为zoo.cfg cp zoo_samle.cfg zoo.cfg vi zoo.cfg
# The number of milliseconds of each tick tickTime=2000 # The number of ticks that the initial # synchronization phase can take initLimit=10 # The number of ticks that can pass between # sending a request and getting an acknowledgement syncLimit=5 # the directory where the snapshot is stored. dataDir=/mnt/disk/word/children/zookeeper-3.3.6/data dataLogDir=/mnt/disk/word/children/zookeeper-3.3.6/logs # the port at which the clients will connect clientPort=2181
设置环境变量
vi /etc/profile
#zookeeper export ZOOKEEPER_HOME=/mnt/disk/word/children/zookeeper-3.3.6 export PATH=$PATH:$ZOOKEEPER_HOME/bin
使环境变量生效
source /etc/profile
启动,任何地方都可以启动
[[email protected] conf]# zkServer.sh start
完成
原文地址:https://www.cnblogs.com/chuanwazi/p/8119563.html
时间: 2024-10-09 01:50:47