Skip to content

Commit d908e45

Browse files
那里好脏不可以RunDevelopment
那里好脏不可以
andauthored
New Language: Keepalived configure file (#2417)
Co-authored-by: RunDevelopment <[email protected]>
1 parent a80a68b commit d908e45

17 files changed

+1125
-3
lines changed

components.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components.json

+4
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,10 @@
713713
"title": "Julia",
714714
"owner": "cdagnino"
715715
},
716+
"keepalived": {
717+
"title": "Keepalived Configure",
718+
"owner": "dev-itsheng"
719+
},
716720
"keyman": {
717721
"title": "Keyman",
718722
"owner": "mcdurdin"

components/prism-keepalived.js

+51
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/prism-keepalived.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/prism-keepalived.html

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
<h2>A example from keepalived document</h2>
2+
<pre><code>
3+
# Configuration File for keepalived
4+
global_defs {
5+
notification_email {
6+
7+
8+
}
9+
notification_email_from [email protected]
10+
smtp_server 192.168.200.20
11+
smtp_connect_timeout 30
12+
router_id LVS_MAIN
13+
}
14+
15+
# VRRP Instances definitions
16+
vrrp_instance VI_1 {
17+
state MASTER
18+
interface eth0
19+
virtual_router_id 51
20+
priority 150
21+
advert_int 1
22+
authentication {
23+
auth_type PASS
24+
auth_pass k@l!ve1
25+
}
26+
virtual_ipaddress {
27+
192.168.200.10
28+
192.168.200.11
29+
}
30+
}
31+
vrrp_instance VI_2 {
32+
state MASTER
33+
interface eth1
34+
virtual_router_id 52
35+
priority 150
36+
advert_int 1
37+
authentication {
38+
auth_type PASS
39+
auth_pass k@l!ve2
40+
}
41+
virtual_ipaddress {
42+
192.168.100.10
43+
}
44+
}
45+
vrrp_instance VI_3 {
46+
state BACKUP
47+
interface eth0
48+
virtual_router_id 53
49+
priority 100
50+
advert_int 1
51+
authentication {
52+
auth_type PASS
53+
auth_pass k@l!ve3
54+
}
55+
virtual_ipaddress {
56+
192.168.200.12
57+
192.168.200.13
58+
}
59+
}
60+
vrrp_instance VI_4 {
61+
state BACKUP
62+
interface eth1
63+
virtual_router_id 54
64+
priority 100
65+
advert_int 1
66+
authentication {
67+
auth_type PASS
68+
auth_pass k@l!ve4
69+
}
70+
virtual_ipaddress {
71+
192.168.100.11
72+
}
73+
}
74+
# Virtual Servers definitions
75+
virtual_server 192.168.200.10 80 {
76+
delay_loop 30
77+
lb_algo wrr
78+
lb_kind NAT
79+
persistence_timeout 50
80+
protocol TCP
81+
sorry_server 192.168.100.100 80
82+
real_server 192.168.100.2 80 {
83+
weight 2
84+
HTTP_GET {
85+
url {
86+
path /testurl/test.jsp
87+
digest ec90a42b99ea9a2f5ecbe213ac9eba03
88+
}
89+
url {
90+
path /testurl2/test.jsp
91+
digest 640205b7b0fc66c1ea91c463fac6334c
92+
}
93+
connect_timeout 3
94+
retry 3
95+
delay_before_retry 2
96+
}
97+
}
98+
real_server 192.168.100.3 80 {
99+
weight 1
100+
HTTP_GET {
101+
url {
102+
path /testurl/test.jsp
103+
digest 640205b7b0fc66c1ea91c463fac6334c
104+
}
105+
connect_timeout 3
106+
retry 3
107+
delay_before_retry 2
108+
}
109+
}
110+
}
111+
virtual_server 192.168.200.12 443 {
112+
delay_loop 20
113+
lb_algo rr
114+
lb_kind NAT
115+
persistence_timeout 360
116+
protocol TCP
117+
real_server 192.168.100.2 443 {
118+
weight 1
119+
TCP_CHECK {
120+
connect_timeout 3
121+
}
122+
}
123+
real_server 192.168.100.3 443 {
124+
weight 1
125+
TCP_CHECK {
126+
connect_timeout 3
127+
}
128+
}
129+
}
130+
</code></pre>

examples/prism-nginx.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ <h2>Server Block</h2>
2222
location / {
2323
proxy_pass http://127.0.0.1:8080;
2424
}
25-
}</code></pre>
25+
}
26+
</code></pre>

plugins/show-language/prism-show-language.js

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
"jsonp": "JSONP",
125125
"jsstacktrace": "JS stack trace",
126126
"js-templates": "JS Templates",
127+
"keepalived": "Keepalived Configure",
127128
"kts": "Kotlin Script",
128129
"kt": "Kotlin",
129130
"kumir": "KuMir (КуМир)",

0 commit comments

Comments
 (0)