December 2019
M T W T F S S
« Nov    
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Categories

WordPress Quotes

A successful man is one who can lay a firm foundation with the bricks others have thrown at him.
David Brinkley
December 2019
M T W T F S S
« Nov    
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Short Cuts

2012 SERVER (64)
2016 windows (9)
AIX (13)
Amazon (40)
Ansibile (19)
Apache (135)
Asterisk (2)
cassandra (2)
Centos (211)
Centos RHEL 7 (268)
chef (3)
cloud (2)
cluster (3)
Coherence (1)
DB2 (5)
DISK (25)
DNS (9)
Docker (30)
Eassy (11)
ELKS (1)
EXCHANGE (3)
Fedora (6)
ftp (5)
GIT (3)
GOD (2)
Grub (1)
Hacking (10)
Hadoop (6)
health (1)
horoscope (23)
Hyper-V (10)
IIS (15)
IPTABLES (15)
JAVA (7)
JBOSS (32)
jenkins (1)
Kubernetes (7)
Ldap (5)
Linux (188)
Linux Commands (166)
Load balancer (5)
mariadb (14)
Mongodb (4)
MQ Server (24)
MYSQL (84)
Nagios (5)
NaturalOil (13)
Nginx (35)
Ngix (1)
openldap (1)
Openstack (6)
Oracle (35)
Perl (3)
Postfix (19)
Postgresql (1)
PowerShell (2)
Python (3)
qmail (36)
Redis (12)
RHCE (28)
SCALEIO (1)
Security on Centos (29)
SFTP (1)
Shell (64)
Solaris (58)
Sql Server 2012 (4)
squid (3)
SSH (10)
SSL (14)
Storage (1)
swap (3)
TIPS on Linux (28)
tomcat (62)
Ubuntu (1)
Uncategorized (30)
Veritas (2)
vfabric (1)
VMware (28)
Weblogic (38)
Websphere (71)
Windows (19)
Windows Software (2)
wordpress (1)
ZIMBRA (17)

WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

Who's Online

24 visitors online now
6 guests, 18 bots, 0 members

Hit Counter provided by dental implants orange county

redis

Centos 6.8

cd /opt
wget http://download.redis.io/releases/redis-3.0.5.tar.gz
tar zxvf redis-3.0.5.tar.gz
cd redis-3.0.5
make && make install

mkdir /etc/redis
mkdir /var/log/redis
mkdir -p /data/redis
cd /opt/redis-3.0.5
cp redis.conf /etc/redis/7963.conf
vi /etc/redis/7963.conf

daemonize no
port 6379
logfile “”
pidfile /var/run/redis.pid
# requirepass foobared
dir ./
??
daemonize yes
port 7963
logfile “/var/log/redis/7963.log”
pidfile /var/run/redis_7963.pid
requirepass 9k3NgZq%gO!W7x-0y=LI
dir /data/redis

sed -i “s/daemonize no/daemonize yes/g” /etc/redis/7963.conf
sed -i “s/port 6379/port 7963/g” /etc/redis/7963.conf
sed -i “s/pidfile \/var\/run\/redis.pid/pidfile \/var\/run\/redis_7963.pid/g” /etc/redis/7963.conf
sed -i “s/logfile \”\”/logfile \”\/var\/log\/redis\/7963.log\”/g” /etc/redis/7963.conf
sed -i “s/# requirepass foobared/requirepass 9k3NgZq%gO!W7x-0y=LI/g” /etc/redis/7963.conf
sed -i “s/dir .\//dir \/data\/redis/g” /etc/redis/7963.conf

grep vm.overcommit_memory /etc/sysctl.conf

echo “vm.overcommit_memory = 1” >> /etc/sysctl.conf

sed -i “s/vm.overcommit_memory = 0/vm.overcommit_memory = 1/g” /etc/sysctl.conf

sysctl -p

