02 2023 档案

摘要:ssh修改端口号-添加白名单-禁止root用户远程登录sshd限制 1.修改ssh端口 vim /etc/ssh/sshd_config #Port 22 Port 20199 #指定端口 Port 20100 #ListenAddress 0.0.0.0 #ListenAddress :: 2.添加ssh白名单 [root@small ~]# vim 阅读全文
posted @ 2023-02-25 15:10 安生丶 阅读(269) 评论(0) 推荐(0) 编辑
摘要:grafana忘记密码[root@prod-php-s010 www]# sqlite3 /var/lib/grafana/grafana.db sqlite> .tables sqlite> select * from user; sqlite> update user set password = '59acf18b 阅读全文
posted @ 2023-02-25 15:06 安生丶 阅读(27) 评论(0) 推荐(0) 编辑
摘要:linux-history没内容-上下箭头用不了history命令是被保存在内存中的,当退出或者登录shell时,会自动保存或读取。在内存中,历史命令仅能够存储1000条历史命令,该数量是由环境变量 HISTSIZE进行控制。默认是不显示命令的执行时间,命令的执行时间,history 已经记录,只是没有显示。 # 不记录命令 export HIS 阅读全文
posted @ 2023-02-25 15:05 安生丶 阅读(369) 评论(0) 推荐(0) 编辑
摘要:nginx跨域访问location /dyl-server/ { if ($request_method = 'OPTIONS') { add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods GET,POST, 阅读全文
posted @ 2023-02-25 14:56 安生丶 阅读(63) 评论(0) 推荐(0) 编辑
摘要:linux-nc端口测试工具#安装工具 yum -y install nc #监听端口 nc -lp 8080 #案例:大数据服务走8080端口,外网监听。安全组开过了。但是访问不了。关掉服务,nc开启8080,外网访问,还是访问不了。说明跟服务没关系,后面发现8080端口为特殊端口,需要备案。问题解决 阅读全文
posted @ 2023-02-25 14:56 安生丶 阅读(52) 评论(0) 推荐(0) 编辑
摘要:top命令使用帮助#参数 -b:以批处理模式操作; -c:显示完整的治命令; -d:屏幕刷新间隔时间; -I:忽略失效过程; -s:保密模式; -S:累积模式; -i<时间>:设置间隔时间; -u<用户名>:指定用户名; -p<进程号>:指定进程; -n<次数>:循环显示的次数。 #交互命令 M:根据驻留内存大小进行 阅读全文
posted @ 2023-02-25 14:54 安生丶 阅读(35) 评论(0) 推荐(0) 编辑
摘要:K8S-etcd备份脚本#!/bin/bash #ENDPOINTS="https://192.168.1.207:2379,https://192.168.1.208:2379,https://192.168.1.209:2379" ENDPOINTS="127.0.0.1:2379" CACERT="/etc/kube 阅读全文
posted @ 2023-02-25 14:53 安生丶 阅读(36) 评论(0) 推荐(0) 编辑
摘要:mysql-如何查看表结构#查看某个表结构 desc `dyl_uims`.`t_auth_dept`; #查看某个表某个字段的数据,如果表太大,记得加条件。否则容易卡住。 select system_id from `dyl_uims`.`t_auth_dept` limit 100; 阅读全文
posted @ 2023-02-25 14:53 安生丶 阅读(20) 评论(0) 推荐(0) 编辑
摘要:shell脚本-清理未使用的docker镜像[root@master ~]# cat /usr/bin/cleanimg #!/bin/bash num=`docker ps -a|grep Exit|wc -l` if [ numgt0];thendockerrm(docker ps -a|grep Exit|awk 阅读全文
posted @ 2023-02-25 14:52 安生丶 阅读(83) 评论(0) 推荐(0) 编辑
摘要:记录一次K8S新节点加入集群报错#问题:新机器加入K8S集群报错 [kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10248/healthz’ failed with error: Get“http://localhost:10248/healt 阅读全文
posted @ 2023-02-25 14:51 安生丶 阅读(148) 评论(0) 推荐(0) 编辑
摘要:shell脚本-定时任务管理进程[root@bigdata04 ~]# cat /data/res/search.sh #!/bin/bash source /etc/profile mem=`free -h |awk 'NR==2{print $NF}' | awk -FG '{print $1}' |cut -d '.' -f 阅读全文
posted @ 2023-02-25 14:50 安生丶 阅读(42) 评论(0) 推荐(0) 编辑
摘要:system管理zookeeper[root@ajsh-dev006 systemd]# cat /usr/lib/systemd/system/zk.service [Unit] Description=zookeeper.service After=network.target [Service] User=root Group 阅读全文
posted @ 2023-02-25 14:49 安生丶 阅读(49) 评论(0) 推荐(0) 编辑
摘要:system管理kafka[root@ajsh-dev006 systemd]# cat /usr/lib/systemd/system/kafka.service [Unit] Description=kafka [Service] User=root LimitNOFILE=65535 LimitNPROC=65535 阅读全文
posted @ 2023-02-25 14:48 安生丶 阅读(62) 评论(0) 推荐(0) 编辑
摘要:shell脚本修改配置文件案例[root@bigdata01 ~/install]# vim change-yarn-site.sh #!bin/bash #此脚本对大数据集群所有节点的yarn-site.xml文件根据集群配置自动更改对应配置。 HOST_LIST=`grep 'bigdata' /etc/hosts |awk 阅读全文
posted @ 2023-02-25 14:47 安生丶 阅读(114) 评论(0) 推荐(0) 编辑
摘要:shell脚本多重判断案例cpu=1mem=2 if [ cpu==4];thenvcores=4if["mem" == "15G" ];then mb=12288 elif [ "mem"=="7.3G"];thenmb=6200fielif[cpu == 8 ];then vc 阅读全文
posted @ 2023-02-25 14:47 安生丶 阅读(26) 评论(0) 推荐(0) 编辑
摘要:linux-路由追踪[root@master deployment]# yum -y install mtr [root@master deployment]# mtr 36.134.8.76 My traceroute [v0.85] master (0.0.0.0) Tue Dec 6 15:46:38 2022 阅读全文
posted @ 2023-02-25 14:46 安生丶 阅读(29) 评论(0) 推荐(0) 编辑
摘要:K8S-hostAliases-配置域名解析##通过服务yaml文件配置 kind: Deployment .... spec: .... spec: hostAliases: - ip: "120.26.68.89" hostnames: - "asrexz.exiaozhi.com" 阅读全文
posted @ 2023-02-25 14:45 安生丶 阅读(122) 评论(0) 推荐(0) 编辑
摘要:nginx代理mysql#需要用到四层负载。首先确定你的nginx支持四层负载。确定开启stream模块 [root@test-node5 conf.d]# nginx -V configure arguments: --prefix=/usr/local/nginx --with-http_ssl_module --wi 阅读全文
posted @ 2023-02-25 14:44 安生丶 阅读(420) 评论(0) 推荐(0) 编辑
摘要:K8S污点容忍案例[root@lecode-pre74 ~]# setenforce 0 setenforce: SELinux is disabled [root@lecode-pre74 ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux 阅读全文
posted @ 2023-02-25 14:41 安生丶 阅读(28) 评论(0) 推荐(0) 编辑
摘要:mysqldump使用帮助导出sql文件可以使用mysqldump。主要有如下几种操作: 导出整个数据库(包括数据库中的数据): mysqldump -h主机 -u username -ppassword dbname > dbname.sql; 导出数据库中的数据表(包括数据表中的数据): mysqldump -h主机 - 阅读全文
posted @ 2023-02-25 14:40 安生丶 阅读(14) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示