Linux(ubuntu)下安装Redis:
wget https://redis.googlecode.com/files/redis-2.6.13.tar.gz
tar -xvzf redis-2.6.13.tar.gz
cd redis-2.6.13
sudo make
sudo make install
sudo cp redis.conf /usr/local/bin
cd /usr/local/bin
修改/usr/local/bin/redis.conf
redis-server redis.conf
配置主从同步
1.复制redis.conf到从机
2.分别修改bind ip地址
3.修改从机slaveof 配置
4.启动从机redis
监控
redis-benchmark -c 100 -n 100000(connection & number)
redis-cli monitor
redis-cli info
安装phpredis
wget https://github.com/owlient/phpredis.git
cd phpredis
phpize ./configure(或phpize ./configure --with-php-config=/usr/local/php/bin/php-config)
make && make install

 

修改php.ini,加载redis.so组件

Post Navigation