cd /opt/redis-3.0.5
cp utils/redis_init_script /etc/init.d/redis
vi /etc/init.d/redis
vi /etc/init.d/redis
———————————–

# chkconfig: 2345 90 10
# description: Simple Redis init.d scrip
REDISPORT=6379
REDISPORT=7963

CONF=”/etc/redis/${REDISPORT}.conf”
PASS=`grep “requirepass ” $CONF | awk {print’$2′}`
$CLIEXEC -p $REDISPORT shutdown
if [ -z “$PASS” ]
then
$CLIEXEC -p $REDISPORT shutdown
else
$CLIEXEC -p $REDISPORT -a $PASS shutdown
fi

sed -i “1 a # chkconfig: 2345 90 10” /etc/init.d/redis
sed -i “2 a # description: Simple Redis init.d scrip” /etc/init.d/redis
sed -i “s/REDISPORT=6379/REDISPORT=7963/g” /etc/init.d/redis
sed -i $’13 a PASS=`grep “requirepass ” $CONF | awk {print\’$2\’}`’ /etc/init.d/redis
sed -i “s/PORT shutdown/PORT -a \$PASS shutdown/g” /etc/init.d/redis

Redis
chkconfig redis on
chkconfig –list redis
service redis start
service redis stop

CentOS 7 Redis

## RHEL/CentOS 7 64-Bit ##
wget http://dl.Fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
rpm -ivh epel-release-7-5.noarch.rpm

yum repolist

yum -y update
yum install redis php-pecl-redis
systemctl start redis-server.service
systemctl enable redis-server.service
systemctl is-active redis-server.service

phpRedisAdmin RedisWeb Redis

git clone https://github.com/ErikDubbelboer/phpRedisAdmin.git
cd phpRedisAdmin/includes
cp config.sample.inc.php config.inc.php

# nano config.inc.php
RedisAdmin???????Apache

### nano /etc/httpd/conf.d/redisadmin.conf
### Now add the following ###
#
# Web Interface for RedisAdmin
#


Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from

Alias /redisAdmin /downloads/phpRedisAdmin
Alias /redisadmin /downloads/phpRedisAdmin

### nano /scripts/redis-check.sh
#!/bin/bash
PS=$(which ps)
GREP=$(which grep)
WHEN=$(date +”%Y-%m-%d-%H:%M:%S”)
if ! $PS aux | $GREP “redis.conf” | $GREP -v grep 2>&1 > /dev/null; then
/etc/init.d/redis restart
echo ‘Restarted Redis @’ $WHEN
fi
#Check Second instance
if ! $PS aux | $GREP “redis2.conf” | $GREP -v grep 2>&1 > /dev/null; then
/etc/init.d/redis2 restart
echo ‘Restarted Redis2 @’ $WHEN
fi

chmod +x /scripts/redis-check.sh

### nano /var/spool/cron/root
*/3 * * * * /bin/bash /script/redis-check.sh >> /var/log/redis-check.log

http://www.linuxidc.com/Linux/2016-06/132687.htm

tar xf redis-3.0.7.tar.gz -C /usr/local
mv redis-3.0.7 redis
cd /usr/local
make
make install
cp utils/redis_init_script /etc/init.d/redis

vim /etc/init.d/redis
# chkconfig: 2345 88 45
chmod +x /etc/init.d/redis
chkconfig –add redis

vim /usr/local/redis/redis.conf
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
port 7001
logfile “redis_7001.log”
dir “/data/redis/7001”
appendonly yes #????aof

mkdir /etc/redis/{7001,7002} -pv
mkdir /data/redis/{7001,7002} -pv
mkdir /etc/redis/{7003,7004} -pv
mkdir /data/redis/{7003,7004} -pv
mkdir /etc/redis/{7005,7006} -pv
mkdir /data/redis/{7005,7006} -pv
cd /etc/redis

