Redis3.2.5部署(單節點)
1.安裝jdk1.8
[root@sht-logstash-01 ~]# cd /usr/java/
[root@sht-logstash-01 java]# wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie"
[root@sht-logstash-01 java]# tar -zxvf jdk-8u111-linux-x64.tar.gz
[root@sht-logstash-01 java]# vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_111
export path=$JAVA_HOME/bin:$PATH
[root@sht-logstash-01 java]# source /etc/profile
[root@sht-logstash-01 java]# java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
[root@sht-logstash-01 java]#
2.安裝 redis 3.2.5
2.1 安裝編繹所需包gcc,tcl
[root@sht-logstash-01 local]# yum install gcc
[root@sht-logstash-01 local]# yum install tcl
2.2 下載redis-3.2.5
[root@sht-logstash-01 local]# wget
--2016-11-12 20:16:40--
Resolving download.redis.io (download.redis.io)... 109.74.203.151
Connecting to download.redis.io (download.redis.io)|109.74.203.151|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1544040 (1.5M) [application/x-gzip]
Saving to: ‘redis-3.2.5.tar.gz’
100%[==========================================================================================================================>] 1,544,040 221KB/s in 6.8s
2016-11-12 20:16:47 (221 KB/s) - ‘redis-3.2.5.tar.gz’ saved [1544040/1544040]
2.3 安裝redis
[root@sht-logstash-01 local]# mkdir /usr/local/redis
[root@sht-logstash-01 local]# tar xzvf redis-3.2.5.tar.gz
[root@sht-logstash-01 local]# cd redis-3.2.5
[root@sht-logstash-01 redis-3.2.5]# make PREFIX=/usr/local/redis install
[root@sht-logstash-01 redis-3.2.5]# cd ../
[root@sht-logstash-01 redis-3.2.5]# ll /usr/local/redis/bin/
total 15056
-rwxr-xr-x 1 root root 2431728 Nov 12 20:45 redis-benchmark
-rwxr-xr-x 1 root root 25165 Nov 12 20:45 redis-check-aof
-rwxr-xr-x 1 root root 5182191 Nov 12 20:45 redis-check-rdb
-rwxr-xr-x 1 root root 2584443 Nov 12 20:45 redis-cli
lrwxrwxrwx 1 root root 12 Nov 12 20:45 redis-sentinel -> redis-server
-rwxr-xr-x 1 root root 5182191 Nov 12 20:45 redis-server
2.4 配置redis為服務
[root@server redis-3.2.5]#cp utils/redis_init_script /etc/rc.d/init.d/redis
[root@server redis-3.2.5]#vi /etc/rc.d/init.d/redis
在第二行新增:#chkconfig: 2345 80 90
EXEC=/usr/local/bin/redis-server 修改成 EXEC=/usr/local/redis/bin/redis-server
CLIEXEC=/usr/local/bin/redis-cli 修改成 CLIEXEC=/usr/local/redis/bin/redis-cli
CONF="/etc/redis/${REDISPORT}.conf" 修改成 CONF="/usr/local/redis/conf/${REDISPORT}.conf"
$EXEC $CONF 修改成 $EXEC $CONF &
[root@server redis-3.2.5]#mkdir /usr/local/redis/conf/
[root@server redis-3.2.5]#chkconfig --add redis
[root@server redis-3.2.5]#cp redis.conf /usr/local/redis/conf/6379.conf
[root@server redis-3.2.5]#vi /usr/local/redis/conf/6379.conf
daemonize yes
pidfile /var/run/redis_6379.pid
bind 172.16.100.79
2.5 啟動redis
[root@server redis-3.2.5]# cd ../redis
[root@sht-logstash-01 redis]# service redis start
Starting Redis server...
[root@sht-logstash-01 redis]# netstat -tnlp|grep redis
tcp 0 0 172.16.100.79:6379 0.0.0.0:* LISTEN 30032/redis-server
[root@sht-logstash-01 redis]#
2.6 新增環境變數
[root@sht-logstash-01 redis]# vi /etc/profile
export REDIS_HOME=/usr/local/redis
export PATH=$REDIS_HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
[root@sht-logstash-01 redis]# source /etc/profile
[root@sht-logstash-01 redis]# which redis-cli
/usr/local/redis/bin/redis-cli
2.7 測試 和 設定密碼(本次實驗未設定密碼)
[root@sht-logstash-01 redis]# redis-cli -h sht-logstash-01
sht-logstash-01:6379>
sht-logstash-01:6379> set testkey testvalue
OK
sht-logstash-01:6379> get test
(nil)
sht-logstash-01:6379> get testkey
"testvalue"
sht-logstash-01:6379>
[root@sht-logstash-01 redis]# vi /usr/local/redis/conf/6379.conf
/*新增一個驗證密碼*/
requirepass 123456
[root@sht-logstash-01 redis]# service redis stop
[root@sht-logstash-01 redis]# service redis start
[root@sht-logstash-01 redis]# -h sht-logstash-01
sht-logstash-01:6379> set key ss
(error) NOAUTH Authentication required.
[root@server redis-3.2.5]# redis-cli -h sht-logstash-01 -a 123456
sht-logstash-01:6379> set a b
OK
sht-logstash-01:6379> get a
"b"
sht-logstash-01:6379> exit;
[root@sht-logstash-01 redis]#
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30089851/viewspace-2128609/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MongoDB單節點部署與基本操作MongoDB
- kubernetes環境部署單節點redisRedis
- Linux下NiFi 1.9.2部署(單節點)LinuxNifi
- zookeeper單節點和叢集部署與配置
- PinPoint單節點部署及客戶端配置方法客戶端
- ElasticSearch 7.6.2 單機部署三個節點 報錯Elasticsearch
- consul 多節點/單節點叢集搭建
- 如何部署Qtum量子鏈節點QT
- fabric多機多節點部署
- greenplum單節點安裝
- HAC叢集更改IP(單節點更改、全部節點更改)
- CentOS7 單節點和多節點 HPL測試CentOS
- kubernetes——二進位制多節點部署
- 使用devstack/pike部署多節點實驗dev
- ADAMoracle部署全球節點網路率先推出廣域節點報價系統Oracle
- Networker備份oracle單節點Oracle
- ElasticSearch(單節點)環境配置Elasticsearch
- vertica單節點安裝教程
- unix cm單節點啟動
- PG12.9-Repmgr5.1.0-vip-3節點部署
- Redis的安裝及建立節點、部署群集Redis
- mongo資料庫單節點搭建Go資料庫
- C# Redis分散式鎖 - 單節點C#Redis分散式
- Centos7.9 部署mongodb高可用叢集 3節點CentOSMongoDB
- 窮人也能用得起 K8s - VPS 單節點部署 Kubernetes 的方法與對比K8S
- 升級kubeadm 叢集(只有master單節點)AST
- hadoop叢集搭建——單節點(偽分散式)Hadoop分散式
- XML節點自動生成簡單例項XML單例
- ElasticSearch- 單節點 unassigned_shards 故障排查Elasticsearch
- 單連結串列-相鄰節點交還
- 淺入Kubernetes(10):控制節點的部署,選擇器、親和性、汙點
- JavaScript學習之DOM(節點、節點層級、節點操作)JavaScript
- 基於minikube快速搭建kubernetes單節點環境
- 單機Linux下搭建MongoDB副本集-三節點LinuxMongoDB
- 安裝 Hadoop:設定單節點 Hadoop 叢集Hadoop
- vertica單節點故障恢復 Startup Failed, ASR RequiredAIUI
- 簡單實現帶節點的進度條
- 全球部署70000+溫水水冷節點是什麼水平?
- Tungsten Fabric知識庫丨測試2000個vRouter節點部署VR