New
0
无    2020-09-02 11:59:04    1    0
myron



ssh断点续传

rsync -av -P --rsh=ssh -e "ssh -p 10022" root@x.xcodes.com.cn:/tmp/isotester-avl64-2020.5.10.iso ./

 

 


ssh断点续传

rsync -av -P --rsh=ssh -e "ssh -p 10022" root@10.3.23.2:/tmp/isotester-avl64-2020.5.10.iso ./

dd制作avlinux启动U盘
sudo dd if=isotester-avl64-2020.5.10.iso of=/dev/sdb bs=4M

64bit: Username: isotester Password: avl64 Root Password: avl64admin


————————————————————————

https://medium.com/big-data-engineering/redshift-cicd-how-we-did-it-and-why-you-should-do-it-to-e46ecf734eab


Kubernetes client tools overview

All of us know kubectl, but with wide adoption of Kubernetes over the last few years, several interesting client side tools have come up that can help improve your daily interaction with a Kubernetes cluster.

In this post, we’ll take a high level overview of many such client side applications and see how it can help you.
k9s

k9s offers a terminal based UI, to interact with Kubernetes clusters. The UI looks similar to other continuos running Linux commands like top. k9s continually watches the Kubernetes cluster for changes and allows you to interact with Kubernetes resources inline.

Type: Standalone (uses kubectl in background).
Installation: Binaries for Linux, Windows and Mac are available as tarballs in the release page.
Kubernetes version: Currently k9s required Kubernetes version 1.13 and above.
Community: k9s is pretty popular and has a great community working together to improve it further. Join the Slack community at K9ersSlack.
Interesting features: Supports Plugins which let you define your own cluster commands.

k9s in action
tubectl

Tubectl is a simple yet powerful wrapper around kubectl which aims to reduce complexity of working with contexts, namespaces and intelligent matching resources. Tubectl allows switching seamlessly between contexts and namespaces, for example Instead of typing kubectl --context staging or kubectl --context production now you just type tubectl @st or tubectl @prod. Similarly, Instead of kube-system in such command kubectl get pods -n kube-system, you can type tubectl get pods +sys.

Type: Standalone (uses kubectl in background).
Installation: Binaries for Linux, Windows and Mac are available as tarballs in the release page.
Kubernetes version: Currently tubectl required Kubernetes version 1.13 and above.
Community: tubectl community hangs out at slack.reconquest.io.

tubectl in action
webkubectl

Web Kubectl helps you to manage kubernetes credentials and run kubectl command in web browser, so that you don’t have to install kubectl on your local PC or some other servers, furthermore Web Kubectl can be used for a team.

Type: Standalone (uses kubectl in background).
Installation: Simple installation with Docker image. $ docker run --name="webkubectl" -p 8080:8080 -d --privileged kubeoperator/webkubectl.
Kubernetes version: Compatible with Kubernetes clusters with support for kubectl.
Community: webkubectl discussion happens on the GitHub Repo currently.
Interesting features: Multiple session support with single webkubectl deployments, with complete session isolation.

webkubectl in action
kube-prompt

kube-prompt is an interactive kubernetes client featuring auto-complete. It accepts the same commands as the kubectl, except you don’t need to provide the kubectl prefix. So it doesn’t require the additional cost to use this cli.

Type: Standalone (uses kubectl in background).
Installation: Binaries for Linux, Windows and Mac are available as tarballs in the release.
Kubernetes version: Compatible with Kubernetes clusters with support for kubectl.
Community: kube-prompt discussion happens on the GitHub Repo currently.

kube-prompt in action
kubectl-tree

This is a kubectl plugin that allows you to explore relationships between Kubernetes object in well know tree format. The tree layout allows a nice, visual overview of various resources present on the Kubernetes cluster and their relationships.

Type: kubectl plugin.
Installation: Use krew plugin manager to install kubectl-tree onto kubectl. Refer doc here.
Kubernetes version: Compatible with Kubernetes clusters with support for kubectl.
Community: kubectl-tree is fairly popular with ~1.5k GitHub stars. All the discussion happens on the GitHub Repo currently.

kubectl-tree in action
Other interesting kubectl plugins
kubectx

kubectx is a utility to manage and switch between kubectl contexts. Refer: https://github.com/ahmetb/kubectx
kubens

kubens is a utility to switch between Kubernetes namespaces. Refer: https://github.com/ahmetb/kubectx/#kubens1
kubectl trace

kubectl trace is a kubectl plugin that allows you to schedule the execution of bpftrace programs in your Kubernetes cluster. Refer: https://github.com/iovisor/kubectl-trace
ksniff

A kubectl plugin that utilize tcpdump and Wireshark to start a remote capture on any pod in your Kubernetes cluster. Refer: https://github.com/eldadru/ksniff.
kubectl-unbound-pvc

