最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Linux安裝Redis實(shí)現(xiàn)過(guò)程及報(bào)錯(cuò)解決方案

 更新時(shí)間:2020年08月28日 10:15:03   作者:shookm  
這篇文章主要介紹了Linux安裝Redis實(shí)現(xiàn)過(guò)程及報(bào)錯(cuò)解決方案,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下

今天安裝redis出現(xiàn)些之前安裝不曾出現(xiàn)錯(cuò)誤,一并在此做個(gè)記錄

一、安裝redis及出現(xiàn)錯(cuò)誤

首先下載redis,官方下載地址頁(yè)面:https://redis.io/download

我們這里選擇穩(wěn)定版6.0.1版本

正常安裝步驟如下:

[root@localhost ~]# yum install gcc
[root@localhost ~]# cd /usr/local
[root@localhost local]# wget http://download.redis.io/releases/redis-6.0.1.tar.gz
[root@localhost local]# tar -xvf redis-6.0.1.tar.gz
[root@localhost local]# cd /usr/local/redis-6.0.1/
[root@localhost redis-6.0.1]# make PREFIX=/usr/local/redis install

這里報(bào)了如下錯(cuò)誤

make[1]: *** [server.o] 錯(cuò)誤 1
make[1]: 離開目錄“/usr/redis-6.0.1/src”
make: *** [all] 錯(cuò)誤 2

