• <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>

    FreeBSD12下安裝redis-5.0.3

           經由過程pkg安裝,最高只能安裝redis-4.0.11。既然redis已經發布了最新版本5.0.3。這里就測驗考試安裝一下redis的最新版本。

    東西/原料

    • 安裝FreeBSD12的電腦或虛擬機一臺
    • 可以或許毗連互聯網

    方式/步調

    1. 1

      一、到redis官網https://redis.io/下載Redis 5.0.3 is the latest stable version。

    2. 2

      二、解壓縮并進入將解壓后的文件夾

      #cd redis-5.0.3

      #gmake

      #gmake install clean

      如許將會把redis默認安裝到/usr/local/bin中,當然你也可以經由過程下面號令進行安裝:

      #gmake PREFIX=/usr/local/share/redis-5 install clean

      經由過程加上PREFIX=/usr/local/share/redis-5可以把redis安裝到/usr/local/share/redis-5目次中。

    3. 3

      三、對redis進行設置裝備擺設

      把redis-5.0.3文件夾中的redis.conf拷貝到/usr/local/etc文件夾下:

      #cp redis.conf /usr/local/etc/redis_6379.conf

      然后對它進行一些點竄:

      #ee /usr/local/etc/redis_6379.conf

      點竄下面三行內容:

      damemonize yes        //在自啟動redis時不顯示daemon

      logfile /var/log/redis/redis.log        //日記保留目次

      dir /home/redis_db/6379               //數據庫保留目次

      當然在更改上面兩個目次前必然要先建立響應的目次,不然redis-server將無法啟動。

      #mkdir /var/log/redis

      #mkdir /home/redis_db

      #mkdir /home/redis_db/6379

    4. 4

      四、在/usr/local/etc/rc.d目次中建立redis開機啟動文件

      #cd /usr/local/etc/rc.d

      #touch redis_6379             //建立開機啟動文件

      #chmod 555 redis_6379         //將開機啟動文件屬性改當作可執行文件

      #ee redis_6379                //點竄開機啟動文件

      將下面的內容復制到redis_6379文件中并保留:

      #!/bin/sh

      #

      # $FreeBSD: branches/2018Q4/databases/redis/files/redis.in 401020 2015-11-07 20:08:18Z osa $

      #

      # PROVIDE: redis

      # REQUIRE: LOGIN

      # BEFORE:  securelevel

      # KEYWORD: shutdown

      # Add the following line to /etc/rc.conf to enable `redis':

      #

      #redis_6379_enable="YES"

      #

      # Define profiles here to run separate redis instances:

      #

      #redis_profiles="foo bar" #  Script uses /usr/local/etc/redis-NAME.conf respectively.

      #                            For correct script working please update pidfile entries in

      #                            redis-NAME.conf files.

      . /etc/rc.subr

      name="redis_6379"

      rcvar="${name}_enable"

      extra_commands="reload"

      command="/usr/local/bin/redis-server"

      pidfile="/var/run/redis/$name.pid"

      # read configuration and set defaults

      load_rc_config "$name"

      : ${redis_6379_enable="NO"}

      : ${redis_user="redis"}

      : ${redis_config="/usr/local/etc/$name.conf"}

      command_args="${redis_config}"

      required_files="${redis_config}"

      _profile_exists() {

              for _p in ${redis_profiles}; do

                      [ "${_p}" = "$1" ] && return 1;

              done

              return 0

      }

      if [ $# -eq 2 ]; then

              _profile=$2

              _profile_exists $_profile

              _exists=$?

              [ ${_exists} -ne 1 ] && {                echo "`basename /usr/local/etc/rc.d/redis`: no '$2' in 'redis_profiles'"                exit 1        };

              echo "-- Profile: ${_profile} --"

              config_file="/usr/local/etc/${name}-${_profile}.conf"

              command_args="${config_file}"

              pidfile="/var/run/redis/${_profile}.pid"

              required_files="${config_file}"

      elif [ -n "${redis_profiles}" ]; then

              _swap=$*; shift; _profiles=$*

              _profiles=${_profiles:-${redis_profiles}}

              set -- ${_swap}

              for _profile in ${_profiles}; do

                      /usr/local/etc/rc.d/redis $1 ${_profile}

              done

              exit 0

      fi

      run_rc_command "$1

    5. 5

      五、點竄/etc/rc.conf

      #ee /etc/rc.conf

      添加下行代碼:

      redis_6379_enable="YES"

    6. 6

      六、重啟電腦進行測試

    7. 7

      OK,redis-5.0.3安裝完當作

    • 發表于 2019-01-04 00:00
    • 閱讀 ( 711 )
    • 分類:其他類型

    你可能感興趣的文章

    相關問題

    0 條評論

    請先 登錄 后評論
    admin
    admin

    0 篇文章

    作家榜 ?

    1. xiaonan123 189 文章
    2. 湯依妹兒 97 文章
    3. luogf229 46 文章
    4. jy02406749 45 文章
    5. 小凡 34 文章
    6. Daisy萌 32 文章
    7. 我的QQ3117863681 24 文章
    8. 華志健 23 文章

    聯系我們:uytrv@hotmail.com 問答工具
  • <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>
    久久久久精品国产麻豆