1. 背景说明 却省情况下,Java运行时根据运行它的用户授予安全权限。当Tomcat以系统管理员身份或作为系统服务运行时,Java运行时取得了系统用户或系统管理员所具有的全部权限。这样一来,Java运行时就取得了所有文件夹中所有文件的全部权限。并且Servlets(JSP在运行过程中要转换成Servlets)取得了同样的...

[Read more...]

1. 消耗内存脚本memory_usage.sh 1.1. Shell代码 #!/bin/bash # Destription: testing memory usage # Example : sh memory_usage.sh 500M | sh memory_usage.sh 1G | sh memory_usage.sh release FILE_NAME=`basename $0` memsize=$2 function usage() { echo "Usage:$FILE_NAME consume memory_size|release -----the value of memory_size like 100M 2G and etc" echo "Example: $FILE_NAME consum...

[Read more...]

连接SSH服务器,使用私钥连接,将比使用密码连接更加安全。 1. 服务器生成密钥对 首先,进入用户家目录: cd 使用ssh-keygen生成公私钥对: ssh-keygen -t rsa 过程中可以选择设置密码passphrase或者不设置。 生成后,将在用户家目录下创建.ssh目录,其中包含生成的公私钥对。 其中id_rsa为私钥,id_rsa.pub为公钥...

[Read more...]

1. 下载kube-flannel.yaml wget https://github.com/flannel-io/flannel/releases/download/v0.22.3/kube-flannel.yml 若无法下载,则使用下面的YAML内容: # kube-flannel.yml apiVersion: v1 kind: Namespace metadata: labels: k8s-app: flannel pod-security.kubernetes.io/enforce: privileged name: kube-flannel --- apiVersion: v1 kind: ServiceAccount metadata: labels: k8s-app: f...

[Read more...]

1. 设置系统主机名及hosts文件 记得将所有主机的主机名与IP的解析都写入/etc/hosts文件。 2. 更新系统&设置存储库 yum update -y yum install -y yum-utils yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo 3. 相关设置 3.1. 禁用iptables和firewalld服务 systemctl stop firewalld systemctl disable firewalld systemctl sto...

[Read more...]

1. 设置系统主机名及hosts文件 编辑/etc/hosts文件,添加IP与主机名的映射。若有多个Node,则全部添加。 执行如下命令设置主机名。 hostnamectl set-hostname k8s-master 2. 更新系统&设置存储库 yum update -y yum install -y yum-utils yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo 3. 相关设置 3.1. 禁用...

[Read more...]