for i in $(ls -l |grep '^d' |du -s * |sort -nr|awk '{print $2}');do du -sh $i;done
for i in $(ls -l |grep '^d' |du -s * |sort -nr|awk '{print $2}');do du -sh $i;done
PUT _snapshot/my_backup/
{
"type": "fs",
"settings": {
"location": "/mount/backups/my_backup"
}
}
location 需要添加到配置文件`elasticsearch.yml的path.repo参数中
PUT _snapshot/my_backup/kibana_20170815
{
"indices": ".kibana"
}
PUT _snapshot/my_backup/logstash_20170815
{
"indices": "logstash-*"
}
GET _snapshot/my_backup/_all
POST _snapshot/my_backup/kibana_20170815/_restore
POST _snapshot/my_backup/logstash_20170815/_restore
DELETE _snapshot/my_backup/logstash_20170815
DELETE _snapshot/my_backup/kibana_20170815
GET _nodes/settings/?pretty=true
curl https://yjiang.cn | pbcopy
实现的效果: 将
curl
请求到的内容导入粘贴板
pbpaste > foo.txt
实现的效果: 将粘贴板的内容写入
foo.txt
运维不再允许ssh直连目标主机, 要求必须通过堡垒机(jumpserver)来访问.
之前配置的密钥自动登录失效了;必须每次手动登录堡垒机,然后再登录目标主机.
像以前使用密钥自动登录一样登录目标主机
直接从本地scp文件到目标主机
~/.ssh/config
, 指定堡垒机的登录配置, 增加内容如下:Host jumpserver
Hostname <jumpserver ip>
Port <jumpserver port>
User <jumpserver username>
IdentityFile <jumpserver private key>
ssh-add <jumpserver private key>
#提示输入密钥的密码时,输入后确认
~/.ssh/authorized_keys
无密码登录不在赘述,请自查
~/.ssh/config
,增加内容如下host <target host alias>
Hostname <jumpserver ip>
Port <jumpserver host>
User <jumpserver username>
ProxyCommand ssh <jumpserver username>@<target ip> -W %h:%p
ssh <target host alias>
scp <source file> <target host alias>:~/
堡垒机登陆以后, 直接在堡垒机上创建本机用户无密码登录localhost,
ssh -NL 2222:localhost:22 localhost
;
把之前的22端口转发到2222端口, 以后使用 2222 端口登陆, 就绕过堡垒机了
pm2 too many unstable restarts
程序运行时间过短,例如只是简单的
echo
时, 运行15次就会提示too many unstable restarts
不管程序实际逻辑处理多久,都让运行的程序
sleep
一秒
#例如
<?php
echo "foo";
sleep(1);
Copyright © 2016 yjiang's cake