Linux (Cent OS7.2) Start stop memcached method and PS command use explanation

Source: Internet
Author: User
Tags memcached

Under Linux, take cent OS7.2 as an example, the Startup method after installing memcached is very simple, here we use Yum source installation.

First, look for the memchaced installation package for the Yum source repository.

Yum grep memcached

The above Linux commands return registration, such as memcached. x86_64, and then execute

Yum Install  -u root-m 1024m-d start

Among them, yum install is the installation of the memcached Package command, followed by the memcached cache service Start command, where the user must be specified as root, the optional setting-M 1024m is set to use the memory size of 1024m,-d to represent the daemon process.

The Linux environment Stop memcached cannot use the memcached-d Stop command directly as Windows does, and will not error after executing this command, but there will be no stopping results.

PS aux can be used here | The grep memcached command looks at the system process PID number memcahced in Linux and then kills the memcached process directly using the KILL command.

such as the query to the PID number is 37624 (the process of each Linux system PID is dynamic, must be checked first), and then kill the process using the KILL command. (or use kill-9 pid (-9 for forced kill))

We then tested with Telnet localhost 11211 and found that we were unable to connect and stopped memcached successfully.

Note: The following is a detailed description of the results field properties of the PS aux command, for reference, without affecting the above example.

PS aux | The more command allows you to view the specific PS aux field properties and all PID process information. (PS command is the abbreviation for process status)

The host of the USER process is rooted here;

The ID of the PID process;

Percentage of CPU consumed by the%CPU process;

%MEM% of memory occupied;

The amount of virtual memory (in kilobytes) used by the VSZ process;

The fixed amount of memory (in kilobytes) occupied by the RSS process;

TTY process The terminal of the login, if it is not related to the terminal display "?", if the display pts/0 (0 may be another number), it indicates the remote terminal connection running process;

STAT status character (the specific meaning is explained below);

Start process is started time;

time when the process actually used to run;

command name and parameters corresponding to the commands process;

STAT Status Character Explanation:

D a dormant state (usually IO process) that cannot be interrupted;

R is running the process;

S is in a dormant state;

T stop or be traced;

W enters memory swap (invalid starting from kernel 2.6);

X dead Process (basic rarely);

Z Zombie process;

< high-priority processes;

N low-priority processes;

L Some pages are locked into memory;

Leader of the S-process (under it there are sub-processes);

L multi-process (using Clone_thread, similar to NPTL pthreads);

+ Process Group located in the background;

add: You can also start memcached in the form of PID process files:

Memcached-u root-l localhost-p 11211-p/tmp/memcached.pid-d start-l is the server IP address of the listener, here specifies localhost can only native access, if the need for intranet access, then set the machine for internal Network IP, external network access is required to set up an extranet IP (memcached-u root-l 192.168.1.168-p 11211-p/tmp/memcached.pid-d Start, at this time only with the intranet 192 network segment of other machines access, The extranet cannot access the memcached service)-P is set to save Memcache PID file to kill process mode: Kill ' Cat/tmp/memcached.pid ' (note here is the anti-quote ")

Linux (Cent OS7.2) Start stop memcached method and PS command use explanation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.