sed ‘s/6379/7001/g’ /usr/local/redis/redis.conf > /etc/redis/7001/redis.conf
sed ‘s/6379/7002/g’ /usr/local/redis/redis.conf > /etc/redis/7002/redis.conf
sed ‘s/6379/7003/g’ /usr/local/redis/redis.conf > /etc/redis/7003/redis.conf
sed ‘s/6379/7004/g’ /usr/local/redis/redis.conf > /etc/redis/7004/redis.conf
sed ‘s/6379/7005/g’ /usr/local/redis/redis.conf > /etc/redis/7005/redis.conf
sed ‘s/6379/7006/g’ /usr/local/redis/redis.conf > /etc/redis/7006/redis.conf

/usr/local/redis/src/redis-server /etc/redis/700[1-6]/redis.conf

yum -y install ruby rubygems

gem install redis

cp /usr/local/redis/src/redis-trib.rb /usr/bin/redis-trib

redis-trib create –replicas 1 192.168.130.242:7001 192.168.130.242:7002
192.168.130.243:7003 192.168.130.243:7004 192.168.130.244:7005 192.168.130.244:7006

Centos 6.8

cd /opt
wget http://download.redis.io/releases/redis-3.0.5.tar.gz
tar zxvf redis-3.0.5.tar.gz
cd redis-3.0.5
make && make install

mkdir /etc/redis
mkdir /var/log/redis
mkdir -p /data/redis
cd /opt/redis-3.0.5
cp redis.conf /etc/redis/7963.conf
vi /etc/redis/7963.conf

daemonize no
port 6379
logfile “”
pidfile /var/run/redis.pid
# requirepass foobared
dir ./
??
daemonize yes
port 7963
logfile “/var/log/redis/7963.log”
pidfile /var/run/redis_7963.pid
requirepass 9k3NgZq%gO!W7x-0y=LI
dir /data/redis

sed -i “s/daemonize no/daemonize yes/g” /etc/redis/7963.conf
sed -i “s/port 6379/port 7963/g” /etc/redis/7963.conf
sed -i “s/pidfile \/var\/run\/redis.pid/pidfile \/var\/run\/redis_7963.pid/g” /etc/redis/7963.conf
sed -i “s/logfile \”\”/logfile \”\/var\/log\/redis\/7963.log\”/g” /etc/redis/7963.conf
sed -i “s/# requirepass foobared/requirepass 9k3NgZq%gO!W7x-0y=LI/g” /etc/redis/7963.conf
sed -i “s/dir .\//dir \/data\/redis/g” /etc/redis/7963.conf

grep vm.overcommit_memory /etc/sysctl.conf

echo “vm.overcommit_memory = 1” >> /etc/sysctl.conf

sed -i “s/vm.overcommit_memory = 0/vm.overcommit_memory = 1/g” /etc/sysctl.conf

sysctl -p

cd /opt/redis-3.0.5
cp utils/redis_init_script /etc/init.d/redis
vi /etc/init.d/redis
vi /etc/init.d/redis
———————————–

# chkconfig: 2345 90 10
# description: Simple Redis init.d scrip
REDISPORT=6379
REDISPORT=7963

CONF=”/etc/redis/${REDISPORT}.conf”
PASS=`grep “requirepass ” $CONF | awk {print’$2′}`
$CLIEXEC -p $REDISPORT shutdown
if [ -z “$PASS” ]
then
$CLIEXEC -p $REDISPORT shutdown
else
$CLIEXEC -p $REDISPORT -a $PASS shutdown
fi

sed -i “1 a # chkconfig: 2345 90 10” /etc/init.d/redis
sed -i “2 a # description: Simple Redis init.d scrip” /etc/init.d/redis
sed -i “s/REDISPORT=6379/REDISPORT=7963/g” /etc/init.d/redis
sed -i $’13 a PASS=`grep “requirepass ” $CONF | awk {print\’$2\’}`’ /etc/init.d/redis
sed -i “s/PORT shutdown/PORT -a \$PASS shutdown/g” /etc/init.d/redis

