11【線上日誌分析】之redis-3.2.5 install(單節點)
1.安裝jdk1.8
[root@sht-sgmhadoopdn-04 ~]# cd /usr/java/
[root@sht-sgmhadoopdn-04 java]# wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie"
[root@sht-sgmhadoopdn-04 java]# tar -zxvf jdk-8u111-linux-x64.tar.gz
[root@sht-sgmhadoopdn-04 java]# vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_111
export path=$JAVA_HOME/bin:$PATH
[root@sht-sgmhadoopdn-04 java]# source /etc/profile
[root@sht-sgmhadoopdn-04 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-sgmhadoopdn-04 java]#
2.安裝 redis 3.2.5
2.1 安裝編繹所需包gcc,tcl
[root@sht-sgmhadoopdn-04 local]# yum install gcc
[root@sht-sgmhadoopdn-04 local]# yum install tcl
2.2 下載redis-3.2.5
[root@sht-sgmhadoopdn-04 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-sgmhadoopdn-04 local]# mkdir /usr/local/redis
[root@sht-sgmhadoopdn-04 local]# tar xzvf redis-3.2.5.tar.gz
[root@sht-sgmhadoopdn-04 local]# cd redis-3.2.5
[root@sht-sgmhadoopdn-04 redis-3.2.5]# make PREFIX=/usr/local/redis install
[root@sht-sgmhadoopdn-04 redis-3.2.5]# cd ../
[root@sht-sgmhadoopdn-04 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.101.66
2.5 啟動redis
[root@server redis-3.2.5]# cd ../redis
[root@sht-sgmhadoopdn-04 redis]# service redis start
Starting Redis server...
[root@sht-sgmhadoopdn-04 redis]# netstat -tnlp|grep redis
tcp 0 0 172.16.100.79:6379 0.0.0.0:* LISTEN 30032/redis-server
[root@sht-sgmhadoopdn-04 redis]#
2.6 新增環境變數
[root@sht-sgmhadoopdn-04 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-sgmhadoopdn-04 redis]# source /etc/profile
[root@sht-sgmhadoopdn-04 redis]# which redis-cli
/usr/local/redis/bin/redis-cli
2.7 測試 和 設定密碼(本次實驗未設定密碼)
[root@sht-sgmhadoopdn-04 redis]# redis-cli -h sht-sgmhadoopdn-04
sht-sgmhadoopdn-04:6379>
sht-sgmhadoopdn-04:6379> set testkey testvalue
OK
sht-sgmhadoopdn-04:6379> get test
(nil)
sht-sgmhadoopdn-04:6379> get testkey
"testvalue"
sht-sgmhadoopdn-04:6379>
[root@sht-sgmhadoopdn-04 redis]# vi /usr/local/redis/conf/6379.conf
/*新增一個驗證密碼*/
requirepass 123456
[root@sht-sgmhadoopdn-04 redis]# service redis stop
[root@sht-sgmhadoopdn-04 redis]# service redis start
[root@sht-sgmhadoopdn-04 redis]# redis-cli -h sht-sgmhadoopdn-04
sht-sgmhadoopdn-04:6379> set key ss
(error) NOAUTH Authentication required.
[root@server redis-3.2.5]# redis-cli -h sht-sgmhadoopdn-04 -a 123456
sht-sgmhadoopdn-04:6379> set a b
OK
sht-sgmhadoopdn-04:6379> get a
"b"
sht-sgmhadoopdn-04:6379> exit;
[root@sht-sgmhadoopdn-04 redis]#
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30089851/viewspace-2132446/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 08【線上日誌分析】之Flume Agent(聚合節點) sink to kafka clusterKafka
- 節點2線上日誌生成歸檔日誌在節點1上的初步分析
- 16【線上日誌分析】之grafana-4.1.1 Install和新建日誌分析的DashBoardGrafana
- 06【線上日誌分析】之KafkaOffsetMonitor監控工具的搭建Kafka
- 18【線上日誌分析】之Spark on Yarn配置日誌Web UI(HistoryServer服務)SparkYarnWebUIServer
- 05【線上日誌分析】之Kafka 0.10.1.0 Cluster的搭建和Topic簡單操作實驗Kafka
- 22【線上日誌分析】之專案第二階段概述
- 00【線上日誌分析】之專案概述和GitHub專案地址Github
- 17【線上日誌分析】之使用IDEA將工程Build成jar包IdeaUIJAR
- 收集、分析線上日誌資料實戰——ELK
- 12【線上日誌分析】之RedisLive監控工具的詳細安裝Redis
- 19【線上日誌分析】之sparkdemo.jar執行在yarn上過程SparkJARYarn
- 【REDO】Oracle 日誌挖掘,分析歸檔日誌線上日誌主要步驟Oracle
- oracle 11g rac新增節點前之清除節點資訊Oracle
- Oracle 線上日誌管理Oracle
- 線上日誌損壞
- oracle11g單節點DataGuard搭建Oracle
- 24【線上日誌分析】之Tomcat的支援log4j,日誌輸出為json格式TomcatJSON
- 23【線上日誌分析】之改造CDH的HDFS的NN,DN程式,日誌輸出為json格式JSON
- oracle11g單節點DGbroker搭建Oracle
- 非線上日誌丟失
- RAC 線上日誌的管理
- RAC節點之間通訊問題 兩節點 11g RAC
- oracle效能調優:管理oracle日誌之調整線上日誌檔案Oracle
- 10【線上日誌分析】之基於Spark Streaming開發OnLineLogAanlysis1Spark
- 04【線上日誌分析】之Flume Agent的3臺收集+1臺聚合到hdfs的搭建
- oracle11GR2 RAC節點crash故障分析Oracle
- 【Mongodb】 replica set 兩種新增節點方法的日誌分析MongoDB
- rhel6.4-11.2.0.3-RAC搭建單節點DG
- RAC 雙節點 轉單節點流程
- 07【線上日誌分析】之kafka-manager監控工具的搭建(sbt安裝與編譯)Kafka編譯
- redis之 centos 6.7 下安裝 redis-3.2.5RedisCentOS
- 09【線上日誌分析】之基於Spark Streaming Direct方式的WordCount最詳細案例(java版)SparkJava
- 02【線上日誌分析】之基於Flume-ng Exec Source開發自定義外掛AdvancedExecSource
- JavaScript學習之DOM(節點、節點層級、節點操作)JavaScript
- consul 多節點/單節點叢集搭建
- 03【線上日誌分析】之hadoop-2.7.3編譯和搭建叢集環境(HDFS HA,Yarn HA)Hadoop編譯Yarn
- 20【線上日誌分析】之記錄一次Spark Streaming+Spark SQL的資料傾斜SparkSQL