基础命令
/etc/init.d/sendmail start
/etc/init.d/sendmail stop
/etc/init.d/sendmail status
/date/mysql/bin/mysqld_safe --user=mysql &
/bin/systemctl restart mysqld.service
vi /etc/rc.d/rc.local
/etc/rc.d/rc3.d/S55sshd
ln -s -f /date/httpd/bin/apachectl /etc/rc.d/rc3.d/S15httpd
ipvsadm -ln
ipvsadm -C
xm list
virsh
./bin/httpd -M
httpd -t -D DUMP_MODULES
echo 内容| /bin/mail -s "标题" 收件箱 -f 发件人
"`echo "内容"|iconv -f utf8 -t gbk`" | /bin/mail -s "`echo "标题"|iconv -f utf8 -t gbk`" 收件箱
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
chkconfig
chkconfig service on|off|set
chkconfig --level 35 httpd off
chkconfig --level 35 httpd on
chkconfig --list
chkconfig --list |grep httpd
chkconfig –-list [service]
systemctl
systemctl is-active *.service
systemctl is-enabled *.service
systemctl mask *.service
systemctl unmask cups.service
systemctl enable *.service
systemctl disable *.service
systemctl start *.service
systemctl stop *.service
systemctl restart *.service
systemctl reload *.service
systemctl status *.service
systemctl --failed
systemctl poweroff
systemctl reboot
systemctl rescue
systemctl emergency
systemctl list-dependencies
systemctl list-unit-files
journalctl -r -u elasticsearch.service
/etc/systemd/system/falcon-agent.service
[Unit]
Description=This is zuiyou monitor agent
After=network.target remote-fs.target nss-lookup.target
[Service]
User= root
Type=simple
PIDFile=/opt/falcon-agent/var/app.pid
ExecStartPre=/usr/bin/rm -f /opt/falcon-agent/var/app.pid
ExecStart=/opt/falcon-agent/control start
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=process
KillSignal=SIGQUIT
TimeoutStopSec=5
PrivateTmp=true
Restart=always
LimitNOFILE=infinity
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
nginx
yum install -y make gcc openssl-devel pcre-devel bzip2-devel libxml2 libxml2-devel curl-devel libmcrypt-devel libjpeg libjpeg-devel libpng libpng-devel openssl
groupadd nginx
useradd nginx -g nginx -M -s /sbin/nologin
mkdir -p /opt/nginx-tmp
wget http://labs.frickle.com/files/ngx_cache_purge-1.6.tar.gz
tar fxz ngx_cache_purge-1.6.tar.gz
# ngx_cache_purge 清除指定url缓存
# 假设一个URL为 http://192.168.12.133/test.txt
# 通过访问 http://192.168.12.133/purge/test.txt 就可以清除该URL的缓存。
tar zxvpf nginx-1.4.4.tar.gz
cd nginx-1.4.4
# ./configure
#
#
#
#
# ngx_module_upstream_check 编译前需要打对应版本补丁 patch -p1 < /opt/nginx_upstream_check_module/check_1.2.6+.patch
#
#
./configure \
make && make install
/usr/local/nginx/sbin/nginx –t # 检查Nginx配置文件 但并不执行
/usr/local/nginx/sbin/nginx -t -c /opt/nginx/conf/nginx.conf # 检查Nginx配置文件
/usr/local/nginx/sbin/nginx # 启动nginx
/usr/local/nginx/sbin/nginx -s reload # 重载配置
/usr/local/nginx/sbin/nginx -s stop # 关闭nginx服务
elasticsearch
vim /etc/sysctl.conf
vm.max_map_count = 262144
vim /etc/security/limits.conf
* soft memlock unlimited
* hard memlock unlimited
sysctl -p
curl 'localhost:9200/_cat/health?v'
curl 'localhost:9200/_cat/nodes?v'
curl 'localhost:9200/_cat/indices?v'
curl 127.0.0.1:9200/indexname -XDELETE
curl -XGET http://localhost:9200/_cat/shards
curl '127.0.0.1:9200/_cat/indices'
mysql常用命令
mysqlcheck -uroot -p -S mysql.sock --optimize --databases account
mysqlbinlog slave-relay-bin.000001
mysqladmin -h myhost -u root -p create dbname
flush privileges;
show databases;
use dbname;
show tables;
desc tables;
drop database name;
drop table name;
create database name;
select column from table;
show processlist;
show full processlist;
select user();
show slave status\G;
show variables;
show status;
show table status
show grants for user@'%'
drop table if exists user
create table if not exists user
select host,user,password from user;
create table ka(ka_id varchar(6),qianshu int);
show variables like 'character_set_%';
show variables like '%timeout%';
delete from user where user='';
delete from user where user='sss' and host='localhost' ;
drop user 'sss'@'localhost';
ALTER TABLE mytable ENGINE = MyISAM ;
SHOW TABLE STATUS from dbname where Name='tablename';
mysql -uroot -p -A -ss -h10.10.10.5 -e "show databases;"
CREATE TABLE innodb (id int, title char(20)) ENGINE = INNODB
grant replication slave on *.* to 'user'@'%' identified by 'pwd';
ALTER TABLE player ADD INDEX weekcredit_faction_index (weekcredit, faction);
alter table name add column accountid(column) int(