Redis單機模式搭建__redis單擊模式搭建

來源:互聯網
上載者:User

Redis在3.0之前只有單機模式,並沒有叢集模式,所以這裡選擇2.8版本進行測試

搭建步驟:

1. 上傳解壓redis

 

root@hadoop01 ~]# mv redis-2.8.18 /opt/software/  (移動到軟體目錄好管理)

2. 下載gcc,tcl 命令編譯器 yum -y install gcc tcl (要使用redis伺服器必須得有一個叫做gcc的編譯器支援,還得有一個語言支援叫tcl)

 

3. 找到redis目錄下可以看到有個Makefile命令

(編譯、建立目錄、拷貝make && make PREFIX=/opt/software/redis install)

 

這個操作完成後,相當於把redis啟動程式拷貝到/opt/software/redis目錄下了

 

4. 配置redis環境變數

 

配置完記得重新載入

. /etc/profile

5. 安裝redis服務(/opt/software/redis-2.8.18/utils目錄下)

 

 Welcome to the redis service installer

This script will help you easily set up a running redis server

#  如果不用預設配置 , 需要手動輸入連接埠號碼 , 我們這裡就用預設連接埠 ,按 按 Enter

Please select the redis port for this instance: [6379]

Selecting default: 6379

#  選擇預設的設定檔的名稱 ,按 按 Enter , 使用別的路徑和名稱需要手動指定

Please select the redis config file name [/etc/redis/6379.conf]

Selected default - /etc/redis/6379.conf

#  日誌存放位置,處理同上

Please select the redis log file name [/var/log/redis_6379.log]

Selected default - /var/log/redis_6379.log

#  持久化資料目錄 ,處理同上

Please select the data directory for this instance [/var/lib/redis/6379]

Selected default - /var/lib/redis/6379

#  指定 redis  的命令執行路徑,因為已經在環境變數中配置過,這裡不再做處理

Please select the redis executable path [/opt/sxt/redis/bin/redis-server]

Selected config:

Port : 6379

Config file : /etc/redis/6379.conf

Log file : /var/log/redis_6379.log

Data dir : /var/lib/redis/6379

Executable : /opt/sxt/redis/bin/redis-server

Cli Executable : /opt/sxt/redis/bin/redis-cli

Is this ok? Then press ENTER to go on or Ctrl-C to abort. # Enter

Copied /tmp/6379.conf => /etc/init.d/redis_6379

Installing service...

Successfully added to chkconfig!

Successfully added to runlevels 345!

Starting Redis server...

Installation successful!

可以多次執行 install_server.sh 指令碼安裝不同連接埠下的 redis 服務

 6. 啟動redis用戶端

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.