Redis配置


一.安装

# yum -y install gcc

# tar -zxvf redis-6.2.5.tar.gz

# cd redis-6.2.5

# make 

#  make install                # 默认位置:/usr/local/bin

# cd /usr/local/bin

# cp ./redis-6.2.5/redis.conf /usr/local/bin

# ./redis-server redis.conf

# firewalld -cmd --add-port=6379/tcp --permanent

# firewalld -cmd --reload

二.配置

# cd /usr/local/bin

# ./redis-cli -h ip -p port -a password

127.0.0.1:6379>

>set name shiyu

>get name

>set count 100

# vi redis.conf

/bind

 # ./redis.server redis.conf

# ps aux | grep redis

# netstat -ano | grep 6379

三.主从复制