一键部署脚本

目录结构
  1. tree Log_Analysis_Platform_Document
  2. Log_Analysis_Platform_Document
  3. ├── InstallES.sh
  4. ├── InstallFilebeat.sh
  5. ├── InstallKibana.sh
  6. └── README.md
ES.sh
  1. #!/usr/bin/env bash
  2. # *************************************************************************************************************
  3. # Author: ZhouJian
  4. # Mail: 18621048481@163.com
  5. # Data: 2019-9-7
  6. # Describe: CentOS 7 AutoInstall Elasticsearchn-7.2 Deploy Script
  7. # ****************************Elasticsearch Deplay Script******************************************************
  8. clear
  9. ESIP=`ip addr | grep "inet" | grep -v "127.0.0.1" | grep -v "inet6" | awk -F/ '{print $1}' | awk '{print $2}' `
  10. echo -e "\033[32m ############################################################################# \033[0m"
  11. echo -e "\033[32m # Auto Install ELK. ## \033[0m"
  12. echo -e "\033[32m # Press Ctrl + C to cancel ## \033[0m"
  13. echo -e "\033[32m # Any key to continue ## \033[0m"
  14. echo -e "\033[32m # Softwae:elasticsearch-7.2.0/logstash-7.2.0/filebeat-7.2.0/kibana-7.2.0 ## \033[0m"
  15. echo -e "\033[32m ############################################################################# \033[0m"
  16. Read_Input() {
  17. echo -e "\033[32m Please Input You Kibana Pass Key IP: \033[0m"
  18. read -p "Please Input You HOST Pass Key IP:[192.168.244.55]" KibanaIP
  19. read -p "Please Input You HOST Pass Key IP: Password:" KibanaPass
  20. echo -e "\033[32m Please Input You Filebeat Pass Key IP: \033[0m"
  21. read -p "Please Input You HOST Pass Key IP:[192.168.244.56]" FilebeatIP
  22. read -p "Please Input You HOST Pass Key IP: Password:" FilebeatPass
  23. }
  24. Init_Yumsource()
  25. {
  26. if ! ping -c2 www.baidu.com &>/dev/null
  27. then
  28. echo "您无法上外网,不能配置yum源"
  29. exit
  30. fi
  31. echo "配置yum源"
  32. if [ ! -d /etc/yum.repos.d/backup ];then
  33. mkdir /etc/yum.repos.d/backup
  34. mv /etc/yum.repos.d/* /etc/yum.repos.d/backup 2>/dev/null
  35. curl -o /etc/yum.repos.d/163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo &>/dev/null
  36. curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo &>/dev/null
  37. fi
  38. }
  39. # *************************************************************************************************************
  40. Init_Hostname()
  41. {
  42. hostnamectl set-hostname elk-1
  43. echo "$ESIP elk-1" >> /etc/hosts
  44. }
  45. # *************************************************************************************************************
  46. Init_SElinux()
  47. {
  48. echo "关闭防火墙"
  49. systemctl stop firewalld
  50. systemctl disable firewalld
  51. echo "关闭selinux"
  52. setenforce 0
  53. sed -ri '/^SELINUX=/ s/enforcing/disabled/' /etc/selinux/config
  54. echo "解决sshd远程连接慢的问题"
  55. sed -ri '/^GSSAPIAu/ s/yes/no/' /etc/ssh/sshd_config
  56. sed -ri '/^#UseDNS/ {s/^#//;s/yes/no/}' /etc/ssh/sshd_config
  57. systemctl enable sshd crond &> /dev/null
  58. }
  59. # **************************************************************************************************************
  60. Create_UserLogFile()
  61. {
  62. groupadd elk
  63. useradd elk -g elk
  64. mkdir -pv /data/elk/{data,logs}
  65. chown -R elk:elk /data/
  66. }
  67. # **************************************************************************************************************
  68. Unpackaged_Authorization()
  69. {
  70. yum -y install ntpdate
  71. rpm -ivh /root/InstallELKB-Shell/jdk-8u121-linux-x64.rpm
  72. tar xvf /root/InstallELKB-Shell/elasticsearch-7.2.0-linux-x86_64.tar.gz -C /opt/
  73. chown -R elk:elk /opt/elasticsearch-7.2.0/
  74. ntpdate -b ntp1.aliyun.com
  75. }
  76. # **************************************************************************************************************
  77. Set_System_Parameter()
  78. {
  79. cat >> /etc/security/limits.conf <<EOF
  80. * soft nproc 2048
  81. * hard nproc 4096
  82. * soft nofile 65536
  83. * hard nofile 131072
  84. EOF
  85. echo "vm.max_map_count = 262144" >> /etc/sysctl.conf && sysctl -p
  86. cat >> /etc/profile <<EOF
  87. export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S "
  88. EOF
  89. source /etc/profile
  90. cat >> /opt/elasticsearch-7.2.0/config/elasticsearch.yml <<EOF
  91. cluster.name: elk
  92. node.name: node-1
  93. bootstrap.memory_lock: false
  94. path.data: /data/elk/data
  95. path.logs: /data/elk/logs
  96. network.host: 0.0.0.0
  97. http.port: 9200
  98. discovery.seed_hosts: ["elk-1"]
  99. cluster.initial_master_nodes: ["node-1"]
  100. EOF
  101. runuser -l elk -c '/bin/bash /opt/elasticsearch-7.2.0/bin/elasticsearch ' &> /opt/elasticsearch.log &
  102. }
  103. Test_Service()
  104. {
  105. esport=`ss -antp |grep :::9200 | awk -F::: '{print $2}'`
  106. if [ $esport -eq 9200 ];then
  107. echo -e "\033[32m Elasticsearch is OK... \033[0m "
  108. fi
  109. }
  110. # **********************PublicKeyKibana******************************************************************************
  111. PublicKeyKibana()
  112. {
  113. if [ ! -f /usr/bin/expect ];then
  114. yum -y install expect
  115. fi
  116. sed -i 's/# *StrictHostKeyChecking *ask/StrictHostKeyChecking no/g' /etc/ssh/ssh_config
  117. systemctl restart sshd
  118. cd /root/.ssh/
  119. ssh-keygen -t rsa -N '' -f id_rsa -q
  120. if [ $? -eq 0 ];then
  121. /usr/bin/expect <<-EOF
  122. set timeout 10
  123. spawn ssh-copy-id $KibanaIP
  124. expect {
  125. "yes/no" { send "yes\r"; exp_continue }
  126. "password:" { send "$KibanaPass\r"}
  127. }
  128. expect eof
  129. EOF
  130. fi
  131. }
  132. # **********************Kibana Deploy Script********************************************************************
  133. Install_Kibana()
  134. {
  135. echo $ESIP > /root/InstallELKB-Shell/ESIP.txt
  136. scp /root/InstallELKB-Shell/kibana-7.2.0-linux-x86_64.tar.gz $KibanaIP:
  137. scp /root/InstallELKB-Shell/ESIP.txt $KibanaIP:
  138. scp /root/InstallELKB-Shell/InstallKibana.sh $KibanaIP:
  139. ssh root@$KibanaIP '
  140. bash /root/InstallKibana.sh '
  141. }
  142. # *******************************************Filebeat Deploy Script***************************************************
  143. PublicFilebeat()
  144. {
  145. if [ ! -f /usr/bin/expect ];then
  146. yum -y install expect
  147. fi
  148. sed -i 's/# *StrictHostKeyChecking *ask/StrictHostKeyChecking no/g' /etc/ssh/ssh_config
  149. systemctl restart sshd
  150. cd /root/.ssh/
  151. rm -rf /root/.ssh/*
  152. ssh-keygen -t rsa -N '' -f id_rsa -q
  153. if [ $? -eq 0 ];then
  154. /usr/bin/expect <<-EOF
  155. set timeout 10
  156. spawn ssh-copy-id $FilebeatIP
  157. expect {
  158. "yes/no" { send "yes\r"; exp_continue }
  159. "password:" { send "$FilebeatPass\r"}
  160. }
  161. expect eof
  162. EOF
  163. fi
  164. }
  165. Install_Filebeat()
  166. {
  167. scp /root/InstallELKB-Shell/filebeat-7.2.0-x86_64.rpm $FilebeatIP:
  168. scp /root/InstallELKB-Shell/InstallFilebeat.sh $FilebeatIP:
  169. ssh root@$FilebeatIP 'bash /root/InstallFilebeat.sh'
  170. scp /root/InstallELKB-Shell/filebeat.yml $FilebeatIP:/etc/filebeat/
  171. ssh root@$FilebeatIP 'systemctl restart filebeat && systemctl disable filebeat && rm -rf /root/InstallFilebeat.sh'
  172. }
  173. # ********************************************Logstash******************************************************************
  174. Install_logstash()
  175. {
  176. tar xvf /root/InstallELKB-Shell/logstash-7.2.0.tar.gz -C /opt/
  177. cp /root/InstallELKB-Shell/nginx.yml /opt/logstash-7.2.0/
  178. /opt/logstash-7.2.0/bin/logstash -f /opt/logstash-7.2.0/nginx.yml &>/opt/logstash.log &
  179. }
  180. ES-StartUp_SelfStart()
  181. {
  182. cat >> /etc/init.d/elasticsearch.sh <<EOF
  183. nohup runuser -l elk -c '/bin/bash /opt/elasticsearch-7.2.0/bin/elasticsearch' &
  184. nohup /opt/logstash-7.2.0/bin/logstash -f /opt/nginx.yml &
  185. EOF
  186. echo "/etc/init.d/elasticsearch.sh" >> /etc/rc.d/rc.local
  187. chmod +x /etc/init.d/elasticsearch.sh
  188. chmod +x /etc/rc.d/rc.local
  189. }
  190. main() {
  191. #######Elasticsearch#######
  192. Read_Input
  193. Init_Yumsource
  194. Init_Hostname
  195. Init_SElinux
  196. Create_UserLogFile
  197. Unpackaged_Authorization
  198. Set_System_Parameter
  199. Test_Service
  200. #########Kibana###########
  201. PublicKeyKibana
  202. Install_Kibana
  203. ########Filebeat#########
  204. PublicFilebeat
  205. Install_Filebeat
  206. ES-StartUp_SelfStart
  207. Kibana-StartUp_SelfStart
  208. #######Logstash#########
  209. Install_logstash
  210. }
  211. main
Kibana.sh
  1. #!/usr/bin/env bash
  2. # ***************************************************************************************************
  3. # Author: ZhouJian
  4. # MaiBox: 18621048481@163.com
  5. # Data: 2019-9-7
  6. # Describe: CentOS 7 Deploy Kibana Script
  7. elastip=$(cat /root/ESIP.txt )
  8. if [ ! -d /opt/kibana-7.2.0-linux-x86_64 ];then
  9. tar xvf /root/kibana-7.2.0-linux-x86_64.tar.gz -C /opt/
  10. fi
  11. # ***************************************************************************************************
  12. init_yumsource()
  13. {
  14. if ! ping -c2 www.baidu.com &>/dev/null
  15. then
  16. echo "您无法上外网,不能配置yum源"
  17. exit
  18. fi
  19. echo "配置yum源"
  20. if [ ! -d /etc/yum.repos.d/backup ];then
  21. mkdir /etc/yum.repos.d/backup
  22. mv /etc/yum.repos.d/* /etc/yum.repos.d/backup 2>/dev/null
  23. curl -o /etc/yum.repos.d/163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo &>/dev/null
  24. curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo &>/dev/null
  25. yum -y install ntpdate
  26. ntpdate -b ntp1.aliyun.com
  27. fi
  28. }
  29. # ***************************************************************************************************
  30. init_SElinux()
  31. {
  32. echo "关闭防火墙"
  33. systemctl stop firewalld
  34. systemctl disable firewalld
  35. echo "关闭selinux"
  36. setenforce 0
  37. sed -ri '/^SELINUX=/ s/enforcing/disabled/' /etc/selinux/config
  38. echo "解决sshd远程连接慢的问题"
  39. sed -ri '/^GSSAPIAu/ s/yes/no/' /etc/ssh/sshd_config
  40. sed -ri '/^#UseDNS/ {s/^#//;s/yes/no/}' /etc/ssh/sshd_config
  41. systemctl enable sshd crond &> /dev/null
  42. }
  43. # ***************************************************************************************************
  44. SetKibanaParameter()
  45. {
  46. cat >> /opt/kibana-7.2.0-linux-x86_64/config/kibana.yml <<EOF
  47. server.host: "0.0.0.0"
  48. server.port: 5601
  49. elasticsearch.hosts: ["http://$elastip:9200"]
  50. EOF
  51. }
  52. # ***************************************************************************************************
  53. StartKibana()
  54. {
  55. /opt/kibana-7.2.0-linux-x86_64/bin/kibana --allow-root &>/opt/kibana.log &
  56. }
  57. Test_Service()
  58. {
  59. KibanaPort=` ss -antp | grep 5601 | awk '{print $4}' | awk -F*: '{print $NF}'`
  60. if [ $KibanaPort -eq 5601 ];then
  61. echo -e "\033[32m Kibana is OK... \033[0m "
  62. fi
  63. }
  64. DeleteUselessFiles()
  65. {
  66. rm -rf /root/kibana-7.2.0-linux-x86_64.tar.gz
  67. rm -rf /root/InstallKibana.sh
  68. rm -rf /root/ESIP.txt
  69. }
  70. Kibana-StartUp_SelfStart()
  71. {
  72. echo "nohup /opt/kibana-7.2.0-linux-x86_64/bin/kibana --allow-root &" >> /etc/init.d/kibana.sh
  73. echo "/bin/bash /etc/init.d/kibana.sh" >> /etc/rc.local
  74. chmod +x /etc/init.d/kibana.sh
  75. chmod +x /etc/rc.local
  76. }
  77. init_SElinux
  78. SetKibanaParameter
  79. StartKibana
  80. Test_Service
  81. DeleteUselessFiles
  82. Kibana-StartUp_SelfStart
Filebeat.sh
  1. #!/usr/bin/env bash # *************************************************************
  2. # Author: ZhouJian
  3. # Mail: 18621048481@163.com
  4. # Data: 2019-9-7
  5. # Describe: CentOS 7 Deploy Filebeat7.2 Script
  6. # *************************************************************
  7. Init_Yumsource()
  8. {
  9. if ! ping -c2 www.baidu.com &>/dev/null
  10. then
  11. echo "您无法上外网,不能配置yum源"
  12. exit
  13. fi
  14. echo "配置yum源"
  15. if [ ! -d /etc/yum.repos.d/backup ];then
  16. mkdir /etc/yum.repos.d/backup
  17. mv /etc/yum.repos.d/* /etc/yum.repos.d/backup 2>/dev/null
  18. curl -o /etc/yum.repos.d/163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo &>/dev/null
  19. curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo &>/dev/null
  20. yum -y install ntpdate
  21. ntpdate -b ntp1.aliyun.com
  22. fi
  23. }
  24. Init_SElinux()
  25. {
  26. echo "关闭防火墙"
  27. systemctl stop firewalld
  28. systemctl disable firewalld
  29. echo "关闭selinux"
  30. setenforce 0
  31. sed -i '/^SELINUX=/ s/enforcing/disabled/' /etc/selinux/config
  32. echo "解决sshd远程连接慢的问题"
  33. sed -i '/^GSSAPIAu/ s/yes/no/' /etc/ssh/sshd_config
  34. sed -i '/^#UseDNS/ {s/^#//;s/yes/no/}' /etc/ssh/sshd_config
  35. systemctl enable sshd crond &> /dev/null
  36. }
  37. Install_Filebeat()
  38. {
  39. yum -y install ntpdate
  40. ntpdate -b ntp1.aliyun.com
  41. rpm -ivh /root/filebeat-7.2.0-x86_64.rpm
  42. rm -rf /root/filebeat-7.2.0-x86_64.rpm
  43. }
  44. Init_Yumsource
  45. Init_SElinux
  46. Install_Filebeat

README.md

环境要求:
  1. # CentOS7
  2. # Javaa 1.8
IP hostname 软件 内存要求
192.168.122.3 elk-1 Elasticsearch、Logstash 2G及以上
192.168.122.4 Kibana Kibana 1G及以上
192.168.122.5 Filebeat Filebeat 1G及以上

注意事项

  1. # 1.一定要对时,时间校正,不然日志出不来;
  2. # 2.java包最好用openjdk;
  3. # 3.启动Elasticsearch必须切换成所创建的ELK用户启动,不然ES出于安全目的,会启动报错;
  4. # 4.日志从Filebeat到Logstash再到ES检索到Kibana的读取速度取决于机器配置,注意用
  5. # cat 日志文件* | wc -l 统计日志数量,然后到Elasticsearch去看总数量,确保日志都过来了在进行分析;
Elasticsearch安装

初始化

  1. curl -o /etc/yum.repos.d/163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo &>/dev/null
  2. curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
  3. yum -y install ntpdate
  4. ntpdate -b ntp1.aliyun.com

设置Hostname解析

  1. hostnamectl set-hostname elk-1
  2. ## 修改/etc/hosts 增加如下内容
  3. 192.168.122.3 elk-1

java安装

  1. # 安装java 1.8
  2. yum -y install java-1.8.0-openjdk.x86_64

关闭防火墙,SeLinux

  1. setenforce 0
  2. sed -i '/^SELINUX=/ s/enforcing/disabled/' /etc/selinux/config
  3. systemctl stop firewalld
  4. systemctl disable firewalld
  5. sed -i '/^GSSAPIAu/ s/yes/no/' /etc/ssh/sshd_config
  6. sed -i '/^#UseDNS/ {s/^#//;s/yes/no/}' /etc/ssh/sshd_config

创建用户和组

  1. # create user elk
  2. groupadd elk
  3. useradd elk -g elk

创建数据及日志文件并授权

  1. mkdir -pv /data/elk/{data,logs}
  2. chown -R elk:elk /data/elk/

软件包解压、授权

  1. # 上传软件包
  2. # 通过scp 或者FTP方式上传到/opt下
  3. # 解压软件包到/opt目录
  4. tar xvf elasticsearch-7.2.0-linux-x86_64.tar.gz -C /opt/
  5. # 授权
  6. chown -R elk:elk # 软件包名

elk-1配置文件

  1. # 集群名
  2. cluster.name: elk
  3. # 节点名
  4. node.name: node-1
  5. # 存储数据
  6. path.data: /data/elk/data
  7. # 存放日志
  8. path.logs: /data/elk/logs
  9. # 锁内存,尽量不使用交换内存
  10. bootstrap.memory_locak: false
  11. # 网络地址
  12. network.host: 0.0.0.0
  13. http.port: 9200
  14. # 发现集群hosts
  15. discovery.sead_hosts: ["elk-1"]
  16. # 设置集群master节点
  17. cluster.inital_master_nodes: ["node-1"]

修改/etc/security/limits.conf

  1. # *号不是注释
  2. * soft nofile 65536
  3. * hard nofile 131072
  4. * soft nproc 2048
  5. * hard nproc 4096

修改/etc/sysctl.conf

  1. echo "vm.max_map_count=262144" >> /etc/sysctl.conf
  2. sysctl -p

ES启动

  1. nohup runuser -l elk -c '/bin/bash /opt/elasticsearch-7.2.0/bin/elasticsearch' &

检查集群健康状态

  1. curl -XGET 'elk-1:9200/_cluster/health?pretty'
Kibana安装使用

解压Kibana安装包

  1. tar xvf kibana-7.2.0-linux-x86_64.tar.gz -C /opt/

修改Kibana配置文件

  1. vim /opt/kibana-7.2.0-linux-x86_64/config/kibana.yml
  2. server.port: 5601 # Port
  3. server.host: 0.0.0.0 # 访问限制
  4. elasticsearch.hosts: ["http://ESHostIP:9200"]

启动命令

  1. /opt/kibana-7.2.0-linux-x86_64/bin/kibana --allow-root
  2. nohup /opt/kibana-7.2.0-linux-x86_64/bin/kibana --allow-root & 放入后台使用
  3. tailf nohup.out # 实时查看服务运行状态
Filebeat 安装使用

下载安装

修改配置文件(修改/etc/filebeat/filebeat.yml)

  1. filebeat.inputs:
  2. - type: log
  3. enabled: true
  4. paths:
  5. - /var/log/*.log # 抓取文件日志路径
  6. # output.elasticsearch:
  7. # hosts: ["ESHostIP:9200"] # 输出到ES
Filebeat到Lostash

Filebeat配置

​ (vim /etc/filebeat/filebeat.yml) shift + : 输入set nu 显示行号

  1. 24: enabled: true # 更改为true以启用输入配置
  2. 28: - /var/log/*.log # 替换为要抓取的日志文件路径
  3. 73: reload.enabled: true # 启动Filebeat模块
  4. 148: output.elasticsearch: # 加上注释;
  5. 150: hosts: ["localhost:9200"] # 加上注释;
  6. 158: output.logstash: # 去掉注释;
  7. 160: hosts: ["localhost:5044"] # 去掉注释,并修改localhost为logstash机器IP及对应端口号;
测试配置文件并启动
  1. filebeat test config -e
  2. systemctl start filebeat
  3. systemctl enable filebeat

Logstash 安装使用

解压安装

​ 上传包

​ tar xvf logstash-7.2.0.tar.gz -C /opt/

启动
  1. /opt/logstash-7.2.0/bin/logstash -f /opt/配置文件名.yml
  2. ## 后台运行
  3. nohup /opt/logstash-7.2.0/bin/logstash -f /opt/配置文件名.yml &
Logstash到Elasticsearch

​ 主要看配置文件,配置文件对了,直接按照上面命令启动就可以了;

  1. # Sample Logstash configuration for creating a simple
  2. # Beats -> Logstash -> Elasticsearch pipeline.
  3. input {
  4. beats {
  5. port => 5044
  6. }
  7. }
  8. filter {
  9. grok {
  10. match => {
  11. "message" => " %{DATA:log_date} %{TIME:log_localtime} %{JAVAFILE:name_file} %{WORD:workd}\[%{WORD:ls}\]\: %{DATA:log_date2} %{TIME:log_localtime2} %{WORD:year_tmp}\: %{WORD:name_2}\: %{WORD:} %{WORD:}\, %{JAVAFILE:}\: %{JAVAFILE:app_id}\, %{WORD}\: %{IP:ip}\, %{WORD:}\: %{INT}\, %{WORD}\: %{USERNAME:device_id}"
  12. }
  13. }
  14. }
  15. output {
  16. elasticsearch {
  17. hosts => ["http://ElasticsearchHostIP:9200"]
  18. index => "nginx_log-%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
  19. }
  20. }

07 . ELK Stack一键多机部署脚本的更多相关文章

  1. 01 . ELK Stack简介原理及部署应用

    简介 ELK并不是一款软件,是一整套解决方案,是由ElasticSearch,Logstash和Kibana三个开源工具组成:通常是配合使用,而且先后归于Elastic.co公司名下,简称ELK协议栈 ...

  2. ELK Stack部署

    部署ELK Stack 官网:https://www.elastic.co 环境准备: ip hostname 服务 用户.组 192.168.20.3 node2003 kibana6.5,file ...

  3. 单个机器部署redis集群模式(一键部署脚本)

    一.检查机器是否安装gcc.unzip.wget 二.部署模式 #模式1: 将所有主从节点以及sentinel节点部署在同一台机器上 #模式2: 将一个数据节点和一个sentinel节点部署在一台机器 ...

  4. Kubernetes实战之部署ELK Stack收集平台日志

    主要内容 1 ELK概念 2 K8S需要收集哪些日志 3 ELK Stack日志方案 4 容器中的日志怎么收集 5 K8S平台中应用日志收集 准备环境 一套正常运行的k8s集群,kubeadm安装部署 ...

  5. 被一位读者赶超,手摸手 Docker 部署 ELK Stack

    被一位读者赶超,容器化部署 ELK Stack 你好,我是悟空. 被奇幻"催更" 最近有个读者,他叫"老王",外号"茴香豆泡酒",找我崔更 ...

  6. 源码编译安装Apache-附一键部署脚本

    1.进入apache官网https://www.apache.org/,点击Download 2.如图选择 3.选择httpd 4.下载两个包,2.2为CentOS6使用,2.4为CentOS7使用 ...

  7. shell脚本实例-mysql多机部署

    今天我给大家分享shell 安装mysql 多机部署的实例,本次实验是基于各个主机的公钥已经配置好了,如果还不会推送公钥的同学,可以看看我以前写的文章,那里面有写推公钥的实例,mysql 多机部署一般 ...

  8. ceph集群一键部署脚本

    分布式存储ceph相信大家比较熟悉了.某项目临时要做一个40个节点的存储集群.所以写了这个脚本. 一键部署脚本如下: git clone https://github.com/luckman666/d ...

  9. Linux 一键部署脚本

    在当前路径下输入 chmod 777 脚本名 给脚本授权, 然后就可以执行脚本 ./脚本名    777 是最高权限,有读.写.执行权限:和属组用户和其他用户的读.写.执行权限. 其他权限分别是 -r ...

随机推荐

  1. 选课系统<基于面向过程\对象>

    2020-04-15 00:09:28 程序目录: import os BASE_PATH=os.path.dirname(os.path.dirname(__file__)) DB_PATH=os. ...

  2. day36 解决粘包问题

    目录 一.tcp粘包问题出现的原因 二.解决粘包问题low的办法 三.egon式解决粘包问题 四.实现并发 1 tcp 2 udp 一.tcp粘包问题出现的原因 前引: tcp的客户端与服务端进行通信 ...

  3. 武汉中科通达软件Java工程师初试总结复盘

       预约的视频面试时间是中午12点,不过面试官并没有准时到,拖了大概5.6分钟吧.Zoom会议上写着xxxJava工程师初试. 面试官戴着口罩,并没有露脸,看起来与我年龄相仿,感觉很年轻. 在我按着 ...

  4. 数据可视化之powerBI入门(七)数据清洗中最常使用的十三招

    https://mp.weixin.qq.com/s?__biz=MzA4MzQwMjY4MA==&mid=2484067158&idx=1&sn=4ad955112df2f4 ...

  5. Python之爬虫(十九) Scrapy框架中Download Middleware用法

    这篇文章中写了常用的下载中间件的用法和例子.Downloader Middleware处理的过程主要在调度器发送requests请求的时候以及网页将response结果返回给spiders的时候,所以 ...

  6. 改造 layui 表格组件实现多重排序

    layui 的表格组件目前只支持单列排序,在实际应用中并不能很好的支撑我们的业务需求.今天一时手痒,决定改造一番以支持多重排序. 实现思路也比较简单,只需要用一个数组来存放所有排序的列,再把这个数组传 ...

  7. android studio 正式版打包错误的一个问题

    今日在下载了别人的demo后,编译到我的手机上,然后通过qq等把软件发到其他的手机上使用时,无法安装,好像是因为这个是调试版本才安装不上,在网搜了一堆资料怎么建key怎么发布正式的版本,问题现在已解决 ...

  8. 题解 洛谷 P2287 [USACO07NOV]Sunscreen G

    原题 传送门 有C个奶牛去晒太阳 (1 <=C <= 2500),每个奶牛各自能够忍受的阳光强度有一个最小值和一个最大值(minSPFi and maxSPFi),太大就晒伤了,太小奶牛没 ...

  9. 牛客练习赛 66B题解

    前言 当初思路 开始没想到异或这么多的性质,于是认为对于每个点\(u\),可以和它连边的点\(v\)的点权 \(a_v=a_u \oplus k\)(证明:\(\because\) \(a_u\opl ...

  10. 高效C++:设计与声明

    C++软件开发可以理解为设计一系列的类,让这些类相互使用,最终实现我们所需要的功能.类与类之间的相互关系可以很复杂,也可以很简单,如何简单高效的描述类与类之间的关系是设计的难点之一.遵循本文所提供的方 ...