A small plugin to list Persistent Volume Claims which are not in Bound state. Refer: https://github.com/ishantanu/kubectl-unbound-pvc

Published 26 Jan 2020
Pre-order our Cloud Native Ecosystem Whitepaper today!

kuberneteskubectl

All about modern, cloud-native software and architecture.
Developer.sh on Twitter


_________________________________________________

#!/bin/sh
db=1
if [ -n "$1" ];then
db=$1
fi

orgCode=`cat org.txt`
for key in $orgCode
do
redis-cli -h 127.0.0.1 -p 6379 -a ecp <<END
select ${db}
hdel qsls:limit:apply ${key}
hdel qsls:limit:accept ${key}
END
done
echo 'Done'


————————————————————————

http://clustrmaps.com/https://tonybai.com/2017/12/08/deploy-high-availability-harbor-on-kubernetes-cluster/


</ul>
</section>
<section id="text-2" class="widget widget_text"> <div class="textwidget"><!-- clustrmaps begin-->
<!-- bigwhite.cn@gmail.com-->
<script type="text/javascript" id="clstr_globe" src="//cdn.clustrmaps.com/globe.js?d=KYC_JHsmFhQW7LdoxA2oO9QsTDhQfc-pGDFslbRApeo"></script>
<!-- clustrmaps end-->
</br>


————————————————————————

msdp-system-admin-web-1.1.0-SNAPSHOT.jar
msdp-system-admin-web-1.1.0-SNAPSHOT.pom
resolver-status.properties
bash-4.3# md5sum msdp-system-admin-web-1.1.0-SNAPSHOT.jar
7c77def8c8f0883c19388ad3787e2f74 msdp-system-admin-web-1.1.0-SNAPSHOT.jar
bash-4.3# pwd
/data/.m2/repository/com/bigtreefinance/msdp/system/msdp-system-admin-web/1.1.0-SNAPSHOT




————————————————————————
监控磁盘

def get_all_mountpoint():
raw_data = Popen("df -P | grep -v loop", stdout=PIPE,shell=True, stderr=PIPE).communicate()[0].splitlines()
mountpoints = []
for line in raw_data:
if line:
fs_type = line.split()[0]
element = line.split()[5]


————————————————————————

241 (172.16.42.53)[2018-05-10 21:39:08][root]yum -y install git
242 (172.16.42.53)[2018-05-10 21:39:55][root]git clone https://gitlab.bigtree.com/mgr/codes.git
243 (172.16.42.53)[2018-05-10 21:40:47][root]git clone https://mgr:longlong@gitlab.bigtree.com/mgr/codes.git
244 (172.16.42.53)[2018-05-10 21:41:15][root]echo 'export GIT_SSL_NO_VERIFY=true' >> ~/.bashrc
245 (172.16.42.53)[2018-05-10 21:41:27][root]source ~/.bashrc
246 (172.16.42.53)[2018-05-10 21:41:35][root]git clone https://mgr:longlong@gitlab.bigtree.com/mgr/codes.git


__________________________________________________


down vote
In my opinion the best way of using ssh

Before using Git add your key to ssh-agent

Start ssh-agent if not started:

$ eval `ssh-agent -s`
Add your private key using ssh-add

$ ssh-add ~/.ssh/id_rsa_key
Enter passphrase for /home/user/.ssh/id_rsa_key:
Identity added: /home/user/.ssh/id_rsa_key
(/home/user/.ssh/id_rsa_key)
Check if the key is added (parameter is a lowercase L):

$ ssh-add -l
2048 55:96:1a:b1:31:f6:f0:6f:d8:a7:49:1a:e5:4c:94:6f
/home/user/.ssh/id_rsa_key (RSA)
Try to connect to your Git server:

$ ssh git.example.com

————————————————————————

## 安装killall

yum -y install psmisc.x86_64


————————————————————————

Tomcat启动慢解决方法(本人CentOS7.4系统)

首先查看日志信息,查看因为什么而启动慢

  在CentOS7启动Tomcat时,启动过程很慢,需要几分钟,经过查看日志,发现耗时在这里:是session引起的随机数问题导致的。Tocmat的Session ID是通过SHA1算法计算得到的,计算Session ID的时候必须有一个密钥。为了提高安全性Tomcat在启动的时候会通过随机生成一个密钥。

日志信息:

22-Apr-2017 19:33:07.623 INFO [localhost-startStop-1] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of
SecureRandom instance for session ID generation using [SHA1PRNG] took [55,507] milliseconds.
22-Apr-2017 19:33:07.653 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web appli
cation directory /application/apache-tomcat-8.0.27/webapps/ROOT has finished in 55,935 ms
从日志中得出:主要原因是生成随机数的时候卡住了,导致tomcat启动不了。

为了加速/dev/random提供随机数的速度,可以通过操作设备的外设,让其产生大量的中断(如网络传输数据,按键,移动鼠标,在命令行敲几个不同的命令,)

