解壓redis檔案
tar -zxvf redis-5.0.5.tar.gz
安裝gcc依賴
yum install gcc
進入redis
cd redis-5.0.5
安裝和編譯
make && make install
闖進redis目錄
mkdir /usr/local/redis
把redis.conf 複製到/usr/local/redis 目錄下
cp redis.conf /usr/local/redis
把redis指令碼複製到
cp redis_init_script /etc/init.d/
新增讀寫許可權
chmod 777 redis_init_script
vim redis_init_script 編輯指令碼
-a 123456 仔細看到這段 這段是redis密碼
#!/bin/sh
## ****** redis init.d script conceived to work on linux systems
# as it does use of the /proc filesystem.
### begin init info
# provides: redis_6379
# default-start: 2 3 4 5
# default-stop: 0 1 6
# short-description: redis data structure server
# description: redis data structure server. see
### end init info##
redisport=6379
exec=/usr/local/bin/redis-server
cliexec=/usr/local/bin/redis-cli
pidfile=/var/run/redis_$.pid
conf="/usr/local/redis/redis.conf" #redis配置檔案位址 所在
case "$1" in
start)
if [ -f $pidfile ]
then
echo "$pidfile exists, process is already running or crashed"
else
echo "starting redis server..."
$exec $conf
fi;;
stop)
if [ ! -f $pidfile ]
then
echo "$pidfile does not exist, process is not running"
else
pid=$(cat $pidfile)
echo "stopping ..."
$cliexec -a 123456-p $redisport shutdown
while [ -x /proc/$ ]
doecho "waiting for redis to shutdown ..."
sleep 1
done
echo "redis stopped"
fi;;
*)echo "please use start or stop as first argument"
;;esac
建立備份檔案路徑
mkdir /usr/local/redis/working
在進入redis檔案下,編輯redis配置檔案 找到以下引數 進行修改
cd /usr/local/redis
vim redis.conf
dir /usr/local/redis/working #備份路徑
daemonize yes #後台程序啟動
bind 0.0.0.0 #所有ip
requirepass 123456 #設定密碼
進入
cd /etc/init.d/
然後設定開機自啟
chkconfig redis_init_script on
啟動redis
./redis_init_script start
啟動成功
檢視程序
centos 安裝jenkins rpm安裝
sudo rpm ih jenkins 2.73.2 1.1.noarch.rpm 自動安裝完成之後 usr lib jenkins jenkins.war war包 etc sysconfig jenkins 配置檔案,指定埠 var lib jenkins 預設的jenkins home目錄 v...
硬碟安裝CentOS
2.將 centos 的第乙個 iso 檔案裡的 vmlinuz 和 initrd.img 提取出來。我將提取出來的檔案放在我的第二塊硬碟的第乙個分割槽上 g 3.修改 c boot.ini 檔案,在 operating systems 區域加入一行 c grldr grub 如果要在 boot l...
centos安裝準備
centos安裝vmware tools step1 mount dev cdrom mnt step2 tar zxpf vmwaretools 5.5.51 19173.tar.gz step3 進入解壓目錄,執行 vmware install.pl命令,然後一直按回車 注 可加linux.is...