Skip to content

Instantly share code, notes, and snippets.

@pbolduc
Forked from nghuuphuoc/1) Install
Last active July 3, 2023 09:39
Show Gist options
  • Save pbolduc/e7a7e5559d01c4f500cc2ea4e9baf817 to your computer and use it in GitHub Desktop.
Save pbolduc/e7a7e5559d01c4f500cc2ea4e9baf817 to your computer and use it in GitHub Desktop.

Revisions

  1. pbolduc revised this gist Aug 18, 2016. 1 changed file with 15 additions and 2 deletions.
    17 changes: 15 additions & 2 deletions 5. Starting at boot
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,17 @@


    # Copy sample init_script to /etc/init.d, note also the number of the port on the script name
    cp utils/redis_init_script /etc/init.d/redis_6379
    $ cp utils/redis_init_script /etc/init.d/redis_6379

    # edit new file /etc/systemd/system/redis_6379.service with the following content
    [Unit]
    Description=Redis on port 6379

    [Service]
    Type=forking
    ExecStart=/etc/init.d/redis_6379 start
    ExecStop=/etc/init.d/redis_6379 stop

    [Install]
    WantedBy=multi-user.target

    $ systemctl enable redis_6379.service
  2. pbolduc revised this gist Aug 18, 2016. 7 changed files with 27 additions and 11 deletions.
    6 changes: 0 additions & 6 deletions 1. Install Redis
    Original file line number Diff line number Diff line change
    @@ -14,9 +14,3 @@ $ make install
    $ cd src
    $ mkdir /etc/redis
    $ mkdir -p /var/lib/redis/6379

    // --- or using yum ---
    $ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    $ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

    $ yum --enablerepo=remi,remi-test install redis
    5 changes: 0 additions & 5 deletions 2. Configure Redis
    Original file line number Diff line number Diff line change
    @@ -1,5 +0,0 @@
    $ sudo nano /etc/sysctl.conf
    vm.overcommit_memory=1
    $ sysctl vm.overcommit_memory=1

    $ sysctl -w fs.file-max=100000
    12 changes: 12 additions & 0 deletions 2. System Configuration
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    # Set the vm.overcommit_memory to 1, which means always, this will avoid data to be truncated
    $ sudo nano /etc/sysctl.conf
    vm.overcommit_memory=1
    $ sysctl vm.overcommit_memory=1

    # Change the maximum of backlog connections some value higher than the value on tcp-backlog option of redis.conf, which defaults to 511
    $ sysctl -w net.core.somaxconn=512

    # Disable transparent huge pages support, that is known to cause latency and memory access issues with Redis.
    $ echo never > /sys/kernel/mm/transparent_hugepage/enabled

    $ sysctl -w fs.file-max=100000
    7 changes: 7 additions & 0 deletions 3. Configure Redis
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@

    # Copy sample redis.conf to /etc/redis/6379.conf.
    $ cp redis.conf /etc/redis/6379.conf


    # Set daemonize to no, systemd need it to be in foreground, otherwise Redis will suddenly die.
    daemonize no
    2 changes: 2 additions & 0 deletions 4. Security
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@

    See: http://linoxide.com/storage/install-redis-server-centos-7/
    4 changes: 4 additions & 0 deletions 5. Starting at boot
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@


    # Copy sample init_script to /etc/init.d, note also the number of the port on the script name
    cp utils/redis_init_script /etc/init.d/redis_6379
    2 changes: 2 additions & 0 deletions 3. Service commands → 6. Service commands
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@


    $ chkconfig --add redis
    $ chkconfig --level 345 redis on
    $ service redis start/stop/restart
  3. pbolduc revised this gist Aug 18, 2016. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions 1. Install Redis
    Original file line number Diff line number Diff line change
    @@ -12,8 +12,6 @@ $ make install

    // --- Installing ---
    $ cd src
    $ cp redis-server redis-cli /usr/local/bin
    $ cp redis-sentinel redis-benchmark redis-check-aof redis-check-dump /usr/local/bin
    $ mkdir /etc/redis
    $ mkdir -p /var/lib/redis/6379

  4. pbolduc revised this gist Aug 18, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1. Install Redis
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # see How to Install Redis Server on CentOS 7 - http://linoxide.com/storage/install-redis-server-centos-7/

    # --- Compiling ---
    $ yum install gcc make
    $ yum install gcc make tcl
    $ REDIS_VER=3.2.3
    $ wget http://download.redis.io/releases/redis-$REDIS_VER.tar.gz
    $ tar xzvf redis-$REDIS_VER.tar.gz
  5. pbolduc revised this gist Aug 18, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions 1. Install Redis
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,7 @@ $ wget http://download.redis.io/releases/redis-$REDIS_VER.tar.gz
    $ tar xzvf redis-$REDIS_VER.tar.gz
    $ cd redis-$REDIS_VER
    $ make
    $ make test
    $ make install

    // --- Installing ---
  6. pbolduc revised this gist Aug 18, 2016. 2 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
  7. pbolduc revised this gist Aug 18, 2016. 2 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
  8. pbolduc revised this gist Aug 18, 2016. 1 changed file with 3 additions and 4 deletions.
    7 changes: 3 additions & 4 deletions 1. Install Redis
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,14 @@
    // see
    # see How to Install Redis Server on CentOS 7 - http://linoxide.com/storage/install-redis-server-centos-7/

    // --- Compiling ---
    ```bash
    # --- Compiling ---
    $ yum install gcc make
    $ REDIS_VER=3.2.3
    $ wget http://download.redis.io/releases/redis-$REDIS_VER.tar.gz
    $ tar xzvf redis-$REDIS_VER.tar.gz
    $ cd redis-$REDIS_VER
    $ make
    $ make install
    ```

    // --- Installing ---
    $ cd src
    $ cp redis-server redis-cli /usr/local/bin
  9. pbolduc revised this gist Aug 18, 2016. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion 1. Install Redis
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,15 @@
    // see

    // --- Compiling ---
    ```bash
    $ yum install gcc make
    $ REDIS_VER=3.2.3
    $ wget http://download.redis.io/releases/redis-$REDIS_VER.tar.gz
    $ tar xzvf redis-$REDIS_VER.tar.gz
    $ cd redis-$REDIS_VER
    $ make
    $ make install

    ```
    // --- Installing ---
    $ cd src
    $ cp redis-server redis-cli /usr/local/bin
  10. pbolduc revised this gist Aug 18, 2016. 4 changed files with 0 additions and 12 deletions.
    File renamed without changes.
    File renamed without changes.
    File renamed without changes.
    12 changes: 0 additions & 12 deletions 4) Install PHP redis extension
    Original file line number Diff line number Diff line change
    @@ -1,12 +0,0 @@
    // Install php-redis extension
    $ yum --enablerepo=remi,remi-test install php-redis

    // If it does not work, try the following steps:
    $ wget https://github.com/nicolasff/phpredis/zipball/master -O phpredis.zip
    $ unzip phpredis.zip
    $ cd nicolasff-phpredis-*
    $ phpize
    $ ./configure
    $ make
    $ make install
    Installing shared extensions: /usr/lib64/php/modules/
  11. pbolduc revised this gist Aug 18, 2016. No changes.
  12. pbolduc revised this gist Aug 18, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1) Install
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    // see [How to Install Redis Server on CentOS 7](http://linoxide.com/storage/install-redis-server-centos-7/)
    // see

    // --- Compiling ---
    $ yum install gcc make
  13. pbolduc revised this gist Aug 18, 2016. 1 changed file with 14 additions and 3 deletions.
    17 changes: 14 additions & 3 deletions 1) Install
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,21 @@
    // see [How to Install Redis Server on CentOS 7](http://linoxide.com/storage/install-redis-server-centos-7/)

    // --- Compiling ---
    $ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
    $ tar xzvf redis-2.8.3.tar.gz
    $ cd redis-2.8.3
    $ yum install gcc make
    $ REDIS_VER=3.2.3
    $ wget http://download.redis.io/releases/redis-$REDIS_VER.tar.gz
    $ tar xzvf redis-$REDIS_VER.tar.gz
    $ cd redis-$REDIS_VER
    $ make
    $ make install

    // --- Installing ---
    $ cd src
    $ cp redis-server redis-cli /usr/local/bin
    $ cp redis-sentinel redis-benchmark redis-check-aof redis-check-dump /usr/local/bin
    $ mkdir /etc/redis
    $ mkdir -p /var/lib/redis/6379

    // --- or using yum ---
    $ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    $ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
  14. @nghuuphuoc nghuuphuoc revised this gist Dec 23, 2013. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion 2) Config
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    $ sudo nano /etc/sysctl.conf
    vm.overcommit_memory=1
    $ sysctl vm.overcommit_memory=1
    $ sysctl vm.overcommit_memory=1

    $ sysctl -w fs.file-max=100000
  15. @nghuuphuoc nghuuphuoc revised this gist Dec 23, 2013. 3 changed files with 11 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions 1) Compiling
    Original file line number Diff line number Diff line change
    @@ -1,5 +0,0 @@
    $ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
    $ tar xzvf redis-2.8.3.tar.gz
    $ cd redis-2.8.3
    $ make
    $ make install
    8 changes: 8 additions & 0 deletions 2) Or using yum → 1) Install
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,11 @@
    // --- Compiling ---
    $ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
    $ tar xzvf redis-2.8.3.tar.gz
    $ cd redis-2.8.3
    $ make
    $ make install

    // --- or using yum ---
    $ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    $ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

    3 changes: 3 additions & 0 deletions 2) Config
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    $ sudo nano /etc/sysctl.conf
    vm.overcommit_memory=1
    $ sysctl vm.overcommit_memory=1
  16. @nghuuphuoc nghuuphuoc revised this gist Dec 23, 2013. 2 changed files with 0 additions and 34 deletions.
    7 changes: 0 additions & 7 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,7 +0,0 @@
    $ yum install gcc-c++
    $ wget http://www.canonware.com/download/jemalloc/jemalloc-3.3.0.tar.bz2
    $ tar xjvf jemalloc-3.3.0.tar.bz2
    $ cd jemalloc-3.3.0
    $ ./configure
    $ make
    $ make install
    27 changes: 0 additions & 27 deletions gistfile2.txt
    Original file line number Diff line number Diff line change
    @@ -1,27 +0,0 @@
    // See http://www.saltwebsites.com/2012/install-redis-245-service-centos-6
    $ wget http://redis.googlecode.com/files/redis-2.6.9.tar.gz
    $ tar xzvf redis-2.6.9.tar.gz
    $ cd redis-2.6.9
    $ make
    $ make install

    $ mkdir /etc/redis /var/lib/redis
    $ cp redis.conf /etc/redis
    $ sudo nano /etc/redis/redis.conf
    daemonize yes
    loglevel notice
    logfile /var/log/redis.log
    dir /var/lib/redis
    $ wget --no-check-certificate https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
    $ nano redis-server
    redis="/usr/local/bin/redis-server"
    $ mv redis-server /etc/init.d
    $ chmod 755 /etc/init.d/redis-server
    $ chkconfig --add redis-server
    $ chkconfig --level 345 redis-server on
    $ nano /etc/sysctl.conf
    vm.overcommit_memory = 1
    $ sysctl vm.overcommit_memory=1

    // Start Redis
    $ service redis-server start
  17. @nghuuphuoc nghuuphuoc revised this gist Dec 23, 2013. 2 changed files with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions 3) Service commands
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    $ chkconfig --add redis
    $ chkconfig --level 345 redis on
    $ service redis start/stop/restart
    File renamed without changes.
  18. @nghuuphuoc nghuuphuoc revised this gist Dec 23, 2013. 2 changed files with 9 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions 1) Compiling
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    $ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
    $ tar xzvf redis-2.8.3.tar.gz
    $ cd redis-2.8.3
    $ make
    $ make install
    4 changes: 4 additions & 0 deletions 2) Or using yum
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    $ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    $ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

    $ yum --enablerepo=remi,remi-test install redis
  19. @nghuuphuoc nghuuphuoc created this gist Dec 5, 2013.
    7 changes: 7 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    $ yum install gcc-c++
    $ wget http://www.canonware.com/download/jemalloc/jemalloc-3.3.0.tar.bz2
    $ tar xjvf jemalloc-3.3.0.tar.bz2
    $ cd jemalloc-3.3.0
    $ ./configure
    $ make
    $ make install
    27 changes: 27 additions & 0 deletions gistfile2.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    // See http://www.saltwebsites.com/2012/install-redis-245-service-centos-6
    $ wget http://redis.googlecode.com/files/redis-2.6.9.tar.gz
    $ tar xzvf redis-2.6.9.tar.gz
    $ cd redis-2.6.9
    $ make
    $ make install

    $ mkdir /etc/redis /var/lib/redis
    $ cp redis.conf /etc/redis
    $ sudo nano /etc/redis/redis.conf
    daemonize yes
    loglevel notice
    logfile /var/log/redis.log
    dir /var/lib/redis
    $ wget --no-check-certificate https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
    $ nano redis-server
    redis="/usr/local/bin/redis-server"
    $ mv redis-server /etc/init.d
    $ chmod 755 /etc/init.d/redis-server
    $ chkconfig --add redis-server
    $ chkconfig --level 345 redis-server on
    $ nano /etc/sysctl.conf
    vm.overcommit_memory = 1
    $ sysctl vm.overcommit_memory=1

    // Start Redis
    $ service redis-server start
    12 changes: 12 additions & 0 deletions gistfile3.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    // Install php-redis extension
    $ yum --enablerepo=remi,remi-test install php-redis

    // If it does not work, try the following steps:
    $ wget https://github.com/nicolasff/phpredis/zipball/master -O phpredis.zip
    $ unzip phpredis.zip
    $ cd nicolasff-phpredis-*
    $ phpize
    $ ./configure
    $ make
    $ make install
    Installing shared extensions: /usr/lib64/php/modules/