Skip to content

Commit

Permalink
New Language: Keepalived configure file (#2417)
Browse files Browse the repository at this point in the history
Co-authored-by: RunDevelopment <[email protected]>
  • Loading branch information
那里好脏不可以 and RunDevelopment authored Oct 3, 2021
1 parent a80a68b commit d908e45
Show file tree
Hide file tree
Showing 17 changed files with 1,125 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,10 @@
"title": "Julia",
"owner": "cdagnino"
},
"keepalived": {
"title": "Keepalived Configure",
"owner": "dev-itsheng"
},
"keyman": {
"title": "Keyman",
"owner": "mcdurdin"
Expand Down
51 changes: 51 additions & 0 deletions components/prism-keepalived.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions components/prism-keepalived.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

130 changes: 130 additions & 0 deletions examples/prism-keepalived.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<h2>A example from keepalived document</h2>
<pre><code>
# Configuration File for keepalived
global_defs {
notification_email {
[email protected]
[email protected]
}
notification_email_from [email protected]
smtp_server 192.168.200.20
smtp_connect_timeout 30
router_id LVS_MAIN
}

# VRRP Instances definitions
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass k@l!ve1
}
virtual_ipaddress {
192.168.200.10
192.168.200.11
}
}
vrrp_instance VI_2 {
state MASTER
interface eth1
virtual_router_id 52
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass k@l!ve2
}
virtual_ipaddress {
192.168.100.10
}
}
vrrp_instance VI_3 {
state BACKUP
interface eth0
virtual_router_id 53
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass k@l!ve3
}
virtual_ipaddress {
192.168.200.12
192.168.200.13
}
}
vrrp_instance VI_4 {
state BACKUP
interface eth1
virtual_router_id 54
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass k@l!ve4
}
virtual_ipaddress {
192.168.100.11
}
}
# Virtual Servers definitions
virtual_server 192.168.200.10 80 {
delay_loop 30
lb_algo wrr
lb_kind NAT
persistence_timeout 50
protocol TCP
sorry_server 192.168.100.100 80
real_server 192.168.100.2 80 {
weight 2
HTTP_GET {
url {
path /testurl/test.jsp
digest ec90a42b99ea9a2f5ecbe213ac9eba03
}
url {
path /testurl2/test.jsp
digest 640205b7b0fc66c1ea91c463fac6334c
}
connect_timeout 3
retry 3
delay_before_retry 2
}
}
real_server 192.168.100.3 80 {
weight 1
HTTP_GET {
url {
path /testurl/test.jsp
digest 640205b7b0fc66c1ea91c463fac6334c
}
connect_timeout 3
retry 3
delay_before_retry 2
}
}
}
virtual_server 192.168.200.12 443 {
delay_loop 20
lb_algo rr
lb_kind NAT
persistence_timeout 360
protocol TCP
real_server 192.168.100.2 443 {
weight 1
TCP_CHECK {
connect_timeout 3
}
}
real_server 192.168.100.3 443 {
weight 1
TCP_CHECK {
connect_timeout 3
}
}
}
</code></pre>
3 changes: 2 additions & 1 deletion examples/prism-nginx.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ <h2>Server Block</h2>
location / {
proxy_pass http://127.0.0.1:8080;
}
}</code></pre>
}
</code></pre>
1 change: 1 addition & 0 deletions plugins/show-language/prism-show-language.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"jsonp": "JSONP",
"jsstacktrace": "JS stack trace",
"js-templates": "JS Templates",
"keepalived": "Keepalived Configure",
"kts": "Kotlin Script",
"kt": "Kotlin",
"kumir": "KuMir (КуМир)",
Expand Down
Loading

0 comments on commit d908e45

Please sign in to comment.