server.c:2402:11: 錯(cuò)誤:‘struct redisServer'沒有名為‘a(chǎn)ssert_file'的成員
server.assert_file = "<no file>";
^
server.c:2403:11: 錯(cuò)誤:‘struct redisServer'沒有名為‘a(chǎn)ssert_line'的成員
server.assert_line = 0;
^
server.c:2404:11: 錯(cuò)誤:‘struct redisServer'沒有名為‘bug_report_start'的成員
server.bug_report_start = 0;
^
server.c:2405:11: 錯(cuò)誤:‘struct redisServer'沒有名為‘watchdog_period'的成員
server.watchdog_period = 0;
^
server.c:2411:11: 錯(cuò)誤:‘struct redisServer'沒有名為‘lua_always_replicate_commands'的成員
server.lua_always_replicate_commands = 1;
^
server.c: 在函數(shù)‘restartServer'中:
server.c:2464:32: 錯(cuò)誤:‘struct redisServer'沒有名為‘maxclients'的成員
for (j = 3; j < (int)server.maxclients + 1024; j++) {
^
server.c: 在函數(shù)‘a(chǎn)djustOpenFilesLimit'中:
server.c:2491:29: 錯(cuò)誤:‘struct redisServer'沒有名為‘maxclients'的成員
rlim_t maxfiles = server.maxclients+CONFIG_MIN_RESERVED_FDS;
^
server.c:2497:15: 錯(cuò)誤:‘struct redisServer'沒有名為‘maxclients'的成員
server.maxclients = 1024-CONFIG_MIN_RESERVED_FDS;
^
server.c:2529:53: 錯(cuò)誤:‘struct redisServer'沒有名為‘maxclients'的成員
unsigned int old_maxclients = server.maxclients;
^
server.c:2530:23: 錯(cuò)誤:‘struct redisServer'沒有名為‘maxclients'的成員
server.maxclients = bestlimit-CONFIG_MIN_RESERVED_FDS;
^
server.c:2554:59: 錯(cuò)誤:‘struct redisServer'沒有名為‘maxclients'的成員
(unsigned long long) bestlimit, server.maxclients);
^
server.c: 在函數(shù)‘checkTcpBacklogSettings'中:
server.c:2574:48: 錯(cuò)誤:‘struct redisServer'沒有名為‘tcp_backlog'的成員
if (somaxconn > 0 && somaxconn < server.tcp_backlog) {
^
server.c:2575:171: 錯(cuò)誤:‘struct redisServer'沒有名為‘tcp_backlog'的成員
serverLog(LL_WARNING,"WARNING: The TCP backlog setting of %d cannot be enforced because /proc/sys/net /core/somaxconn is set to the lower value of %d.", server.tcp_backlog, somaxconn);

解決辦法:升級(jí)gcc版本

[root@localhost redis-6.0.1]# gcc -v # 查看gcc版本
[root@localhost redis-6.0.1]# yum -y install centos-release-scl # 升級(jí)到9.1版本
[root@localhost redis-6.0.1]# yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
[root@localhost redis-6.0.1]# scl enable devtoolset-9 bash
以上為臨時(shí)啟用,如果要長(zhǎng)期使用gcc 9.1的話:
[root@localhost redis-6.0.1]# echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile

再執(zhí)行編譯:

[root@mmjredis redis-6.0.1]# make PREFIX=/usr/local/redis install

安裝成功會(huì)出現(xiàn):Hint: It's a good idea to run 'make test' 😉

我們執(zhí)行一下make test來(lái)進(jìn)行測(cè)試一下

出現(xiàn)了如下錯(cuò)誤:

[root@localhost redis-6.0.1]# make test
cd src && make test
make[1]: 進(jìn)入目錄“/usr/redis-6.0.1/src”
CC Makefile.dep
make[1]: 離開目錄“/usr/redis-6.0.1/src”
make[1]: 進(jìn)入目錄“/usr/redis-6.0.1/src”
You need tcl 8.5 or newer in order to run the Redis test
make[1]: *** [test] 錯(cuò)誤 1
make[1]: 離開目錄“/usr/redis-6.0.1/src”
make: *** [test] 錯(cuò)誤 2

解決辦法:

[root@localhost redis-6.0.1]# yum install tcl[root@localhost redis-6.0.1]# make test

測(cè)試成功如下:

先運(yùn)行redis試一下:

[root@localhost redis-6.0.1]# /usr/local/redis-6.0.1/src/redis-server /usr/local/redis-6.0.1/redis.conf
32101:C 13 May 2020 17:01:48.248 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
32101:C 13 May 2020 17:01:48.248 # Redis version=6.0.1, bits=64, commit=00000000, modified=0, pid=32101, just started
32101:C 13 May 2020 17:01:48.248 # Configuration loaded
32101:M 13 May 2020 17:01:48.249 * Increased maximum number of open files to 10032 (it was originally set to 1024).
        _._
      _.-``__ ''-._
   _.-``  `. `_. ''-._      Redis 6.0.1 (00000000/0) 64 bit
 .-`` .-```. ```\/  _.,_ ''-._
 (  '   ,    .-` | `,  )   Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|   Port: 6379
 |  `-._  `._  /   _.-'  |   PID: 32101
 `-._  `-._ `-./ _.-'  _.-'
 |`-._`-._  `-.__.-'  _.-'_.-'|
 |  `-._`-._    _.-'_.-'  |      http://redis.io
 `-._  `-._`-.__.-'_.-'  _.-'
 |`-._`-._  `-.__.-'  _.-'_.-'|
 |  `-._`-._    _.-'_.-'  |
 `-._  `-._`-.__.-'_.-'  _.-'
   `-._  `-.__.-'  _.-'
     `-._    _.-'
       `-.__.-'

二、后臺(tái)啟動(dòng)

簡(jiǎn)單修改后臺(tái)啟動(dòng)

[root@localhost redis-6.0.1]# vim redis.conf

daemonize no 改成 daemonize yes

再來(lái)運(yùn)行一下

[root@localhost redis-6.0.1]# /usr/redis-6.0.1/src/redis-server /usr/redis-6.0.1/redis.conf
30385:C 13 May 2020 16:57:58.918 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
30385:C 13 May 2020 16:57:58.918 # Redis version=6.0.1, bits=64, commit=00000000, modified=0, pid=30385, just started
30385:C 13 May 2020 16:57:58.918 # Configuration loaded

后臺(tái)運(yùn)行成功,我們查看一下,并終止程序

[root@localhost redis-6.0.1]# ps -aux|grep redis| grep -v grep
root 29836 0.0 0.0 162416 7912 ? Ssl 16:56 0:00 /usr/redis-6.0.1/src/redis-server 127.0.0.1:6379
[root@localhost redis-6.0.1]# kill -9 29836

我們這里用到的是用后臺(tái)systemctl啟動(dòng)redis

首先把redis加入service服務(wù)

vim /lib/systemd/system/redis.service

寫入

[Unit]
Description=redis
After=network.target

[Service]
Type=forking
PIDFile=/var/run/redis_6379.pid
ExecStart=/usr/local/redis-6.0.1/src/redis-server /usr/local/redis-6.0.1/etc/redis.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

注意路徑問題,以及PIDFile的路徑對(duì)應(yīng)的是redis-6.0.1/src/redis-server里面的PIDFile

wq保存退出即可

接著運(yùn)行以下

[root@localhost redis-6.0.1]# systemctl enable redis.service # 加入開機(jī)啟動(dòng)

[root@localhost redis-6.0.1]# systemctl is-enabled redis.service # 查看開機(jī)是否啟動(dòng)成功
enabled

[root@localhost redis-6.0.1]# systemctl start redis #開啟redis服務(wù)

[root@localhost redis-6.0.1]# systemctl status redis //查看redis運(yùn)行狀態(tài)

如果啟動(dòng)出現(xiàn)問題,可以通過(guò)systemctl status redis來(lái)查看日志修復(fù)

如圖已經(jīng)啟動(dòng)成功

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Ubuntu VPS 簡(jiǎn)易安裝LAMP教程

    Ubuntu VPS 簡(jiǎn)易安裝LAMP教程

    LAMP是Linux、Apache、MySQL和PHP的首字母縮寫詞,本教程將引導(dǎo)你安裝基于Ubuntu10.10系統(tǒng)的Apache2服務(wù)器,支持PHP5(mod_php)和MySQL。
    2011-02-02
  • Linux多線程編程快速入門

    Linux多線程編程快速入門

    這篇文章主要介紹了Linux多線程編程快速入門,涉及到了線程基本知識(shí),線程標(biāo)識(shí),線程創(chuàng)建,線程終止,管理線程的終止等相關(guān)內(nèi)容,小編覺得還是挺不錯(cuò)的,這里分享給大家,需要的朋友可以參考下
    2018-01-01
  • centos6.7 安裝python2.7、pip2.7、easy_install-2.7的方法

    centos6.7 安裝python2.7、pip2.7、easy_install-2.7的方法

    這篇文章主要介紹了centos6.7 安裝python2.7、pip2.7、easy_install-2.7的方法,需要的朋友可以參考下
    2017-03-03
  • Linux服務(wù)器間文件實(shí)時(shí)同步的實(shí)現(xiàn)

    Linux服務(wù)器間文件實(shí)時(shí)同步的實(shí)現(xiàn)

    這篇文章主要介紹了Linux服務(wù)器間文件實(shí)時(shí)同步的實(shí)現(xiàn),小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2018-11-11
  • 詳解CentOS7防火墻管理firewalld

    詳解CentOS7防火墻管理firewalld

    本篇文章主要介紹了CentOS7防火墻管理firewalld,centos 7中防火墻是一個(gè)非常的強(qiáng)大的功能了,有興趣的可以了解一下。
    2016-12-12
  • Ubuntu18.04下將 磁盤掛載在某目錄下

    Ubuntu18.04下將 磁盤掛載在某目錄下

    這篇文章主要介紹了Ubuntu18.04 下將磁盤掛載在某目錄下,本文圖文并茂給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2019-12-12
  • 詳解Linux常用命令的用法(二)————文本編輯器命令vi/vim

    詳解Linux常用命令的用法(二)————文本編輯器命令vi/vim

    這篇文章主要介紹了Linux常用命令的用法(二)————文本編輯器命令vi/vim,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-04-04
  • 3分鐘學(xué)會(huì)如何上手supervisor看門狗

    3分鐘學(xué)會(huì)如何上手supervisor看門狗

    這篇文章主要介紹了3分鐘學(xué)會(huì)如何上手supervisor看門狗,文章中操作步驟講解的很清楚,有需要的同學(xué)可以研究下
    2021-02-02
  • Windows下PHP安裝路徑配置錯(cuò)誤導(dǎo)致Apache無(wú)法啟動(dòng)的解決方法

    Windows下PHP安裝路徑配置錯(cuò)誤導(dǎo)致Apache無(wú)法啟動(dòng)的解決方法

    這篇文章主要介紹了Windows下PHP安裝路徑配置錯(cuò)誤導(dǎo)致Apache無(wú)法啟動(dòng)的解決方法,本文可以說(shuō)是一個(gè)引號(hào)引發(fā)的悲劇,需要的朋友可以參考下
    2014-09-09
  • Linux下如何高效切換目錄的方法

    Linux下如何高效切換目錄的方法

    這篇文章主要介紹了Linux下如何高效切換目錄,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-08-08

最新評(píng)論

志丹县| 铁岭市| 额敏县| 彰化县| 宿迁市| 鄂州市| 松潘县| 武夷山市| 易门县| 阿合奇县| 禹城市| 四会市| 和平县| 南丰县| 荥经县| 安多县| 仲巴县| 临清市| 玉田县| 泸水县| 汉中市| 徐闻县| 卢氏县| 双城市| 曲松县| 大余县| 屏东县| 浏阳市| 阿巴嘎旗| 阿瓦提县| 即墨市| 星座| 汕尾市| 汾阳市| 临城县| 湟中县| 滦南县| 扎赉特旗| 沅陵县| 台中县| 侯马市|