Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ CentOS7 installation configuration Redis-3.0.0     - Linux operating system security management skills notes (Linux)

- To install Python-Pip and Fabric under CentOS / Ubuntu (Linux)

- Ubuntu system safe and caution sudo su command (Linux)

- Debian GNU / Linux service list acquisition, shutting down services or run (Linux)

- Shilpa Nair interview experience sharing RedHat Linux package management (Linux)

- Install Ubuntu open source drawing program MyPaint 1.2.0 (Linux)

- Oracle Linux 5.5 (64bit) Install Oracle 11gR2 RAC detailed tutorial (Database)

- Linux firewall security (Linux)

- Explore Android SQLite3 multithreading (Programming)

- Linux file permissions to modify the command: chmod (Linux)

- Use this one-time password via SSH secure login Linux (Programming)

- Installation Docker FAQ on Ubuntu (Linux)

- Unsafe reboot start (Linux)

- The method of installing software under Ubuntu Linux (Linux)

- Getting Started with Linux system to learn: How do I know which processes are running on the CPU core (Linux)

- Linux user login ban (Linux)

- Formatted output printf command (Programming)

- ASM Disk Space Check (Database)

- The user of fedora is not in the sudoers file method to solve (Linux)

- Docker build their own private warehouses (Linux)

 
         
  CentOS7 installation configuration Redis-3.0.0
     
  Add Date : 2017-01-08      
         
       
         
  One. Installing necessary packages

yum install gcc
Two.Linux installed

#download
wget http://download.redis.io/releases/redis-3.0.0.tar.gz
tar zxvf redis-3.0.0.tar.gz
cd redis-3.0.0
# Will complain if no arguments, linux under
make MALLOC = libc
 Once installed, the startup file

# Start redis
src / redis-server &

# Close redis
src / redis-cli shutdown
Test redis

$ Src / redis-cli
127.0.0.1:6379> set foo bar
OK
127.0.0.1:6379> get foo
"Bar"
$
The test is successful

3.redis cluster Cluster Setup

Create Local Test Environment

Establish the run directory

# Create redis run directory
mkdir -p redis-server / 7000 /
# Copy the default configuration file
cp redis-3.0.0 / redis.conf redis-server / redis.default.conf
# Copy the compiled server to the run directory
cp redis-3.0.0 / src / redis-server redis-server / 7000 /
Establishment of an independent profile

# Create redis configuration files in the directory 7000
vim redis-server / 7000 / redis.conf
document content

# Redis-server / 7000 / redis.conf
include /root/redis-server/redis.default.conf
pidfile /var/run/redis-7000.pid
port 7000
cluster-enabled yes
cluster-config-file redis-node-7000.conf
cluster-node-timeout 5000
appendonly yes
Copy the run directory (simulated cluster environment)

# Copy directory
cp -R 7000/7001 /
cp -R 7000/7002 /
cp -R 7000/7003 /
cp -R 7000/7004 /
cp -R 7000/7005 /
Modify the port and file name of the corresponding profile

Establish startup script redis-server / redis-start.sh

#! / Bin / sh
/ Root / redis-server / 7000 / redis-server /root/redis-server/7000/redis.conf &
/ Root / redis-server / 7001 / redis-server /root/redis-server/7001/redis.conf &
/ Root / redis-server / 7002 / redis-server /root/redis-server/7002/redis.conf &
/ Root / redis-server / 7003 / redis-server /root/redis-server/7003/redis.conf &
/ Root / redis-server / 7004 / redis-server /root/redis-server/7004/redis.conf &
/ Root / redis-server / 7005 / redis-server /root/redis-server/7005/redis.conf &
Configuring the cluster

Install ruby

yum install ruby-devel.x86_64
Install redis gem

# Gem install redis
Fetching: redis-3.2.1.gem (100%)
Successfully installed redis-3.2.1
Parsing documentation for redis-3.2.1
Installing ri documentation for redis-3.2.1
1 gem installed
Use a script to build a cluster mechanism

Create at the time, plus the parameter --replicas 1 represents a salve assigned to each master, as an example, it is 3 Master 3 salve

