linux 安裝redis zookeeper
阿新 • • 發佈:2017-12-26
init client req c-c++ number direct .cn sna 復制配置
安裝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
啟動
[root@iZ28mgdqcyxZ 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
啟動,任何地方都可以啟動
[root@iZ28mgdqcyxZ conf]# zkServer.sh start
完成
linux 安裝redis zookeeper