Server-related operation commands

memcached

is automatically installed
sudo apt-get install memcached //Ubuntu/Debian
yum install memcached //Redhat/Fedora/Centos


check the process
ps -ef|grep memcached

check the port
Default uses port 11211
netstat -na|grep 11211

Check the memcache service started:
netstat -lp | grep memcached

to kill the memcache process:
kill -9 process id or kill `cat /tmp/memcached.pid`

to view the running status of memcache: Memcached connects to
telnet host port => telnet 120.27.137.215 21212

to connect to memcache, and then directly Enter stats to get the current memcache status.

Start the memcache daemon:
# /usr/local/bin/memcached -d -m 200 -u root -l 192.168.1.91 -p 12301 -c 1000 -P /tmp/memcached.pid The
relevant explanation is as follows:
The -d option is to start a daemon process,
-m is the amount of memory allocated to Memcache, the unit is MB, here is 200MB
-u is the user running Memcache, if you are currently root, you need to use this parameter to specify the user.
-l is the IP address of the listening server. If there are multiple addresses, I have specified the IP address of the server here 192.168.1.91
-p is the port where Memcache is listening. I have set 12301 here, preferably a port above
1024- The c option is the maximum number of concurrent connections running, the default is 1024, and 256
is set here. -P is the pid file for saving Memcache. I save it here at /tmp/memcached.pid
can start multiple daemons at the same time, but the port cannot Repeat

the set command (used to store the value (data value) in the specified key (key))
set key flags exptime bytes [noreply]
value
key: The key in the key-value structure, used to look up the cached value.
flags: An integer parameter that can include key-value pairs, which the client uses to store additional information about key-value pairs.
exptime: The length of time to save key-value pairs in the cache (in seconds, 0 means forever)
bytes: The number of bytes stored in the cache
noreply (optional): This parameter tells the server that no data should be returned
value: stored The value (always on the second line) (can be directly understood as the value in the key-value structure)

such as:
set runoob 0 900 9
memcached


add command (same as set parameter description)
add key flags exptime bytes [noreply]
value

If the key to add already exists, the data will not be updated, the previous value will remain the same, and you will get the response NOT_STORED.


replace command (same as set parameter description)
replace key flags exptime bytes [noreply]
value

Memcached replace command is used to replace the value (data value) of the existing key (key).
If the key does not exist, the replacement fails and you get the response NOT_STORED.


The append command (same as the set parameter description)
The Memcached append command is used to append data to the value (data value) of the existing key (key).
append key flags exptime bytes [noreply]
value The


prepend command (same as the set parameter description)
is used to append data to the value (data value) of the existing key (key).
prepend key flags exptime bytes [noreply]
value


CAS command (same as set parameter description)
command is used to perform a "check and set" operation
It can write the value only if the value corresponding to the key has not been modified by other clients after the current client takes the value for the last time.
cas key flags exptime bytes unique_cas_token [noreply]
value

unique_cas_token A unique 64-bit value obtained by the gets command. (Used to indicate whether the value has been modified by other users)


get command The
command obtains the value (data value) stored in the key (key), and returns null if the key does not exist.
get key
get key1 key2 key3 //Multiple keys are separated by spaces . The


gets command
gets the value (data value) stored with the CAS token. If the key does not exist, it will return null.
gets key
gets key1 key2 key3


delete Command
Used to delete an existing key (key).
delete key [noreply]


incr and decr commands (the data manipulated by the incr and decr commands must be 32-bit unsigned integers in decimal.) The
incr and decr commands are used to auto-increment or auto-increment the numeric value of an existing key (key). Subtract operation.
The incr key increment_value


stats command
is used to return statistics such as PID (process number), version number, number of connections, etc.


The stats items command
is used to display the number and storage time of items in each slab (the number of seconds since the last visit).
stats items The


stats slabs command
is used to display the information of each slab, including the size, number, and usage of chunks.
The stats slabs


stats sizes command
is used to display the size and number of all items.


The flush_all command
is used to flush all key=>value (key=>value) pairs in the cache.
flush_all [time] [noreply]

provides an optional parameter time, which is used to perform the flushing cache operation after the specified time.




Nginx other commands
/usr/local/webserver/nginx/sbin/nginx -s reload # Reload configuration file
/usr/local/webserver/nginx/sbin/nginx -s reopen # Restart Nginx
/usr/local/webserver/nginx /sbin/nginx -s stop # Stop Nginx


MySQL

mysqladmin -u username -p old password password new password
or enter the mysql command line
SET PASSWORD FOR 'username'@'host' = PASSWORD('password');
create a new user and authorize:
grant all privileges on *.* to username@'%' identified by 'password' with grant option;

start: service mysqld start
stop: service mysqld stop
restart: service mysqld restart
reload configuration: service mysqld reload


whereis docker-compose //find command




1. Compress the mydata directory under the /home directory into mydata.zip
zip -r mydata.zip mydata #Compress the mydata directory
2. Unzip mydata.zip under the /home directory into the mydatabak directory
unzip mydata.zip -d mydatabak
3. Compress the abc folder and 123.txt under the /home directory into abc123.zip
zip -r abc123.zip abc 123.txt
4. Unzip wwwroot.zip under /home directory directly into /home directory
unzip wwwroot.zip
5. Unzip abc12.zip, abc23.zip, abc34.zip under /home directory at the same time Go to the /home directory to
unzip abc\*. zip
6. Check and
unzip the contents of wwwroot.zip under the /home directory -v wwwroot.zip
7. Verify that wwwroot.zip under the /home directory is complete
unzip -t wwwroot.zip
8. Unzip wwwroot.zip under the /home directory Unzip all the files in it to the first-level directory
unzip -j wwwroot.zip




linux version View the command

uname -a ", which can display information about the computer and operating system.
cat /proc/version shows the running kernel version.
cat /etc /issue shows the release version information


apache-tomcat-8.0.24 uses to install
apache-tomcat-8.0.24.tar.gz
tar zxvf apache-tomcat-8.0.24.tar.gz //Decompression and

compression : tar zcvf FileName. tar.gz DirName

du -lh //Disk capacity occupied by sub-files and sub-directories under the current directory.


Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326685923&siteId=291194637