# ./redis-trib.rb Create 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005
>>> Creating cluster
Connecting to node 127.0.0.1:7000: OK
Connecting to node 127.0.0.1:7001: OK
Connecting to node 127.0.0.1:7002: OK
Connecting to node 127.0.0.1:7003: OK
Connecting to node 127.0.0.1:7004: OK
Connecting to node 127.0.0.1:7005: OK
>>> Performing hash slots allocation on 6 nodes ...
Using 6 masters:
127.0.0.1:7000
127.0.0.1:7001
127.0.0.1:7002
127.0.0.1:7003
127.0.0.1:7004
127.0.0.1:7005
M: f3dd250e4bc145c8b9f864e82f65e00d1ba627be 127.0.0.1:7000
   slots: 0-2730 (2731 slots) master
M: 1ba602ade59e0770a15128b193f2ac29c251ab5e 127.0.0.1:7001
   slots: 2731-5460 (2730 slots) master
M: 4f840a70520563c8ef0d7d1cc9d5eaff6a1547a2 127.0.0.1:7002
   slots: 5461-8191 (2731 slots) master
M: 702adc7ae9caf1f6702987604548c6fc1d22e813 127.0.0.1:7003
   slots: 8192-10922 (2731 slots) master
M: 4f87a11d2ea6ebe9caf02c9dbd827a3dba8a53cf 127.0.0.1:7004
   slots: 10923-13652 (2730 slots) master
M: 216bbb7da50bd130da16a327c76dc6d285f731b3 127.0.0.1:7005
   slots: 13653-16383 (2731 slots) master
Can I set the above configuration (type 'yes' to accept):? Yes
>>> Nodes configuration updated
>>> Assign a different config epoch to each node
>>> Sending CLUSTER MEET messages to join the cluster
Waiting for the cluster to join ...
>>> Performing Cluster Check (using node 127.0.0.1:7000)
M: f3dd250e4bc145c8b9f864e82f65e00d1ba627be 127.0.0.1:7000
   slots: 0-2730 (2731 slots) master
M: 1ba602ade59e0770a15128b193f2ac29c251ab5e 127.0.0.1:7001
   slots: 2731-5460 (2730 slots) master
M: 4f840a70520563c8ef0d7d1cc9d5eaff6a1547a2 127.0.0.1:7002
   slots: 5461-8191 (2731 slots) master
M: 702adc7ae9caf1f6702987604548c6fc1d22e813 127.0.0.1:7003
   slots: 8192-10922 (2731 slots) master
M: 4f87a11d2ea6ebe9caf02c9dbd827a3dba8a53cf 127.0.0.1:7004
   slots: 10923-13652 (2730 slots) master
M: 216bbb7da50bd130da16a327c76dc6d285f731b3 127.0.0.1:7005
   slots: 13653-16383 (2731 slots) master
[OK] All nodes agree about slots configuration.
>>> Check for open slots ...
>>> Check slots coverage ...
[OK] All 16384 slots covered.
 If you need all the re-automatic configuration, delete all configured cluster-config-file, restart all redis-server, and then re-execute the configuration commands to
     
         
       
         
  More:      
 
- Element content of Java HashSet change issues (Programming)
- PULL operation mechanism parsing XML Comments (Programming)
- Ubuntu 14.04 + xRDP + Xfce implement Windows Remote Desktop Connection (Linux)
- BusyBox making the file system (Linux)
- Use Ansible to bulk manage remote servers (Server)
- CentOS 6.5 minimal installation and configuration VMware tools (Linux)
- How to Install Foreman under Ubuntu (Server)
- Win8 mount disk partitions under Ubuntu (Linux)
- Upgrading to Debian 7.6 glibc 2.15 (Linux)
- The several technical presentation Raid under Linux (Linux)
- shell script: a key optimization CentOS system (Linux)
- Type Linux commands (Linux)
- Linux operating system security tools of the Logs (Linux)
- The next key to install Linux bash script PowerShell (Linux)
- Linux redirection and piping (Linux)
- Commentary Apache + Tomcat + JK implement Tomcat clustering and load (Server)
- Use the top command (Linux)
- Ubuntu install driver manager Mint Driver Manager and Device Driver Manager (Linux)
- On event processing browser compatibility notes (Programming)
- C # Future: Method Contract (Programming)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.