first commit
This commit is contained in:
commit
ba848e218d
1001 changed files with 152333 additions and 0 deletions
BIN
应用相关/LVS安装配置(DR).docx
Normal file
BIN
应用相关/LVS安装配置(DR).docx
Normal file
Binary file not shown.
255
应用相关/RabbitMQ集群安装配置.md
Normal file
255
应用相关/RabbitMQ集群安装配置.md
Normal file
|
@ -0,0 +1,255 @@
|
|||
RabbitMQ集群安装配置
|
||||
环境:
|
||||
|
||||
CentOS 6.5 x64
|
||||
|
||||
otp_src_19.1.tar.gz
|
||||
|
||||
rabbitmq-server-generic-unix-3.6.6.tar.xz
|
||||
|
||||
集群信息:
|
||||
|
||||
①节点1:172.16.4.93 主机名:SHVM-RMQ01-4-93
|
||||
|
||||
②节点2:172.16.4.94 主机名:SHVM-RMQ02-4-94
|
||||
|
||||
③节点3:172.16.4.95 主机名:SHVM-RMQ03-4-95
|
||||
|
||||
|
||||
|
||||
准备工作
|
||||
|
||||
注意:所有以下步骤在三台主机上都要操作
|
||||
|
||||
①配置本地解析
|
||||
|
||||
在/etc/hosts中添加对三台主机的解析,如下(ip都为各主机对应主机名):
|
||||
|
||||
172.16.4.93 SHVM-RMQ01-4-93
|
||||
172.16.4.94 SHVM-RMQ02-4-94
|
||||
172.16.4.95 SHVM-RMQ03-4-95
|
||||
|
||||
②关闭selinux
|
||||
|
||||
setenfore 0
|
||||
③开放15672,25672,5672,5671,4369端口
|
||||
|
||||
编辑/etc/sysconfig/iptables,添加如下:
|
||||
|
||||
-A INPUT -m state --state NEW -m tcp -p tcp --dport 4369 -j ACCEPT
|
||||
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5671 -j ACCEPT
|
||||
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5672 -j ACCEPT
|
||||
-A INPUT -m state --state NEW -m tcp -p tcp --dport 15672 -j ACCEPT
|
||||
-A INPUT -m state --state NEW -m tcp -p tcp --dport 25672 -j ACCEPT
|
||||
④安装依赖及编译环境
|
||||
|
||||
yum -y install install make gcc gcc-c++ kernel-devel ncurses ncurses-devel openssl openssl-devel unixODBC unixODBC-devel perl
|
||||
⑤新建用户
|
||||
|
||||
useradd -u 1880 -g 1500 rmq
|
||||
|
||||
|
||||
安装配置erlang
|
||||
|
||||
注意:所有以下步骤在三台主机上都要操作
|
||||
|
||||
①解压
|
||||
|
||||
tar -xf otp_src_19.1.tar.gz
|
||||
②编译安装erlang
|
||||
|
||||
cd otp_src_19.1
|
||||
./configure --prefix=/usr/local/erlang --with-ssl
|
||||
make && make install
|
||||
③配置环境变量
|
||||
|
||||
编辑/etc/profile,在最后添加如下行:
|
||||
|
||||
ERLANG_HOME=/usr/local/erlang
|
||||
PATH=$PATH:$ERLANG_HOME/bin
|
||||
export PATH
|
||||
④测试erlang
|
||||
|
||||
erl
|
||||
如果出现类似下图的情况,说明erlang安装成功
|
||||
|
||||
|
||||
|
||||
退出方法:Ctrl+c,然后输入a,回车
|
||||
|
||||
如果不成功,请检查erlang编译安装是否有问题,环境变量是否配置正确
|
||||
|
||||
|
||||
|
||||
安装配置rabbitMQ
|
||||
|
||||
注意:所有以下步骤在三台主机上都要操作
|
||||
|
||||
①解压
|
||||
|
||||
xz -d rabbitmq-server-generic-unix-3.6.6.tar.xz
|
||||
tar -xf rabbitmq-server-generic-unix-3.6.6.tar
|
||||
②配置环境变量
|
||||
|
||||
编辑/home/rmq/.bash_profile,添加如下行:
|
||||
|
||||
RMQ_HOME=/opt/appl/rabbitmq/rmq
|
||||
PATH=$PATH:$RMQ_HOME/sbin
|
||||
export PATH
|
||||
cd $RMQ_HOME
|
||||
③切换到rmq用户,测试erl是否正常
|
||||
|
||||
sudo su - rmq
|
||||
erl
|
||||
如果提示找不到这个命令,尝试修改/usr/local/erlang/lib/erlang/bin目录权限为755解决。
|
||||
|
||||
因为erl这个文件是/usr/local/erlang/lib/erlang/bin/erl的链接文件。
|
||||
|
||||
④安装web管理界面
|
||||
|
||||
rabbitmq-plugins enable rabbitmq_management
|
||||
|
||||
|
||||
配置rabbitMQ集群
|
||||
|
||||
①设置.erlang.cookie
|
||||
|
||||
用节点1中的/home/rmq/.erlang.cookie文件中的值替换其他两个节点相同文件中的值
|
||||
|
||||
②停止rabbitMQ,并后台启动
|
||||
|
||||
rabbitmqctl stop
|
||||
rabbitmq-server -detached
|
||||
③将节点2,节点3于节点1组成集群
|
||||
|
||||
节点2:
|
||||
|
||||
rabbitmqctl stop_app
|
||||
rabbitmqctl join_cluster rabbit@SHVM-RMQ01-4-93
|
||||
rabbitmqctl start_app
|
||||
节点3:
|
||||
|
||||
rabbitmqctl stop_app
|
||||
rabbitmqctl join_cluster rabbit@SHVM-RMQ01-4-93
|
||||
rabbitmqctl start_app
|
||||
④测试集群是否配置成功
|
||||
|
||||
rabbitmqctl cluster_status
|
||||
⑤设置镜像队列策略(任一个节点执行都可以)
|
||||
|
||||
rabbitmqctl set_policy ha-all "^" '{"ha-mode":"all"}'
|
||||
|
||||
|
||||
配置HAProxy
|
||||
|
||||
安装haproxy,修改 /etc/haproxy/haproxy.cfg
|
||||
|
||||
listen rabbitmq_cluster 0.0.0.0:5672
|
||||
|
||||
mode tcp
|
||||
balance roundrobin
|
||||
|
||||
server node1 172.16.4.93:5672 check inter 2000 rise 2 fall 3
|
||||
server node2 172.16.4.94:5672 check inter 2000 rise 2 fall 3
|
||||
server node2 172.16.4.95:5672 check inter 2000 rise 2 fall 3
|
||||
|
||||
|
||||
|
||||
|
||||
登录rabbitMQ后台监控
|
||||
|
||||
默认已经有一个guest的管理员用户(密码:guest),但是这个用户不能远程登录,只能在本机访问登录,所以必须添加一个用户可以远程登录
|
||||
|
||||
①添加admin用户
|
||||
|
||||
rabbitmqctl add_user admin rabbitmq
|
||||
②赋予权限
|
||||
|
||||
rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"
|
||||
③修改角色
|
||||
|
||||
rabbitmqctl set_user_tags admin administrator
|
||||
④远程登录后台
|
||||
|
||||
通过http://172.16.4.93:15672 http://172.16.4.94:15672 http://172.16.4.95:15672 访问各节点
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
其他一些命令与说明
|
||||
|
||||
应用和集群管理(先启动集群各个服务,再启动应用)
|
||||
1.停止RabbitMQ应用,关闭节点
|
||||
# rabbitmqctl stop
|
||||
2.停止RabbitMQ应用
|
||||
# rabbitmqctl stop_app
|
||||
3.启动RabbitMQ应用
|
||||
# rabbitmqctl start_app
|
||||
4.显示RabbitMQ中间件各种信息
|
||||
# rabbitmqctl status
|
||||
5.重置RabbitMQ节点
|
||||
# rabbitmqctl reset
|
||||
# rabbitmqctl force_reset
|
||||
6.查看所有队列信息
|
||||
# rabbitmqctl list_queues
|
||||
7.启动服务
|
||||
# rabbitmq-server –detached
|
||||
8.查看集群状态
|
||||
# rabbitmqctl cluster_status
|
||||
9.Binding信息
|
||||
# rabbitmqctl list_bindings
|
||||
10.Connection信息
|
||||
# rabbitmqctl list_connections
|
||||
11.Exchange信息
|
||||
# rabbitmqctl list_exchanges
|
||||
12.后台启动所有服务
|
||||
# rabbitmq-server -detached
|
||||
13.查看队列
|
||||
# rabbitmqctl list_policies
|
||||
|
||||
14.开启某个插件
|
||||
#rabbitmq-plugins enable xxx
|
||||
15.关闭某个插件
|
||||
#rabbitmq-plugins disable xxx
|
||||
16.新建用户
|
||||
#rabbitmqctl add_user xxx pwd
|
||||
17.删除用户
|
||||
#rabbitmqctl delete_user xxx
|
||||
18.修改密码
|
||||
#rabbimqctl change_password {username} {newpassword}
|
||||
19.设置用户角色
|
||||
#rabbitmqctl set_user_tags {username} {tag ...}
|
||||
Tag可以为 administrator,monitoring, management
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
RabbitMQ端口说明
|
||||
端口:4369 、5672、5671 、25672、15672 、61613、61614 、1883、8883
|
||||
4369 (epmd)
|
||||
5672, 5671 (AMQP 0-9-1 and 1.0 without and with TLS)
|
||||
25672. This port used by Erlang distribution for inter-node and CLI tools communication and is allocated from a dynamic range (limited to a single port by default, computed as AMQP port + 20000). See networking guide for details.
|
||||
15672 (if management plugin is enabled)
|
||||
61613, 61614 (if STOMP is enabled)
|
||||
1883, 8883 (if MQTT is enabled)
|
||||
|
||||
|
||||
HAProxy常用的算法有如下8种:
|
||||
balance roundrobin,表示简单的轮询,建议关注;
|
||||
balance static-rr,表示根据权重,建议关注;
|
||||
balance leastconn,表示最少连接者先处理,建议关注;
|
||||
balance source,表示根据请求源IP,跟Nginx的ip_hash算法相似,建议关注;
|
||||
balance uri,表示根据请求的URI;
|
||||
balance url_param,表示根据请求的URl参数;
|
||||
balance hdr(name),表示根据HTTP请求头来锁定每一次HTTP请求;
|
||||
balance rdp-cookie(name),表示根据据cookie(name)来锁定并哈希每一次TCP请求。
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
登录rabbitMQ后台监控
|
||||
|
||||
默认已经有一个guest的管理员用户(密码:guest),但是这个用户不能远程登录,只能在本机访问登录,所以必须添加一个用户可以远程登录
|
BIN
应用相关/keepalived安装配置.docx
Normal file
BIN
应用相关/keepalived安装配置.docx
Normal file
Binary file not shown.
337
应用相关/nginx-keepalive主从双机热备-自动切换解决方案.html
Normal file
337
应用相关/nginx-keepalive主从双机热备-自动切换解决方案.html
Normal file
|
@ -0,0 +1,337 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="tool" content="leanote-desktop-app">
|
||||
<title>nginx+keepalive主从双机热备+自动切换解决方案</title>
|
||||
<style>
|
||||
|
||||
*{font-family:"lucida grande","lucida sans unicode",lucida,helvetica,"Hiragino Sans GB","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/*公用文字样式*/
|
||||
h1{font-size:30px}h2{font-size:24px}h3{font-size:18px}h4{font-size:14px}
|
||||
.note-container{
|
||||
width:850px;
|
||||
margin:auto;
|
||||
padding: 10px 20px;
|
||||
box-shadow: 1px 1px 10px #eee;
|
||||
}
|
||||
#title {
|
||||
margin: 0;
|
||||
}
|
||||
table {
|
||||
margin-bottom: 16px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table th, table td {
|
||||
padding: 6px 13px;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
table th {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table tr {
|
||||
background-color: none;
|
||||
border-top: 1px solid #ccc;
|
||||
}
|
||||
table tr:nth-child(2n) {
|
||||
background-color: rgb(247, 247, 249);
|
||||
}
|
||||
.mce-item-table, .mce-item-table td, .mce-item-table th, .mce-item-table caption {
|
||||
border: 1px solid #ddd;
|
||||
border-collapse: collapse;
|
||||
padding: 6px 13px;
|
||||
}
|
||||
blockquote {
|
||||
border-left-width:10px;
|
||||
background-color:rgba(128,128,128,0.05);
|
||||
border-top-right-radius:5px;
|
||||
border-bottom-right-radius:5px;
|
||||
padding:15px 20px;
|
||||
border-left:5px solid rgba(128,128,128,0.075);
|
||||
}
|
||||
blockquote p {
|
||||
margin-bottom:1.1em;
|
||||
font-size:1em;
|
||||
line-height:1.45
|
||||
}
|
||||
blockquote ul:last-child,blockquote ol:last-child {
|
||||
margin-bottom:0
|
||||
}
|
||||
pre {
|
||||
padding: 18px;
|
||||
background-color: #f7f7f9;
|
||||
border: 1px solid #e1e1e8;
|
||||
border-radius: 3px;
|
||||
display: block;
|
||||
}
|
||||
code {
|
||||
padding: 2px 4px;
|
||||
font-size: 90%;
|
||||
color: #c7254e;
|
||||
white-space: nowrap;
|
||||
background-color: #f9f2f4;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.footnote {
|
||||
vertical-align: top;
|
||||
position: relative;
|
||||
top: -0.5em;
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin:2em 0
|
||||
}
|
||||
img {
|
||||
max-width:100%
|
||||
}
|
||||
pre {
|
||||
word-break:break-word
|
||||
}
|
||||
p,pre,pre.prettyprint,blockquote {
|
||||
margin:0 0 1.1em
|
||||
}
|
||||
hr {
|
||||
margin:2em 0
|
||||
}
|
||||
img {
|
||||
max-width:100%
|
||||
}
|
||||
.sequence-diagram,.flow-chart {
|
||||
text-align:center;
|
||||
margin-bottom:1.1em
|
||||
}
|
||||
.sequence-diagram text,.flow-chart text {
|
||||
font-size:15px !important;
|
||||
font-family:"Source Sans Pro",sans-serif !important
|
||||
}
|
||||
.sequence-diagram [fill="#ffffff"],.flow-chart [fill="#ffffff"] {
|
||||
fill:#f6f6f6
|
||||
}
|
||||
.sequence-diagram [stroke="#000000"],.flow-chart [stroke="#000000"] {
|
||||
stroke:#3f3f3f
|
||||
}
|
||||
.sequence-diagram text[stroke="#000000"],.flow-chart text[stroke="#000000"] {
|
||||
stroke:none
|
||||
}
|
||||
.sequence-diagram [fill="#000"],.flow-chart [fill="#000"],.sequence-diagram [fill="#000000"],.flow-chart [fill="#000000"],.sequence-diagram [fill="black"],.flow-chart [fill="black"] {
|
||||
fill:#3f3f3f
|
||||
}
|
||||
ul,ol {
|
||||
margin-bottom:1.1em
|
||||
}
|
||||
ul ul,ol ul,ul ol,ol ol {
|
||||
margin-bottom:1.1em
|
||||
}
|
||||
kbd {
|
||||
padding:.1em .6em;
|
||||
border:1px solid rgba(63,63,63,0.25);
|
||||
-webkit-box-shadow:0 1px 0 rgba(63,63,63,0.25);
|
||||
box-shadow:0 1px 0 rgba(63,63,63,0.25);
|
||||
font-size:.7em;
|
||||
font-family:sans-serif;
|
||||
background-color:#fff;
|
||||
color:#333;
|
||||
border-radius:3px;
|
||||
display:inline-block;
|
||||
margin:0 .1em;
|
||||
white-space:nowrap
|
||||
}
|
||||
.toc ul {
|
||||
list-style-type:none;
|
||||
margin-bottom:15px
|
||||
}
|
||||
</style>
|
||||
<!-- 该css供自定义样式 -->
|
||||
<link href="../leanote-html.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="note-container">
|
||||
<h1 class="title" id="leanote-title">nginx+keepalive主从双机热备+自动切换解决方案</h1>
|
||||
<div class="content-html" id="leanote-content"><p>环境采集cenots 6.3 64位迷你安装,因为安装前,你需要做一些工作</p><pre id="leanote_ace_1480070528557_0" class="ace-tomorrow">yum install -y make wget</pre><p>如果你愿意可以更新下系统,更换下yum源.</p><h3>1.安装keepalive</h3><p>官方最新版 keepalived-1.2.7 </p><pre id="leanote_ace_1480070528573_0" class="ace-tomorrow">tar zxvf keepalived-1.2.7.tar.gz
|
||||
cd keepalived-1.2.7</pre><p>在此之前。请安装一下一些简单的工具 </p><pre id="leanote_ace_1480070528584_0" class="ace-tomorrow">yum install -y gcc openssl-devel popt-devel</pre><p>不然会编译不成功的。然后:</p><pre id="leanote_ace_1480070528593_0" class="ace-tomorrow ace_focus">./configure
|
||||
make && make install
|
||||
|
||||
cp /usr/local/etc/rc.d/init.d/keepalived /etc/init.d/
|
||||
cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/
|
||||
chmod +x /etc/init.d/keepalived
|
||||
chkconfig --add keepalived
|
||||
chkconfig keepalived on
|
||||
mkdir /etc/keepalived
|
||||
ln -s /usr/local/sbin/keepalived /usr/sbin/</pre><h3>2.安装<a title="Nginx" href="http://www.linuxde.net/tag/nginx" target="_blank" data-mce-href="http://www.linuxde.net/tag/nginx">Nginx</a> </h3><pre id="leanote_ace_1480070528614_0" class="ace-tomorrow">tar zxvf nginx-1.2.5.tar.gz
|
||||
cd nginx-1.2.5</pre><p>安装一下相关组件.</p><pre id="leanote_ace_1480070528627_0" class="ace-tomorrow">yum install -y pcre-devel
|
||||
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module
|
||||
make && make install</pre><h3>3.配置keepalive</h3><p>两台服务器端keepalived.conf内容都为如下,都设置为backup,不抢占,注意修改优先级不同,更详细的keepalived配置文件说明可以执行<a title="man命令" href="http://man.linuxde.net/man" target="_blank" data-mce-href="http://man.linuxde.net/man">man</a> keepalived.conf查看:</p><pre id="leanote_ace_1480070528640_0" class="ace-tomorrow">! Configuration file for keepalived
|
||||
global_defs {
|
||||
notification_email {
|
||||
admin@lvtao.net
|
||||
}
|
||||
notification_email_from admin@lvtao.net
|
||||
smtp_server 127.0.0.1
|
||||
smtp_connect_timeout 30
|
||||
router_id LVS_DEVEL
|
||||
}
|
||||
#监控服务.NGINX mysql等
|
||||
vrrp_script chk_nginx {
|
||||
script "/home/check_nginx.sh"
|
||||
interval 2
|
||||
weight 2
|
||||
}
|
||||
|
||||
vrrp_instance VI_1 {
|
||||
state BACKUP #主从设置 MASTER
|
||||
interface eth2 #网卡名
|
||||
virtual_router_id 51
|
||||
mcast_src_ip 10.0.1.133 #本机ip
|
||||
priority 50 #从机小于主机
|
||||
advert_int 1
|
||||
authentication {
|
||||
auth_type PASS
|
||||
auth_pass chtopnet
|
||||
}
|
||||
virtual_ipaddress {
|
||||
10.0.1.2 #VIP 的IP
|
||||
}
|
||||
track_script {
|
||||
chk_nginx #检测脚本
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
virtual_server 10.0.1.2 80 {
|
||||
delay_loop 6
|
||||
lb_algo rr
|
||||
lb_kind DR
|
||||
persistence_timeout 50
|
||||
protocol TCP
|
||||
|
||||
real_server 10.0.1.132 80 {
|
||||
weight 3
|
||||
TCP_CHECK {
|
||||
connect_timeout 10
|
||||
nb_get_retry 3
|
||||
delay_before_retry 3
|
||||
connect_port 80
|
||||
}
|
||||
}
|
||||
real_server 10.0.1.133 80 {
|
||||
weight 3
|
||||
TCP_CHECK {
|
||||
connect_timeout 10
|
||||
nb_get_retry 3
|
||||
delay_before_retry 3
|
||||
connect_port 80
|
||||
}
|
||||
}
|
||||
}</pre><p>启动相关服务。我在这儿使用的是nginx ,每个上面开了一个站点,通过IP可以直接访问的。启动keepalive后,就可以通过VIP的虚拟IP 10.0.1.2来访问站点了,测试方法就是 停止任何其中一个站点,看它是否能自动切换到从服务器上。</p><p>上面代码中 nginx的检测脚本如下 :</p><pre id="leanote_ace_1480070528660_0" class="ace-tomorrow">#!/bin/bash
|
||||
if [ "$(ps -ef | grep "nginx: master process"| grep -v grep )" == "" ]
|
||||
then
|
||||
/usr/local/nginx/sbin/nginx
|
||||
sleep 5
|
||||
if [ "$(ps -ef | grep "nginx: master process"| grep -v grep )" == "" ]
|
||||
then
|
||||
killall keepalived
|
||||
fi
|
||||
fi</pre><p>在两台Web Server上执行realserver.sh脚本,为lo:0绑定VIP地址10.0.1.2、抑制<a title="arp命令" href="http://man.linuxde.net/arp" target="_blank" data-mce-href="http://man.linuxde.net/arp">arp</a>广播。</p><pre id="leanote_ace_1480070528673_0" class="ace-tomorrow">#!/bin/bash
|
||||
#description: Config realserver
|
||||
|
||||
VIP=10.0.1.2
|
||||
|
||||
/etc/rc.d/init.d/functions
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
/sbin/ifconfig lo:0 $VIP netmask 255.255.255.255 broadcast $VIP
|
||||
/sbin/route add -host $VIP dev lo:0
|
||||
echo "1" >/proc/sys/net/ipv4/conf/lo/arp_ignore
|
||||
echo "2" >/proc/sys/net/ipv4/conf/lo/arp_announce
|
||||
echo "1" >/proc/sys/net/ipv4/conf/all/arp_ignore
|
||||
echo "2" >/proc/sys/net/ipv4/conf/all/arp_announce
|
||||
sysctl -p >/dev/null 2>&1
|
||||
echo "RealServer Start OK"
|
||||
;;
|
||||
stop)
|
||||
/sbin/ifconfig lo:0 down
|
||||
/sbin/route del $VIP >/dev/null 2>&1
|
||||
echo "0" >/proc/sys/net/ipv4/conf/lo/arp_ignore
|
||||
echo "0" >/proc/sys/net/ipv4/conf/lo/arp_announce
|
||||
echo "0" >/proc/sys/net/ipv4/conf/all/arp_ignore
|
||||
echo "0" >/proc/sys/net/ipv4/conf/all/arp_announce
|
||||
echo "RealServer Stoped"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0</pre><p>分别在主从机上执行 sh realserver.sh start 就可实现负载均衡及高可用集群了;</p><h3>keepalive相关参数说明</h3><pre id="leanote_ace_1480070528686_0" class="ace-tomorrow"> ! Configuration File for keepalived
|
||||
|
||||
global_defs {
|
||||
notification_email {
|
||||
admin@lvtao.net #设置报警邮件地址,可以设置多个,每行一个。 需开启本机的sendmail服务
|
||||
}
|
||||
notification_email_from admin@lvtao.net #设置邮件的发送地址
|
||||
smtp_server 127.0.0.1 #设置smtp server地址
|
||||
smtp_connect_timeout 30 #设置连接smtp server的超时时间
|
||||
router_id LVS_DEVEL #表示运行keepalived服务器的一个标识。发邮件时显示在邮件主题的信息
|
||||
}
|
||||
|
||||
vrrp_instance VI_1 {
|
||||
state MASTER #指定keepalived的角色,MASTER表示此主机是主服务器,BACKUP表示此主机是备用服务器
|
||||
interface eth0 #指定HA监测网络的接口
|
||||
virtual_router_id 51 #虚拟路由标识,这个标识是一个数字,同一个vrrp实例使用唯一的标识。即同一vrrp_instance下,MASTER和BACKUP必须是一致的
|
||||
priority 100 #定义优先级,数字越大,优先级越高,在同一个vrrp_instance下,MASTER的优先级必须大于BACKUP的优先级
|
||||
advert_int 1 #设定MASTER与BACKUP负载均衡器之间同步检查的时间间隔,单位是秒
|
||||
authentication { #设置验证类型和密码
|
||||
auth_type PASS #设置验证类型,主要有PASS和AH两种
|
||||
auth_pass 1111 #设置验证密码,在同一个vrrp_instance下,MASTER与BACKUP必须使用相同的密码才能正常通信
|
||||
}
|
||||
virtual_ipaddress { #设置虚拟IP地址,可以设置多个虚拟IP地址,每行一个
|
||||
10.0.0.148
|
||||
}
|
||||
}
|
||||
|
||||
virtual_server 10.0.0.148 80 { #设置虚拟服务器,需要指定虚拟IP地址和服务端口,IP与端口之间用空格隔开
|
||||
delay_loop 6 #设置运行情况检查时间,单位是秒
|
||||
lb_algo rr #设置负载调度算法,这里设置为rr,即轮询算法
|
||||
lb_kind DR #设置LVS实现负载均衡的机制,有NAT、TUN、DR三个模式可选
|
||||
persistence_timeout 50 #会话保持时间,单位是秒。这个选项对动态网页是非常有用的,为集群系统中的session共享提供了一个很好的解决方案。
|
||||
#有了这个会话保持功能,用户的请求会被一直分发到某个服务节点,直到超过这个会话的保持时间。
|
||||
#需要注意的是,这个会话保持时间是最大无响应超时时间,也就是说,用户在操作动态页面时,如果50秒内没有执行任何操作,
|
||||
#那么接下来的操作会被分发到另外的节点,但是如果用户一直在操作动态页面,则不受50秒的时间限制
|
||||
protocol TCP #指定转发协议类型,有TCP和UDP两种
|
||||
|
||||
real_server 10.0.0.137 80 { #配置服务节点1,需要指定real server的真实IP地址和端口,IP与端口之间用空格隔开
|
||||
weight 3 #配置服务节点的权值,权值大小用数字表示,数字越大,权值越高,设置权值大小可以为不同性能的服务器
|
||||
#分配不同的负载,可以为性能高的服务器设置较高的权值,而为性能较低的服务器设置相对较低的权值,这样才能合理地利用和分配系统资源
|
||||
TCP_CHECK { #realserver的状态检测设置部分,单位是秒
|
||||
connect_timeout 10 #表示3秒无响应超时
|
||||
nb_get_retry 3 #表示重试次数
|
||||
delay_before_retry 3 #表示重试间隔
|
||||
connect_port 80
|
||||
}
|
||||
}
|
||||
real_server 10.0.0.139 80 {
|
||||
weight 3
|
||||
TCP_CHECK {
|
||||
connect_timeout 10
|
||||
nb_get_retry 3
|
||||
delay_before_retry 3
|
||||
connect_port 80
|
||||
}
|
||||
}
|
||||
}</pre><p><br></p></div>
|
||||
</div>
|
||||
|
||||
<!-- 该js供其它处理 -->
|
||||
<script src="../leanote-html.js"></script>
|
||||
</body>
|
||||
</html>
|
349
应用相关/基于Keepalived-Haproxy搭建四层负载均衡器.html
Normal file
349
应用相关/基于Keepalived-Haproxy搭建四层负载均衡器.html
Normal file
|
@ -0,0 +1,349 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="tool" content="leanote-desktop-app">
|
||||
<title>基于Keepalived+Haproxy搭建四层负载均衡器</title>
|
||||
<style>
|
||||
|
||||
*{font-family:"lucida grande","lucida sans unicode",lucida,helvetica,"Hiragino Sans GB","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/*公用文字样式*/
|
||||
h1{font-size:30px}h2{font-size:24px}h3{font-size:18px}h4{font-size:14px}
|
||||
.note-container{
|
||||
width:850px;
|
||||
margin:auto;
|
||||
padding: 10px 20px;
|
||||
box-shadow: 1px 1px 10px #eee;
|
||||
}
|
||||
#title {
|
||||
margin: 0;
|
||||
}
|
||||
table {
|
||||
margin-bottom: 16px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table th, table td {
|
||||
padding: 6px 13px;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
table th {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table tr {
|
||||
background-color: none;
|
||||
border-top: 1px solid #ccc;
|
||||
}
|
||||
table tr:nth-child(2n) {
|
||||
background-color: rgb(247, 247, 249);
|
||||
}
|
||||
.mce-item-table, .mce-item-table td, .mce-item-table th, .mce-item-table caption {
|
||||
border: 1px solid #ddd;
|
||||
border-collapse: collapse;
|
||||
padding: 6px 13px;
|
||||
}
|
||||
blockquote {
|
||||
border-left-width:10px;
|
||||
background-color:rgba(128,128,128,0.05);
|
||||
border-top-right-radius:5px;
|
||||
border-bottom-right-radius:5px;
|
||||
padding:15px 20px;
|
||||
border-left:5px solid rgba(128,128,128,0.075);
|
||||
}
|
||||
blockquote p {
|
||||
margin-bottom:1.1em;
|
||||
font-size:1em;
|
||||
line-height:1.45
|
||||
}
|
||||
blockquote ul:last-child,blockquote ol:last-child {
|
||||
margin-bottom:0
|
||||
}
|
||||
pre {
|
||||
padding: 18px;
|
||||
background-color: #f7f7f9;
|
||||
border: 1px solid #e1e1e8;
|
||||
border-radius: 3px;
|
||||
display: block;
|
||||
}
|
||||
code {
|
||||
padding: 2px 4px;
|
||||
font-size: 90%;
|
||||
color: #c7254e;
|
||||
white-space: nowrap;
|
||||
background-color: #f9f2f4;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.footnote {
|
||||
vertical-align: top;
|
||||
position: relative;
|
||||
top: -0.5em;
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin:2em 0
|
||||
}
|
||||
img {
|
||||
max-width:100%
|
||||
}
|
||||
pre {
|
||||
word-break:break-word
|
||||
}
|
||||
p,pre,pre.prettyprint,blockquote {
|
||||
margin:0 0 1.1em
|
||||
}
|
||||
hr {
|
||||
margin:2em 0
|
||||
}
|
||||
img {
|
||||
max-width:100%
|
||||
}
|
||||
.sequence-diagram,.flow-chart {
|
||||
text-align:center;
|
||||
margin-bottom:1.1em
|
||||
}
|
||||
.sequence-diagram text,.flow-chart text {
|
||||
font-size:15px !important;
|
||||
font-family:"Source Sans Pro",sans-serif !important
|
||||
}
|
||||
.sequence-diagram [fill="#ffffff"],.flow-chart [fill="#ffffff"] {
|
||||
fill:#f6f6f6
|
||||
}
|
||||
.sequence-diagram [stroke="#000000"],.flow-chart [stroke="#000000"] {
|
||||
stroke:#3f3f3f
|
||||
}
|
||||
.sequence-diagram text[stroke="#000000"],.flow-chart text[stroke="#000000"] {
|
||||
stroke:none
|
||||
}
|
||||
.sequence-diagram [fill="#000"],.flow-chart [fill="#000"],.sequence-diagram [fill="#000000"],.flow-chart [fill="#000000"],.sequence-diagram [fill="black"],.flow-chart [fill="black"] {
|
||||
fill:#3f3f3f
|
||||
}
|
||||
ul,ol {
|
||||
margin-bottom:1.1em
|
||||
}
|
||||
ul ul,ol ul,ul ol,ol ol {
|
||||
margin-bottom:1.1em
|
||||
}
|
||||
kbd {
|
||||
padding:.1em .6em;
|
||||
border:1px solid rgba(63,63,63,0.25);
|
||||
-webkit-box-shadow:0 1px 0 rgba(63,63,63,0.25);
|
||||
box-shadow:0 1px 0 rgba(63,63,63,0.25);
|
||||
font-size:.7em;
|
||||
font-family:sans-serif;
|
||||
background-color:#fff;
|
||||
color:#333;
|
||||
border-radius:3px;
|
||||
display:inline-block;
|
||||
margin:0 .1em;
|
||||
white-space:nowrap
|
||||
}
|
||||
.toc ul {
|
||||
list-style-type:none;
|
||||
margin-bottom:15px
|
||||
}
|
||||
</style>
|
||||
<!-- 该css供自定义样式 -->
|
||||
<link href="../leanote-html.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="note-container">
|
||||
<h1 class="title" id="leanote-title">基于Keepalived+Haproxy搭建四层负载均衡器</h1>
|
||||
<div class="content-html" id="leanote-content"><h2>一、前言</h2><p>Haproxy是稳定、高性能、高可用性的负载均衡解决方案,支持HTTP及TCP代理后端服务器池,因支持强大灵活的7层acl规则,广泛作为HTTP反向代理。本文则详细介绍如何利用它的四层交换与Keepalived实现一个负载均衡器,适用于Socket、ICE、<a title="mail命令" href="http://man.linuxde.net/mail" target="_blank" data-mce-href="http://man.linuxde.net/mail">mail</a>、<a title="mysql命令" href="http://man.linuxde.net/mysql" target="_blank" data-mce-href="http://man.linuxde.net/mysql">mysql</a>、私有通讯等任意TCP服务。系统架构图如下:</p><p><img src="基于Keepalived-Haproxy搭建四层负载均衡器_files/599b462cd01cce1c4d000016.png" alt="" data-mce-src="/api/file/getImage?fileId=599b462cd01cce1c4d000016"></p><h2>二、平台环境</h2><pre id="leanote_ace_1479781780621_0" class="ace-tomorrow" data-mce-style="line-height: 1.5; font-size: 14px; height: 105px;">OS:Centos5.4(64X)
|
||||
MASTER:192.168.0.20
|
||||
BACKUP:192.168.0.21
|
||||
VIP:192.168.0.100
|
||||
Serivce Port:11231</pre><h2>三、平台安装配置</h2><p><strong>1、添加非本机<a title="ip命令" href="http://man.linuxde.net/ip" target="_blank" data-mce-href="http://man.linuxde.net/ip">ip</a>邦定支持</strong></p><pre id="leanote_ace_1479781780643_0" class="ace-tomorrow" data-mce-style="line-height: 1.5; font-size: 14px; height: 63px;">#vi /etc/sysctl.conf
|
||||
net.ipv4.ip_nonlocal_bind=1
|
||||
#sysctl –p</pre><p><strong>2、配置平台日志支持</strong></p><pre id="leanote_ace_1479781780653_0" class="ace-tomorrow" data-mce-style="line-height: 1.5; font-size: 14px; height: 189px;">#vi /etc/syslog.conf
|
||||
添加:
|
||||
local3.* /var/log/haproxy.log
|
||||
local0.* /var/log/haproxy.log
|
||||
|
||||
#vi /etc/sysconfig/syslog
|
||||
修改:
|
||||
SYSLOGD_OPTIONS="-r -m 0"
|
||||
#/etc/init.d/syslog restart</pre><p><strong>3、关闭SELINUX</strong></p><pre id="leanote_ace_1479781780663_0" class="ace-tomorrow" data-mce-style="line-height: 1.5; font-size: 14px; height: 84px;">vi /etc/sysconfig/selinux
|
||||
修改:
|
||||
SELINUX=disabled
|
||||
#setenforce 0</pre><p><strong>4、配置<a title="iptables命令" href="http://man.linuxde.net/iptables" target="_blank" data-mce-href="http://man.linuxde.net/iptables">iptables</a>,添加VRRP通讯支持</strong></p><pre id="leanote_ace_1479781780673_0" class="ace-tomorrow" data-mce-style="line-height: 1.5; font-size: 14px; height: 21px;">iptables -A INPUT -d 224.0.0.18 -j accept</pre><p><strong>5、Keepalived的安装、配置</strong></p><pre id="leanote_ace_1479781780682_0" class="ace-tomorrow" data-mce-style="line-height: 1.5; font-size: 14px; height: 1239px;">#mkdir -p /home/install/keepalivedha
|
||||
#cd /home/install/keepalivedha
|
||||
#wget http://www.keepalived.org/software/keepalived-1.2.2.tar.gz
|
||||
#tar zxvf keepalived-1.2.2.tar.gz
|
||||
#cd keepalived-1.2.2
|
||||
#./configure
|
||||
#make && make install
|
||||
|
||||
#cp /usr/local/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/
|
||||
#cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/
|
||||
#mkdir /etc/keepalived
|
||||
#cp /usr/local/etc/keepalived/keepalived.conf /etc/keepalived/
|
||||
#cp /usr/local/sbin/keepalived /usr/sbin/
|
||||
|
||||
#vi /etc/keepalived/keepalived.conf
|
||||
|
||||
! Configuration file for keepalived
|
||||
|
||||
global_defs {
|
||||
notification_email {
|
||||
liutiansi@gmail.com
|
||||
}
|
||||
notification_email_from liutiansi@gmail.com
|
||||
smtp_connect_timeout 3
|
||||
smtp_server 127.0.0.1
|
||||
router_id LVS_DEVEL
|
||||
}
|
||||
vrrp_script chk_haproxy {
|
||||
script "killall -0 haproxy"
|
||||
interval 2
|
||||
weight 2
|
||||
}
|
||||
vrrp_instance VI_1 {
|
||||
interface eth1
|
||||
state MASTER # 从为BACKUP
|
||||
priority 101 # 从为100
|
||||
virtual_router_id 50 #路由ID,可通过#tcpdump vrrp查看。
|
||||
garp_master_delay 1 #主从切换时间,单位为秒。
|
||||
|
||||
authentication {
|
||||
auth_type PASS
|
||||
auth_pass KJj23576hYgu23IP
|
||||
}
|
||||
track_interface {
|
||||
eth0
|
||||
eth1
|
||||
}
|
||||
virtual_ipaddress {
|
||||
192.168.0.100
|
||||
}
|
||||
track_script {
|
||||
chk_haproxy
|
||||
}
|
||||
|
||||
#状态通知
|
||||
notify_master "/etc/keepalived/Mailnotify.py master"
|
||||
notify_backup "/etc/keepalived/Mailnotify.py backup"
|
||||
notify_fault "/etc/keepalived/Mailnotify.py fault"
|
||||
}</pre><p><strong>6、Haproxy的安装与配置</strong></p><pre id="leanote_ace_1479781780693_0" class="ace-tomorrow" data-mce-style="line-height: 1.5; font-size: 14px; height: 231px;">#cd /home/install/keepalivedha
|
||||
#wget http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.11.tar.gz
|
||||
#tar -zxvf haproxy-1.4.11.tar.gz
|
||||
#cd haproxy-1.4.11
|
||||
#make install
|
||||
#mkdir -p /usr/local/haproxy/etc
|
||||
#mkdir -p /usr/local/haproxy/sbin
|
||||
#cp examples/haproxy.cfg /usr/local/haproxy/etc
|
||||
#ln -s /usr/local/sbin/haproxy /usr/local/haproxy/sbin/haproxy
|
||||
|
||||
#vi /usr/local/haproxy/etc/haproxy.cfg</pre><pre id="leanote_ace_1479781780704_0" class="ace-tomorrow" data-mce-style="line-height: 1.5; font-size: 14px; height: 924px;"># this config needs haproxy-1.1.28 or haproxy-1.2.1
|
||||
|
||||
global
|
||||
# log 127.0.0.1 local0
|
||||
log 127.0.0.1 local1 notice
|
||||
maxconn 5000
|
||||
uid 99
|
||||
gid 99
|
||||
|
||||
daemon
|
||||
pidfile /usr/local/haproxy/haproxy.pid
|
||||
|
||||
|
||||
defaults
|
||||
log global
|
||||
mode http
|
||||
|
||||
#option httplog
|
||||
option dontlognull
|
||||
retries 3
|
||||
option redispatch
|
||||
maxconn 2000
|
||||
contimeout 5000
|
||||
clitimeout 50000
|
||||
srvtimeout 50000
|
||||
|
||||
listen ICE01 192.168.0.100:11231
|
||||
mode tcp #配置TCP模式
|
||||
maxconn 2000
|
||||
balance roundrobin
|
||||
server ice-192.168.0.128 192.168.0.128:11231 check inter 5000 fall 1 rise 2
|
||||
server ice-192.168.0.129 192.168.0.129:11231 check inter 5000 fall 1 rise 2
|
||||
server ice-192.168.0.130 192.168.0.130:11231 check inter 5000 fall 1 rise 2
|
||||
server ice-192.168.0.131 192.168.0.131:11231 check inter 5000 fall 1 rise 2
|
||||
server ice-192.168.0.132 192.168.0.132:11231 check inter 5000 fall 1 rise 2
|
||||
server ice-192.168.0.34 192.168.0.34:11231 check inter 5000 fall 1 rise 2
|
||||
srvtimeout 20000
|
||||
|
||||
listen stats_auth 192.168.0.20:80
|
||||
# listen stats_auth 192.168.0.21:80 # backup config
|
||||
stats enable
|
||||
stats uri /admin-status #管理地址
|
||||
stats auth admin:123456 #管理帐号:管理密码
|
||||
stats admin if TRUE</pre><p><strong>7、邮件通知程序(python实现)<br></strong></p><pre id="leanote_ace_1479781780716_0" class="ace-tomorrow" data-mce-style="line-height: 1.5; font-size: 14px; height: 21px;">#vi /etc/keepalived/Mailnotify.py</pre><pre id="leanote_ace_1479781780725_0" class="ace-tomorrow" data-mce-style="line-height: 1.5; font-size: 14px; height: 1113px;">#!/usr/local/bin/python
|
||||
#coding: utf-8
|
||||
from email.MIMEMultipart import MIMEMultipart
|
||||
from email.MIMEText import MIMEText
|
||||
from email.MIMEImage import MIMEImage
|
||||
from email.header import Header
|
||||
import sys
|
||||
import smtplib
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# Name: Mailnotify.py
|
||||
# Purpose: Mail notify to SA
|
||||
# Author: Liutiansi
|
||||
# Email: liutiansi@gamil.com
|
||||
# Created: 2011/03/09
|
||||
# Copyright: (c) 2011
|
||||
#--------------------------------------------------------------
|
||||
strFrom = 'admin@domain.com'
|
||||
strTo = 'liutiansi@gmail.com'
|
||||
smtp_server='smtp.domain.com'
|
||||
smtp_pass='123456'
|
||||
|
||||
if sys.argv[1]!="master" and sys.argv[1]!="backup" and sys.argv[1]!="fault":
|
||||
sys.exit()
|
||||
else:
|
||||
notify_type=sys.argv[1]
|
||||
|
||||
|
||||
mail_title='[紧急]负载均衡器邮件通知'
|
||||
mail_body_plain=notify_type+'被激活,请做好应急处理。'
|
||||
mail_body_html='<b><font color=red>'+notify_type+'被激活,请做好应急处理。</font></b>'
|
||||
|
||||
msgRoot = MIMEMultipart('related')
|
||||
msgRoot['Subject'] =Header(mail_title,'utf-8')
|
||||
msgRoot['From'] = strFrom
|
||||
msgRoot['To'] = strTo
|
||||
|
||||
msgAlternative = MIMEMultipart('alternative')
|
||||
msgRoot.attach(msgAlternative)
|
||||
|
||||
msgText = MIMEText(mail_body_plain, 'plain', 'utf-8')
|
||||
msgAlternative.attach(msgText)
|
||||
|
||||
|
||||
msgText = MIMEText(mail_body_html, 'html','utf-8')
|
||||
msgAlternative.attach(msgText)
|
||||
|
||||
|
||||
smtp = smtplib.SMTP()
|
||||
smtp.connect(smtp_server)
|
||||
smtp.login(smtp_user,smtp_pass)
|
||||
smtp.sendmail(strFrom, strTo, msgRoot.as_string())
|
||||
smtp.quit()</pre><p>注:修改成系统python实际路径“#!/usr/local/bin/python”(第一行)</p><pre id="leanote_ace_1479781780738_0" class="ace-tomorrow" data-mce-style="line-height: 1.5; font-size: 14px; height: 63px;">#chmod +x /etc/keepalived/Mailnotify.py
|
||||
#/usr/local/haproxy/sbin/haproxy -f /usr/local/haproxy/etc/haproxy.cfg
|
||||
#service keepalived start</pre><p><strong>8、查看VRRP通讯记录<br></strong></p><pre id="leanote_ace_1479781780748_0" class="ace-tomorrow" data-mce-style="line-height: 1.5; font-size: 14px; height: 21px;">#tcpdump vrrp</pre><pre id="leanote_ace_1479781780758_0" class="ace-tomorrow" data-mce-style="line-height: 1.5; font-size: 14px; height: 63px;">tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
|
||||
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
|
||||
15:49:05.270017 IP 192.168.0.20 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 50, prio 100, authtype simple, intvl 1s, length 20</pre><h2>四、Haproxy界面</h2><p>访问http://192.168.0.20/admin-status,输入帐号admin密码123456进入管理监控平台。</p><p><img src="基于Keepalived-Haproxy搭建四层负载均衡器_files/599b462cd01cce1c4d000015.png" alt="" data-mce-src="/api/file/getImage?fileId=599b462cd01cce1c4d000015"></p><p>haproxy-1.4.9以后版本最大的亮点是添加了手工启用/禁用功能,对升级变更应用时非常有用。</p><h2>五、邮件通知</h2><p><img src="基于Keepalived-Haproxy搭建四层负载均衡器_files/599b462cd01cce1c4d000014.png" alt="" data-mce-src="/api/file/getImage?fileId=599b462cd01cce1c4d000014"></p></div>
|
||||
</div>
|
||||
|
||||
<!-- 该js供其它处理 -->
|
||||
<script src="../leanote-html.js"></script>
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
Binary file not shown.
After Width: | Height: | Size: 80 KiB |
Binary file not shown.
After Width: | Height: | Size: 58 KiB |
165
应用相关/日志监控分析系统/HBASE集群高可靠安装.html
Normal file
165
应用相关/日志监控分析系统/HBASE集群高可靠安装.html
Normal file
File diff suppressed because one or more lines are too long
165
应用相关/日志监控分析系统/Hadoop集群高可靠安装.html
Normal file
165
应用相关/日志监控分析系统/Hadoop集群高可靠安装.html
Normal file
File diff suppressed because one or more lines are too long
165
应用相关/日志监控分析系统/Storm分布式集群安装.html
Normal file
165
应用相关/日志监控分析系统/Storm分布式集群安装.html
Normal file
File diff suppressed because one or more lines are too long
165
应用相关/日志监控分析系统/Zookeeper集群安装.html
Normal file
165
应用相关/日志监控分析系统/Zookeeper集群安装.html
Normal file
File diff suppressed because one or more lines are too long
165
应用相关/日志监控分析系统/搭建分布式集群环境准备.html
Normal file
165
应用相关/日志监控分析系统/搭建分布式集群环境准备.html
Normal file
|
@ -0,0 +1,165 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="tool" content="leanote-desktop-app">
|
||||
<title>搭建分布式集群环境准备</title>
|
||||
<style>
|
||||
|
||||
*{font-family:"lucida grande","lucida sans unicode",lucida,helvetica,"Hiragino Sans GB","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/*公用文字样式*/
|
||||
h1{font-size:30px}h2{font-size:24px}h3{font-size:18px}h4{font-size:14px}
|
||||
.note-container{
|
||||
width:850px;
|
||||
margin:auto;
|
||||
padding: 10px 20px;
|
||||
box-shadow: 1px 1px 10px #eee;
|
||||
}
|
||||
#title {
|
||||
margin: 0;
|
||||
}
|
||||
table {
|
||||
margin-bottom: 16px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table th, table td {
|
||||
padding: 6px 13px;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
table th {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table tr {
|
||||
background-color: none;
|
||||
border-top: 1px solid #ccc;
|
||||
}
|
||||
table tr:nth-child(2n) {
|
||||
background-color: rgb(247, 247, 249);
|
||||
}
|
||||
.mce-item-table, .mce-item-table td, .mce-item-table th, .mce-item-table caption {
|
||||
border: 1px solid #ddd;
|
||||
border-collapse: collapse;
|
||||
padding: 6px 13px;
|
||||
}
|
||||
blockquote {
|
||||
border-left-width:10px;
|
||||
background-color:rgba(128,128,128,0.05);
|
||||
border-top-right-radius:5px;
|
||||
border-bottom-right-radius:5px;
|
||||
padding:15px 20px;
|
||||
border-left:5px solid rgba(128,128,128,0.075);
|
||||
}
|
||||
blockquote p {
|
||||
margin-bottom:1.1em;
|
||||
font-size:1em;
|
||||
line-height:1.45
|
||||
}
|
||||
blockquote ul:last-child,blockquote ol:last-child {
|
||||
margin-bottom:0
|
||||
}
|
||||
pre {
|
||||
padding: 18px;
|
||||
background-color: #f7f7f9;
|
||||
border: 1px solid #e1e1e8;
|
||||
border-radius: 3px;
|
||||
display: block;
|
||||
}
|
||||
code {
|
||||
padding: 2px 4px;
|
||||
font-size: 90%;
|
||||
color: #c7254e;
|
||||
white-space: nowrap;
|
||||
background-color: #f9f2f4;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.footnote {
|
||||
vertical-align: top;
|
||||
position: relative;
|
||||
top: -0.5em;
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin:2em 0
|
||||
}
|
||||
img {
|
||||
max-width:100%
|
||||
}
|
||||
pre {
|
||||
word-break:break-word
|
||||
}
|
||||
p,pre,pre.prettyprint,blockquote {
|
||||
margin:0 0 1.1em
|
||||
}
|
||||
hr {
|
||||
margin:2em 0
|
||||
}
|
||||
img {
|
||||
max-width:100%
|
||||
}
|
||||
.sequence-diagram,.flow-chart {
|
||||
text-align:center;
|
||||
margin-bottom:1.1em
|
||||
}
|
||||
.sequence-diagram text,.flow-chart text {
|
||||
font-size:15px !important;
|
||||
font-family:"Source Sans Pro",sans-serif !important
|
||||
}
|
||||
.sequence-diagram [fill="#ffffff"],.flow-chart [fill="#ffffff"] {
|
||||
fill:#f6f6f6
|
||||
}
|
||||
.sequence-diagram [stroke="#000000"],.flow-chart [stroke="#000000"] {
|
||||
stroke:#3f3f3f
|
||||
}
|
||||
.sequence-diagram text[stroke="#000000"],.flow-chart text[stroke="#000000"] {
|
||||
stroke:none
|
||||
}
|
||||
.sequence-diagram [fill="#000"],.flow-chart [fill="#000"],.sequence-diagram [fill="#000000"],.flow-chart [fill="#000000"],.sequence-diagram [fill="black"],.flow-chart [fill="black"] {
|
||||
fill:#3f3f3f
|
||||
}
|
||||
ul,ol {
|
||||
margin-bottom:1.1em
|
||||
}
|
||||
ul ul,ol ul,ul ol,ol ol {
|
||||
margin-bottom:1.1em
|
||||
}
|
||||
kbd {
|
||||
padding:.1em .6em;
|
||||
border:1px solid rgba(63,63,63,0.25);
|
||||
-webkit-box-shadow:0 1px 0 rgba(63,63,63,0.25);
|
||||
box-shadow:0 1px 0 rgba(63,63,63,0.25);
|
||||
font-size:.7em;
|
||||
font-family:sans-serif;
|
||||
background-color:#fff;
|
||||
color:#333;
|
||||
border-radius:3px;
|
||||
display:inline-block;
|
||||
margin:0 .1em;
|
||||
white-space:nowrap
|
||||
}
|
||||
.toc ul {
|
||||
list-style-type:none;
|
||||
margin-bottom:15px
|
||||
}
|
||||
</style>
|
||||
<!-- 该css供自定义样式 -->
|
||||
<link href="../leanote-html.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="note-container">
|
||||
<h1 class="title" id="leanote-title">搭建分布式集群环境准备</h1>
|
||||
<div class="content-html" id="leanote-content"></div>
|
||||
</div>
|
||||
|
||||
<!-- 该js供其它处理 -->
|
||||
<script src="../leanote-html.js"></script>
|
||||
</body>
|
||||
</html>
|
165
应用相关/日志监控分析系统/日志监控系统流程图.html
Normal file
165
应用相关/日志监控分析系统/日志监控系统流程图.html
Normal file
|
@ -0,0 +1,165 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="tool" content="leanote-desktop-app">
|
||||
<title>日志监控系统流程图</title>
|
||||
<style>
|
||||
|
||||
*{font-family:"lucida grande","lucida sans unicode",lucida,helvetica,"Hiragino Sans GB","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/*公用文字样式*/
|
||||
h1{font-size:30px}h2{font-size:24px}h3{font-size:18px}h4{font-size:14px}
|
||||
.note-container{
|
||||
width:850px;
|
||||
margin:auto;
|
||||
padding: 10px 20px;
|
||||
box-shadow: 1px 1px 10px #eee;
|
||||
}
|
||||
#title {
|
||||
margin: 0;
|
||||
}
|
||||
table {
|
||||
margin-bottom: 16px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table th, table td {
|
||||
padding: 6px 13px;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
table th {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table tr {
|
||||
background-color: none;
|
||||
border-top: 1px solid #ccc;
|
||||
}
|
||||
table tr:nth-child(2n) {
|
||||
background-color: rgb(247, 247, 249);
|
||||
}
|
||||
.mce-item-table, .mce-item-table td, .mce-item-table th, .mce-item-table caption {
|
||||
border: 1px solid #ddd;
|
||||
border-collapse: collapse;
|
||||
padding: 6px 13px;
|
||||
}
|
||||
blockquote {
|
||||
border-left-width:10px;
|
||||
background-color:rgba(128,128,128,0.05);
|
||||
border-top-right-radius:5px;
|
||||
border-bottom-right-radius:5px;
|
||||
padding:15px 20px;
|
||||
border-left:5px solid rgba(128,128,128,0.075);
|
||||
}
|
||||
blockquote p {
|
||||
margin-bottom:1.1em;
|
||||
font-size:1em;
|
||||
line-height:1.45
|
||||
}
|
||||
blockquote ul:last-child,blockquote ol:last-child {
|
||||
margin-bottom:0
|
||||
}
|
||||
pre {
|
||||
padding: 18px;
|
||||
background-color: #f7f7f9;
|
||||
border: 1px solid #e1e1e8;
|
||||
border-radius: 3px;
|
||||
display: block;
|
||||
}
|
||||
code {
|
||||
padding: 2px 4px;
|
||||
font-size: 90%;
|
||||
color: #c7254e;
|
||||
white-space: nowrap;
|
||||
background-color: #f9f2f4;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.footnote {
|
||||
vertical-align: top;
|
||||
position: relative;
|
||||
top: -0.5em;
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin:2em 0
|
||||
}
|
||||
img {
|
||||
max-width:100%
|
||||
}
|
||||
pre {
|
||||
word-break:break-word
|
||||
}
|
||||
p,pre,pre.prettyprint,blockquote {
|
||||
margin:0 0 1.1em
|
||||
}
|
||||
hr {
|
||||
margin:2em 0
|
||||
}
|
||||
img {
|
||||
max-width:100%
|
||||
}
|
||||
.sequence-diagram,.flow-chart {
|
||||
text-align:center;
|
||||
margin-bottom:1.1em
|
||||
}
|
||||
.sequence-diagram text,.flow-chart text {
|
||||
font-size:15px !important;
|
||||
font-family:"Source Sans Pro",sans-serif !important
|
||||
}
|
||||
.sequence-diagram [fill="#ffffff"],.flow-chart [fill="#ffffff"] {
|
||||
fill:#f6f6f6
|
||||
}
|
||||
.sequence-diagram [stroke="#000000"],.flow-chart [stroke="#000000"] {
|
||||
stroke:#3f3f3f
|
||||
}
|
||||
.sequence-diagram text[stroke="#000000"],.flow-chart text[stroke="#000000"] {
|
||||
stroke:none
|
||||
}
|
||||
.sequence-diagram [fill="#000"],.flow-chart [fill="#000"],.sequence-diagram [fill="#000000"],.flow-chart [fill="#000000"],.sequence-diagram [fill="black"],.flow-chart [fill="black"] {
|
||||
fill:#3f3f3f
|
||||
}
|
||||
ul,ol {
|
||||
margin-bottom:1.1em
|
||||
}
|
||||
ul ul,ol ul,ul ol,ol ol {
|
||||
margin-bottom:1.1em
|
||||
}
|
||||
kbd {
|
||||
padding:.1em .6em;
|
||||
border:1px solid rgba(63,63,63,0.25);
|
||||
-webkit-box-shadow:0 1px 0 rgba(63,63,63,0.25);
|
||||
box-shadow:0 1px 0 rgba(63,63,63,0.25);
|
||||
font-size:.7em;
|
||||
font-family:sans-serif;
|
||||
background-color:#fff;
|
||||
color:#333;
|
||||
border-radius:3px;
|
||||
display:inline-block;
|
||||
margin:0 .1em;
|
||||
white-space:nowrap
|
||||
}
|
||||
.toc ul {
|
||||
list-style-type:none;
|
||||
margin-bottom:15px
|
||||
}
|
||||
</style>
|
||||
<!-- 该css供自定义样式 -->
|
||||
<link href="../leanote-html.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="note-container">
|
||||
<h1 class="title" id="leanote-title">日志监控系统流程图</h1>
|
||||
<div class="content-html" id="leanote-content"></div>
|
||||
</div>
|
||||
|
||||
<!-- 该js供其它处理 -->
|
||||
<script src="../leanote-html.js"></script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue