This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ##this shell script is for new server's initial | |
| ##update | |
| yum groupinstall "Development Tools" -y && yum update -y && yum install epel-release -y && yum upgrade -y && yum install wget tar lrzsz htop tcpdump iotop iftop pcre pcre-devel | |
| echo "update is ok" | |
| apt-get install libsnmp-dev libiksemel-dev libxml2-dev libcurl3-dev libcurl4-openssl-dev libopenipmi-dev libssh2-1-dev unixodbc-dev libldap2-dev libpcre3 libpcre3-dev | |
| ##install zabbix_agent | |
| cd /opt/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 安装 | |
| yum install libnl-3-devel libnfnetlink-devel | |
| ./configure --with-init=systemd --prefix=/etc/keepalived/ --enable-profile --enable-mem-check | |
| make && make install | |
| systemctl unmask keepalived | |
| systemctl enable keepalived | |
| 配置文件keepalived.conf | |
| # Configuration File for keepalived | |
| global_defs { | |
| notification_email { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ###NOTE######## | |
| #data and config of Redis Cluster ## | |
| a=7001 | |
| while [ $a -le 7006 ] | |
| do | |
| cd $a | |
| cp /etc/redis/6666.conf $a.conf ##default.conf | |
| sed -i "s/6666/$a/g" $a.conf ##TIPS:must used "" insted of ' ' because of $ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| global | |
| # to have these messages end up in /var/log/haproxy.log you will | |
| # need to: | |
| # by adding the '-r' option to the SYSLOGD_OPTIONS in | |
| # /etc/sysconfig/syslog | |
| # | |
| # 2) configure local2 events to go to the /var/log/haproxy.log | |
| # file. A line like the following can be added to | |
| # /etc/sysconfig/syslog | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vrrp_instance VI_1 { #定义VRRP实例,实例名自定义 | |
| state MASTER #指定Keepalived的角色,MASTER为主服务器,BACKUP为备用服务器 | |
| interface eth0 #指定HA监测的接口 | |
| virtual_router_id 51 #虚拟路由标识(1-255),在一个VRRP实例中主备服务器ID必须一样 | |
| priority 100 #优先级,数字越大越优先,主服务器优先级必须高于备服务器 | |
| advert_int 1 #设置主备之间同步检查时间间隔,单位秒 | |
| authentication { #设置验证类型和密码 | |
| auth_type PASS #验证类型 | |
| auth_pass ab007 #设置验证密码,同一实例中主备密码要保持一致 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| server_name localhost; | |
| location / { | |
| root html; | |
| index index.php index.html index.htm; | |
| if (!-e $request_filename) { | |
| rewrite ^(.*)$ /index.php?s=$1 last; | |
| break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # This is a sample configuration. | |
| # | |
| ########Part 1 Global################################################## | |
| global | |
| maxconn 10000 ##默认最大连接数 | |
| stats socket /var/run/haproxy.stat mode 600 level admin | |
| log 127.0.0.1 local0 | |
| user haproxy | |
| group haproxy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # 1.定义基本变量 | |
| INET_IF="eth1" #外网接口 | |
| INET_IP="115.28.167.215" #外网接口地址 | |
| LAN_IF="eth0" #内网接口 | |
| LAN_IP="10.144.168.27" #内网接口地址 | |
| #LAN_NET="192.168.1.0/24" #内网网段 | |
| #LAN_WWW_IP="192.168.1.7" #网站服务器的内部地址 | |
| IPT="/sbin/iptables" #iptables命令的路径 | |
| MOD="/sbin/modprobe" #modprode命令的路径 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| #Name: redismontior.sh | |
| #From: zhangm412@126.com <2014/08/06> | |
| #Action: Zabbix monitoring redis plug-in | |
| REDISCLI="/usr/local/redis/src/redis-cli" | |
| HOST="192.168.1.50" | |
| PORT=6379 | |
| if [[ $# == 1 ]];then |