2. sudo mkdir /usr/local/nutcracker
3. git clone https://github.com/twitter/twemproxy.git
4. cd twemproxy/
5. suo autoreconf -fvi
6. sudo ./configure --enable-debug=log --prefix=/usr/local/nutcracker
7. sudo make install
8. sudo mkdir /usr/local/nutcracker/conf/
9. sudo vi /usr/local/nutcracker/conf/nutcracker.yml
alpha:
listen: 10.10.46.2:22121
hash: fnv1a_64
# distribution: ketama
distribution: random
auto_eject_hosts: true
redis: true
server_retry_timeout: 2000
server_failure_limit: 1
servers:
- redis.server:6379:1
- 10.10.46.3:6379:1
- 10.10.46.4:6379:1
10 sudo /usr/local/nutcracker/sbin/nutcracker -t -c /usr/local/nutcracker/conf/nutcracker.yml
11. vi ~/run.sh
sudo /usr/local/nutcracker/sbin/nutcracker \
-c /usr/local/nutcracker/conf/nutcracker.yml \
-d \
-o /var/log/nutcracker.log \
-p /var/run/nutcracker.pid
13. sh run.sh
14. sudo /usr/local/nutcracker/sbin/nutcracker --describe-stats
15. wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 -O jq
16. sudo chmod +x jq | mv jq /usr/local/bin
17. telnet 127.0.0.1 22222 2> /dev/null | tail -n 1 | jq '.'
18. tail -f /var/log/nutcracker.log
19. redis-cli -h 10.10.46.2 -p set V_2491871485 Hello
20. redis-cli -h 10.10.46.2 -p get V_2491871485
No comments:
Post a Comment