cat /dev/random 会消耗能量

方法一

vim $JAVA_HOME/jre/lib/security/java.security

securerandom.source=file:/dev/random

改为

securerandom.source=file:/dev/urandom
方法二

vim $TOMCAT_HOME/bin/catalina.sh

if [[ "$JAVA_OPTS" != *-Djava.security.egd=* ]]; then

JAVA_OPTS="$JAVA_OPTS -Djava.security.egd=file:/dev/urandom"

fi

这个系统属性egd表示熵收集守护进程(entropy gathering daemon)
方法三(推荐)

安装rng

yum install rng-tools # 安装rngd服务(熵服务,增大熵池)

systemctl start rngd # 启动服务

————————————————————————


星期一, 九月 23, 5:38 下午星期一, 九月 23, 5:38 下午星期一, 九月 23, 5:38 下午
jar -cvfM0 game.war ./

-c 创建war包
-v 显示过程信息
-f
-M
-0 这个是阿拉伯数字,只打包不压缩的意思


解压game.war

jar -xvf game.war

解压到当前目录




——————————————————————

查资料

pdf site:oss.aliyuncs.com

——————————————————————

https://github.com/Seitanas/kvm-vdi/wiki

——————————————————————
## 更改Centos7 eth0 网卡

1.先编辑网卡的配置文件将里面的NAME DEVICE项修改为eth0
vim /etc/sysconfig/network-scripts/ifcfg-eno16777736

2.重命名该配置文件。

[root@localhost yum.repos.d]# cd /etc/sysconfig/network-scripts/installation.

[root@localhost network-scripts]# mv ifcfg-eno16777736 ifcfg-eth0


3.禁用该可预测命名规则。对于这一点,你可以在启动时传递“net.ifnames=0 biosdevname=0 ”的内核参数。这是通过编辑/etc/default/grub并加入“net.ifnames=0 biosdevname=0 ”到GRUBCMDLINELINUX变量来实现的。

[root@localhost network-scripts]# vim /etc/default/grub


4.运行命令grub2-mkconfig -o /boot/grub2/grub.cfg 来重新生成GRUB配置并更新内核参数。grub

[root@localhost network-scripts]# grub2-mkconfig -o /boot/grub2/grub.cfg

5.重新启动机器,启动完之后网卡名称就变成了Eth0
[root@localhost network-scripts]# init 6
——————————————————————
## 更改Docker 存储引擎

修改 Storage Driver

编辑文件 /etc/docker/daemon.json,键入以下配置:

{
"storage-driver": "overlay2"
}
实际上就是修改配置中 storage-driver 这个 json 属性的值,如果没有就加上,如果已存在就直接修改。如果连 daemon.json 文件都没有,那么就手动创建,粘贴以上内容。

注意:到这一步先不要急着重启 Docker 进程,看完下一节。

修改以后会发生什么?

所有 Docker Image 会被删除
所有 Docker Container 会被删除
所有容器的 Volumn 中的数据会被保留
如果你做好了重建容器和重下镜像的打算,那么可以重启 Docker 了。否则请备份好数据,或者放弃修改。

我应该选择哪一个 Storage Driver?

在环境支持的情况下(Kernel 4.x)请使用 overlay2 ,在环境不支持的情况下(Kernel 3.x )请使用 overlay 。

什么情况下必须修改 Storage Driver?

在多数情况下,可能都没有必须修改 Storage Driver 的必要。但是更改为更优的方案以后,在性能、安全性等各方面都会有提升,它属于一种 “优化”手段,但并不是强制的。但是,在某些情况下,必须得修改 Storage Driver,例如:

你已经手动升级到了最新的内核,但是并没有安装 image-extra 。这个现象其实挺常见的,例如 Ubuntu 官方的 Kernel Mainline 就不提供 linux-image-extra 包。它会导致你的 Dokcer 无法正常使用,原因在于:aufs 依赖 image-extra 中的某些驱动,由于 Docker 默认的 Storage Driver 也就是 aufs 无法使用,所以 Docker 就残了。
在这种情况下,你要做的并不是想办法弄到 linux-image-extra 并且安装上,而是放弃 aufs 使用其它的 Storage Driver ,例如 overlay2 它是不需要 image-extra 中的组件的。

最后

需要注意的一点是,并不是我自作主张的强调你们换 Storage Driver 。 Dokcer 的主要开发人员以及文档都是这么强调的。


—————————————————————
## 导出本机所有 Docker 镜像
# for i in `docker images |awk '{print $1 ":" $2}'`; do docker save -o `echo $i |awk -F"/" '{print $3}'`.tar $i; done

## 导入所有镜像
# for i in `ls `; do docker load < $i; done

—————————————————————




%MCEPASTEBIN%

K8s Bigtree
文档导航