Linux下软件环境安装(9)-Redis安装与配置

wget http://download.redis.io/releases/redis-stable.tar.gz
tar xzf redis-stable.tar.gz
cd redis-stable

sudo apt-get install make gcc

make
src/redis-server --protected-mode no &
src/redis-cli
#./redis-cli -h x.17.0.10 -p 6379

sudo bash -c 'echo never > /sys/kernel/mm/transparent_hugepage/enabled'

echo "vm.overcommit_memory=1" > /etc/sysctl.conf
echo 2048 > /proc/sys/net/core/somaxconn

在/etc/sysctl.conf中添加如下
vm.overcommit_memory = 1
net.core.somaxconn = 2048
然后在终端中执行
sudo sysctl -p

sudo vi /etc/rc.local
#!/bin/sh -e

rc.local

This script is executed at the end of each multiuser runlevel.

Make sure that the script will "exit 0" on success or any other

value on error.

In order to enable or disable this script just change the execution

bits.

By default this script does nothing.

echo never > /sys/kernel/mm/transparent_hugepage/enabled

exit 0

sudo chown root:root /etc/rc.local
sudo chmod 755 /etc/rc.local
sudo systemctl enable rc-local.service

标签: none

添加新评论