以修改tomcat版本号为例
1、直接编辑文件(vi命令是乱码)vim catalina.jar
2、搜索或光标移动到ServerInfo.properties,按回车
3、修改版本号,正常保存退出即可server.info=Apache Tomcat/1.1.1
server.number=1.1.1.1
以修改tomcat版本号为例
1、直接编辑文件(vi命令是乱码)vim catalina.jar
2、搜索或光标移动到ServerInfo.properties,按回车
3、修改版本号,正常保存退出即可server.info=Apache Tomcat/1.1.1
server.number=1.1.1.1
Oracle归档日志满了,狂打警告导致磁盘满了的问题
现象是oracle连接报错:ORA-00257: archiver error. Connect internal only, until freed.
登录服务器查看磁盘满了,原因是归档日志满了
1、登录su - oracle
sqlplus /nolog
connect /as sysdba
2、检查flash recovery area的使用情况select * from V$FLASH_RECOVERY_AREA_USAGE;
已经占用了99.62%
3、查询日志目录位置show parameter recover;
db_recovery_file_dest /oracle/app/oracle/fast_recovery_area
4、备份(测试环境略过)
5、在删除归档日志后,必须用RMAN维护控制文件,否则空间显示仍然不释放rman target sys/pass
检查一些无用的archivelogRMAN> crosscheck archivelog all;
删除截止到前一天的所有archivelogRMAN> delete archivelog until time 'sysdate-1';
6、删除alert日志
/oracle/app/oracle/diag/rdbms/posp/airtrip/alert下
/oracle/app/oracle/diag/tnslsnr/HKDB01/listener/alert下
的log_xxx.xml文件rm -rf log_*.log
参考资料:
https://blog.csdn.net/cw370008359/article/details/51023794
Helm是用来管理Kubernetes发布包的工具,使用方法类似于yum、npm工具
原来:手写yaml –> xxx.yaml –> kubectl apply -f –> 获取xxx组件
现在:values.yaml –> 通过模板生成xxx.yaml –> helm install/upgrade –> 获取xxx组件
PS:以下操作都在master机器上
1、安装Helm3
Helm3.x版本移除了tiller依赖,所以只有一个helm文件cd /tmp
wget https://get.helm.sh/helm-v3.4.0-linux-amd64.tar.gz
tar -zxvf helm-v3.4.0-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin/helm
2、配置环境变量vi /etc/profile
加入:export KUBECONFIG=/root/.kube/config
执行:source /etc/profile
1、在node1和node2执行kubeadm join 192.168.101.1:6443 --token mu949z.xkhkw4tq7t79z4v6 \
--discovery-token-ca-cert-hash sha256:0a381d7f750bda8d639b7132bf4db942710d2042b2cef0c6ffe6aa49a4603f5d \
--ignore-preflight-errors=Swap
2、返回W0713 04:55:55.810886 12707 join.go:346] [preflight] WARNING: JoinControlPane.controlPlane settings will be ignored when control-plane flag is not set.
[preflight] Running pre-flight checks
[WARNING Swap]: running with swap on is not supported. Please disable swap
error execution phase preflight: couldn't validate the identity of the API Server: could not find a JWS signature in the cluster-info ConfigMap for token ID "mu949z"
To see the stack trace of this error execute with --v=5 or higher
1、安装flannel network(主节点)cd ~
wget https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
kubectl apply -f kube-flannel.yml
podsecuritypolicy.policy/psp.flannel.unprivileged created
clusterrole.rbac.authorization.k8s.io/flannel created
clusterrolebinding.rbac.authorization.k8s.io/flannel created
serviceaccount/flannel created
configmap/kube-flannel-cfg created
daemonset.apps/kube-flannel-ds-amd64 created
daemonset.apps/kube-flannel-ds-arm64 created
daemonset.apps/kube-flannel-ds-arm created
daemonset.apps/kube-flannel-ds-ppc64le created
daemonset.apps/kube-flannel-ds-s390x created
2、pod概念
pod是k8s最小管理单位,它是一个或多个容器的组合
3、flannel network
用于集群中各个pod互相通讯的网络,Kubernetes支持Flannel、Calico、Weave network等多种cni网络Drivers
此时执行docker images,会看到多了一个flannel的镜像:
quay.io/coreos/flannel
4、查看集群节点状态,变为Readykubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-master Ready master 2d21h v1.18.5
三、创建单个控制面板(主节点)集群
1、初始化主节点
由于测试环境原因,忽略一些错误kubeadm init --pod-network-cidr=10.122.0.0/16 \
--ignore-preflight-errors=Swap
参数说明:--apiserver-advertise-address:指定用master的哪个IP地址与cluster的其他节点通信
--service-cidr:指定service网络的范围,即负载均衡VIP使用的IP地址段
--pod-network-cidr:指定pod网络的范围,即pod的IP地址段
--ignore-preflight-errors=:忽略运行时的错误
2、如果初始化失败,查看原因systemctl status kubelet
journalctl -xeu kubelet
重置:systemctl stop kubelet
kubeadm reset
systemctl daemon-reload
一、环境准备(所有节点)
1、节点信息
k8s-master:192.168.101.1
k8s-node1:192.168.101.2
k8s-node2:192.168.101.3
2、系统信息
CentOS Linux release 7.8.2003 (Core)
3、关闭selinuxsed -i 's/enforcing/disabled/' /etc/selinux/config
setenforce 0
4、关闭防火墙systemctl stop firewalld
systemctl disable firewalld
5、关闭swap(测试环境可不关闭)vi /etc/fstab
去除swap配置,并reboot
PS:为了应用发生OOM时,使其被系统kill掉,及时发现问题
6、设置主机名和hosts
主节点:k8s-master
工作节点1:k8s-node1
工作节点2:k8s-node2vi /etc/hosts
1)k8s-master节点127.0.0.1 k8s-master
192.168.101.2 k8s-node1
192.168.101.3 k8s-node2
2)k8s-node1节点127.0.0.1 k8s-node1
192.168.101.1 k8s-master
192.168.101.3 k8s-node2
3)k8s-node2节点127.0.0.1 k8s-node2
192.168.101.1 k8s-master
192.168.101.2 k8s-node1
1、2020年一半结束了,想想做了些什么
2、有次健身练完,健身房的教练又要叫我买课,拉着我聊了一个小时。不想花钱了,已经买了30节课,不少了,这样下去没底
3、买防晒衣,去了线下店饰梦乐,看中一件128,但是没舍得买,后来淘宝上买了一件68的,做工、材质都比128的差多了
4、买盗版潮牌,淘宝上165买了一件T恤,后来发现官网相同图案是长袖,盗版的是短袖,真让人贻笑大方。算了,自己家里穿吧
1、碎片整理
合并表空间的碎片增加表空间的连续性alter tablespace POSP_DATA coalesce;
2、缩小表空间大小
大小不能小于数据文件中的所处的最大位置alter database datafile '/oradata/posp/posp_data16.dbf' RESIZE 2048M;
3、查询表空间使用率select a.tablespace_name as tablespace, total, free,(total-free) as usage from
(select tablespace_name, sum(bytes)/1024/1024 as total from dba_data_files group by tablespace_name) a,
(select tablespace_name, sum(bytes)/1024/1024 as free from dba_free_space group by tablespace_name) b
where a.tablespace_name = b.tablespace_name;
TABLESPACE TOTAL FREE USAGE
--------------------
SYSAUX 980 48.6875 931.3125
UNDOTBS1 250 218.75 31.25
POSP_DATA 32768 31643.875 1124.125
USERS 5 3.6875 1.3125
SYSTEM 1730 7.1875 1722.8125
POSP_IDX 4096 3999.8125 96.1875
数据库启动报错:ORA-00227: corrupt block detected in control file: (block 1, # blocks 1)
原因为控制文件损坏,之前清理文件的时候误删了,无奈网上找了个文章硬着头皮上,重建控制文件
1、查询数据库版本SQL> select * from v$version;
BANNER
--------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
2、查询控制文件位置SQL> show parameter control_files
NAME TYPE VALUE
--------------------
control_files string /oradata/posp/control01.ctl, /oracle/app/oracle/fast_recovery_area/posp/control02.ctl
3、删除控制文件rm /oradata/posp/control01.ctl
rm /oracle/app/oracle/fast_recovery_area/posp/control02.ctl
4、启动SQL> shutdown abort;
SQL> startup nomount;
5、查询语言SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
--------------------
AMERICAN_AMERICA.US7ASCII