Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ CentOS install Memcached     - How to install Docker and basic usage on Ubuntu 15.04 (Server)

- Java gets the current system time System.currentTimeMillis () (Programming)

- Installing software on Ubuntu: apt-get and dpkg difference (Linux)

- Production environment Linux bonding method standby mode slave card switch (Server)

- Oracle Linux 6.4 installed Oracle 11gR2 + RAC + ASM (Database)

- Linux scp remote file copy (Linux)

- CentOS cross compiler core Raspberry Pi 2 (Linux)

- The virtual memory (Linux)

- Linux directory configuration (Linux)

- Oracle create user authorization and in PLSQL (Database)

- Figlet use (Linux)

- Linux host dual LAN transceiver package ARP problem (Linux)

- echo command (Linux)

- Ubuntu Apache2 setting, problem solving css, pictures, etc. can not be displayed (Server)

- Computer black magic: tail recursion (Programming)

- Forgot Linux root password (Linux)

- Unsafe reboot start (Linux)

- How to find out a Unix system library files are 32-bit or 64-bit (Linux)

- Github Getting Started Basic Course (Linux)

- CentOS install expect (Linux)

 
         
  CentOS install Memcached
     
  Add Date : 2018-11-21      
         
         
         
  CentOS install Memcached

Installation and Configuration
wget http://memcached.org/latest -O memcached.tar.gz
tar -zxvf memcached.tar.gz
cd memcached
./configure --prefix = / usr / local / memcached
make && sudo make install
ln -sf / usr / local / memcached / bin / memcached / usr / bin / memcached

If there is no `/ var / lock / subsys`, create` mkdir -p / var / lock / subsys`

Configuring System Services

Add files: vim /etc/init.d/memcached
#! / Bin / bash
#
# Memcached: MemCached Daemon
#
# Chkconfig: - 90 25
# Description: MemCached Daemon
#
### BEGIN INIT INFO
# Provides: memcached
# Required-Start: $ syslog
# Required-Stop: $ syslog
# Should-Start: $ local_fs
# Should-Stop: $ local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: memcached - Memory caching daemon
# Description: memcached - Memory caching daemon
### END INIT INFO

# If the IP address of 127.0.0.1 then this machine can only limit access
# If the IP-based machine within the network IP, you can access the network only
#IP For the application to access the IP Memcached use, typically 127.0.0.1 or native or native IP network outside the network IP
IP = 127.0.0.1
PORT = 11211
USER = root
MAXCONN = 1024
CACHESIZE = 64
OPTIONS = ""

RETVAL = 0
prog = "memcached"

start () {
    echo -n $ "Starting $ prog:"
    / Usr / local / memcached / bin / memcached -d -l $ IP -p $ PORT -u $ USER -m $ CACHESIZE -c $ MAXCONN -P /var/run/memcached.pid $ OPTIONS
    if [! "? $" = 0]; then
        echo "failed"
        exit 1
    else
        touch / var / lock / subsys / memcached
        echo "done"
    fi
}

stop () {
    echo -n $ "Stopping $ prog:"
    if [! -e /var/run/$prog.pid]; then
        echo -n $ "$ prog is not running."
        exit 1
    fi
    kill `cat / var / run / memcached.pid`
    if [! "? $" = 0]; then
        echo "failed"
        exit 1
    else
        rm -f / var / lock / subsys / memcached
        rm -f /var/run/memcached.pid
        echo "done"
    fi
}

restart () {
    $ 0 stop
    sleep 2
    $ 0 start
}

# See how we were called.
case "$ 1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart | reload)
        restart
        ;;
    *)
        echo $ "Usage: $ 0 {start | stop | status | restart | reload}"
        exit 1
        ;;
esac

exit $?


Given executable permissions: chmod + x /etc/init.d/memcached

Firewall settings
# Set Rules
vim / etc / sysconfig / iptables

# If limited access to certain machines can be set as follows:
-A INPUT -s 127.0.0.1,10.170.238.137,123.7.213.222 / 32 -p udp -m udp --dport 11211 -j ACCEPT
-A INPUT -s 127.0.0.1,10.170.238.137,123.7.213.222 / 32 -p tcp -m tcp --dport 11211 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 11211 -j DROP
-A INPUT -p udp -m udp --dport 11211 -j DROP

# Iptables restart such rules take effect
service iptables restart

start up

/etc/init.d/memcached start
     
         
         
         
  More:      
 
- According to the national position on how to block traffic in Linux (Server)
- Java Concurrency - multiple threads of HelloWorld (Programming)
- Linux Mint 17 set up the Ruby environment (Linux)
- STL in the list of erase () method (Programming)
- Spring-depth understanding of the various annotations (Programming)
- Java-based data source database access (Programming)
- Perl loop (Programming)
- Ubuntu installed racing game Speed Dreams 2.1 (Linux)
- When a software RAID data recovery and reconstruction of how failure (Linux)
- Django template inheritance child (Programming)
- Java rewrite equals method (Programming)
- 64-bit Windows Server 2012 R2 install Oracle 10g Second Edition (Database)
- Ubuntu the ARP (arptables) (Linux)
- Piostat - Monitoring and Statistics Linux process (Linux)
- Install Ubuntu Software Center App Grid (Linux)
- Zabbix monitoring different versions of RAID installation and monitoring and MySQL master-slave monitor (Server)
- installation and configuration of the PHP environment (Apache2) under Linux (Server)
- Stucts2 values on the page and how the attribute values corresponding to the Action (Programming)
- NGINX Plus now fully supports HTTP / 2 (Server)
- AngularJS achieve picture upload feature (Programming)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.