Redis
chkconfig redis on
chkconfig –list redis
service redis start
service redis stop

CentOS 7 Redis

## RHEL/CentOS 7 64-Bit ##
wget http://dl.Fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
rpm -ivh epel-release-7-5.noarch.rpm

yum repolist

yum -y update
yum install redis php-pecl-redis
systemctl start redis-server.service
systemctl enable redis-server.service
systemctl is-active redis-server.service

phpRedisAdmin RedisWeb Redis

git clone https://github.com/ErikDubbelboer/phpRedisAdmin.git
cd phpRedisAdmin/includes
cp config.sample.inc.php config.inc.php

# nano config.inc.php
RedisAdmin???????Apache

### nano /etc/httpd/conf.d/redisadmin.conf
### Now add the following ###
#
# Web Interface for RedisAdmin
#


Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from

Alias /redisAdmin /downloads/phpRedisAdmin
Alias /redisadmin /downloads/phpRedisAdmin

### nano /scripts/redis-check.sh
#!/bin/bash
PS=$(which ps)
GREP=$(which grep)
WHEN=$(date +”%Y-%m-%d-%H:%M:%S”)
if ! $PS aux | $GREP “redis.conf” | $GREP -v grep 2>&1 > /dev/null; then
/etc/init.d/redis restart
echo ‘Restarted Redis @’ $WHEN
fi
#Check Second instance
if ! $PS aux | $GREP “redis2.conf” | $GREP -v grep 2>&1 > /dev/null; then
/etc/init.d/redis2 restart
echo ‘Restarted Redis2 @’ $WHEN
fi

chmod +x /scripts/redis-check.sh

### nano /var/spool/cron/root
*/3 * * * * /bin/bash /script/redis-check.sh >> /var/log/redis-check.log

http://www.linuxidc.com/Linux/2016-06/132687.htm

tar xf redis-3.0.7.tar.gz -C /usr/local
mv redis-3.0.7 redis
cd /usr/local
make
make install
cp utils/redis_init_script /etc/init.d/redis

vim /etc/init.d/redis
# chkconfig: 2345 88 45
chmod +x /etc/init.d/redis
chkconfig –add redis

vim /usr/local/redis/redis.conf
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
port 7001
logfile “redis_7001.log”
dir “/data/redis/7001”
appendonly yes #????aof

mkdir /etc/redis/{7001,7002} -pv
mkdir /data/redis/{7001,7002} -pv
mkdir /etc/redis/{7003,7004} -pv
mkdir /data/redis/{7003,7004} -pv
mkdir /etc/redis/{7005,7006} -pv
mkdir /data/redis/{7005,7006} -pv
cd /etc/redis

sed ‘s/6379/7001/g’ /usr/local/redis/redis.conf > /etc/redis/7001/redis.conf
sed ‘s/6379/7002/g’ /usr/local/redis/redis.conf > /etc/redis/7002/redis.conf
sed ‘s/6379/7003/g’ /usr/local/redis/redis.conf > /etc/redis/7003/redis.conf
sed ‘s/6379/7004/g’ /usr/local/redis/redis.conf > /etc/redis/7004/redis.conf
sed ‘s/6379/7005/g’ /usr/local/redis/redis.conf > /etc/redis/7005/redis.conf
sed ‘s/6379/7006/g’ /usr/local/redis/redis.conf > /etc/redis/7006/redis.conf

/usr/local/redis/src/redis-server /etc/redis/700[1-6]/redis.conf

yum -y install ruby rubygems

gem install redis

cp /usr/local/redis/src/redis-trib.rb /usr/bin/redis-trib

redis-trib create –replicas 1 192.168.130.242:7001 192.168.130.242:7002
192.168.130.243:7003 192.168.130.243:7004 192.168.130.244:7005 192.168.130.244:7006

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

Blue Captcha Image
Refresh

*

Protected by WP Anti Spam