Compare commits
6 Commits
master
...
platform-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0274e06e3c | ||
|
|
378df7b9d5 | ||
|
|
bcf8342fa8 | ||
|
|
eb1ddb8a40 | ||
|
|
d8f9ac6623 | ||
|
|
500d852468 |
6
Readme.txt
Normal file
6
Readme.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
1、部署执行命令:
|
||||||
|
ansible-playbook -i install_config/hosts platform_deploy.yml
|
||||||
|
2、卸载paltform 部署命令所安装的rpm包:
|
||||||
|
ansible-playbook -i install_config/hosts tasks/uninstall/uninstall_platform.yml
|
||||||
|
3、查询安装rpm情况命令:
|
||||||
|
ansible-playbook -i install_config/hosts tasks/collect/collect_rpm_info.yml
|
||||||
@@ -34,14 +34,25 @@ sapp:
|
|||||||
inbound_route_dir: 1
|
inbound_route_dir: 1
|
||||||
|
|
||||||
#########################################
|
#########################################
|
||||||
#Sapp Double-Arm Config
|
#config for sapp nic that data comming
|
||||||
packet_io:
|
packet_io:
|
||||||
internal_interface: eth2
|
internal_interface:
|
||||||
external_interface: eth3
|
- eth2
|
||||||
|
external_interface:
|
||||||
|
- eth3
|
||||||
|
|
||||||
|
|
||||||
|
####for example: more than one nics that need to config
|
||||||
|
#packet_io:
|
||||||
|
# internal_interface:
|
||||||
|
# - internal_nic1
|
||||||
|
# - internal_nic2
|
||||||
|
# external_interface:
|
||||||
|
# - external_nic1
|
||||||
|
# - external_nic2
|
||||||
|
|
||||||
#########################################
|
#########################################
|
||||||
#Marsio Config
|
#config for mrzcpd cpu cores to bind
|
||||||
mrzcpd:
|
mrzcpd:
|
||||||
iocore: 39
|
iocore: 39
|
||||||
|
|
||||||
@@ -49,14 +60,27 @@ mrtunnat:
|
|||||||
lcore_id: 38
|
lcore_id: 38
|
||||||
|
|
||||||
#########################################
|
#########################################
|
||||||
#Inline Device Config
|
#config for mrzcpd nic that data comming.
|
||||||
inline_device_config:
|
inline_device_config_list:
|
||||||
keepalive_ip: 192.168.1.30
|
- keepalive_ip: 192.168.1.30
|
||||||
keepalive_mask: 255.255.255.252
|
keepalive_mask: 255.255.255.252
|
||||||
data_incoming: eth5
|
data_incoming: eth5
|
||||||
|
|
||||||
|
####for example: more than one nics that need to config
|
||||||
|
#inline_device_config_list:
|
||||||
|
# - keepalive_ip: ###填写ip地址,不能为空,如果没有需求,应填写默认地址为127.0.0.1######
|
||||||
|
# keepalive_mask: ###填写ip掩码,不能为空,如果没有需求,应填写默认地址为127.0.0.1######
|
||||||
|
# data_incoming: instance_nic1
|
||||||
|
# - keepalive_ip: ###填写地址,不能为空,如果没有需求,应填写默认地址为127.0.0.1######
|
||||||
|
# keepalive_mask: ###填写ip掩码,不能为空,如果没有需求,应填写默认地址为127.0.0.1######
|
||||||
|
# data_incoming: instance_nic2
|
||||||
|
|
||||||
#########################################
|
#########################################
|
||||||
|
|
||||||
sapp_prometheus_enable: 1
|
sapp_prometheus_enable: 1
|
||||||
sapp_prometheus_port: 9273
|
sapp_prometheus_port: 9273
|
||||||
sapp_prometheus_url_path: "/metrics"
|
sapp_prometheus_url_path: "/metrics"
|
||||||
|
|
||||||
|
#########below variables are not to be modified
|
||||||
|
##程序breakpad_upload_url崩溃上传core 文件url
|
||||||
|
breakpad_upload_url: "http://127.0.0.1/test"
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
- install_config/group_vars/platform.yml
|
- install_config/group_vars/platform.yml
|
||||||
roles:
|
roles:
|
||||||
- {role: framework, tags: framework}
|
- {role: framework, tags: framework}
|
||||||
- {role: kernel-ml, tags: kernel-ml}
|
|
||||||
- {role: mrzcpd, tags: mrzcpd}
|
- {role: mrzcpd, tags: mrzcpd}
|
||||||
- {role: sapp, tags: sapp}
|
- {role: sapp, tags: sapp}
|
||||||
- {role: firewall, tags: firewall}
|
- {role: firewall, tags: firewall}
|
||||||
|
|||||||
@@ -18,4 +18,9 @@
|
|||||||
- /tmp/ansible_deploy/quic-1.1.17.8c22b4d-2.el7.x86_64.rpm
|
- /tmp/ansible_deploy/quic-1.1.17.8c22b4d-2.el7.x86_64.rpm
|
||||||
- /tmp/ansible_deploy/ssl-1.0.12.16b8fb5-2.el7.x86_64.rpm
|
- /tmp/ansible_deploy/ssl-1.0.12.16b8fb5-2.el7.x86_64.rpm
|
||||||
|
|
||||||
|
- name: "start sapp"
|
||||||
|
systemd:
|
||||||
|
name: sapp
|
||||||
|
enabled: yes
|
||||||
|
daemon_reload: yes
|
||||||
|
state: started
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1,8 +0,0 @@
|
|||||||
GRUB_TIMEOUT=5
|
|
||||||
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
|
|
||||||
GRUB_DEFAULT=saved
|
|
||||||
GRUB_DISABLE_SUBMENU=true
|
|
||||||
GRUB_TERMINAL="serial console"
|
|
||||||
GRUB_SERIAL_COMMAND="serial --speed=115200"
|
|
||||||
GRUB_CMDLINE_LINUX="crashkernel=auto console=ttyS0,115200 intel_iommu=on iommu=pt pci=realloc,assign-busses"
|
|
||||||
GRUB_DISABLE_RECOVERY="true"
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,21 +0,0 @@
|
|||||||
---
|
|
||||||
- name: "copy framework rpms to destination server"
|
|
||||||
synchronize:
|
|
||||||
src: "{{ role_path }}/files/"
|
|
||||||
dest: "/tmp/ansible_deploy/"
|
|
||||||
|
|
||||||
- name: "install kernels-ml"
|
|
||||||
yum:
|
|
||||||
name:
|
|
||||||
- /tmp/ansible_deploy/pkgconfig-0.27.1-4.el7.x86_64.rpm
|
|
||||||
- /tmp/ansible_deploy/zlib-devel-1.2.7-17.el7.x86_64.rpm
|
|
||||||
- /tmp/ansible_deploy/elfutils-libelf-devel-0.168-8.el7.x86_64.rpm
|
|
||||||
- /tmp/ansible_deploy/kernel/kernel-ml-5.1.8-1.el7.elrepo.x86_64.rpm
|
|
||||||
- /tmp/ansible_deploy/kernel/kernel-ml-devel-5.1.8-1.el7.elrepo.x86_64.rpm
|
|
||||||
- /tmp/ansible_deploy/dkms-2.7.1-1.el7.noarch.rpm
|
|
||||||
state: present
|
|
||||||
register: t_kernel_ml
|
|
||||||
|
|
||||||
- name: "set kernel-ml as default kernel"
|
|
||||||
command: /usr/sbin/grub2-set-default 0
|
|
||||||
when: t_kernel_ml.changed
|
|
||||||
@@ -35,6 +35,7 @@
|
|||||||
name: mrenv
|
name: mrenv
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
state: started
|
||||||
when:
|
when:
|
||||||
- capture_packet_type == 1
|
- capture_packet_type == 1
|
||||||
|
|
||||||
@@ -43,21 +44,10 @@
|
|||||||
name: mrzcpd
|
name: mrzcpd
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
state: started
|
||||||
when:
|
when:
|
||||||
- capture_packet_type == 1
|
- capture_packet_type == 1
|
||||||
|
|
||||||
- name: "enable prometheus output - monit_device"
|
|
||||||
systemd:
|
|
||||||
name: mrapm_device
|
|
||||||
enabled: yes
|
|
||||||
daemon_reload: yes
|
|
||||||
|
|
||||||
- name: "enable prometheus output - monit_stream"
|
|
||||||
systemd:
|
|
||||||
name: mrapm_stream
|
|
||||||
enabled: yes
|
|
||||||
daemon_reload: yes
|
|
||||||
|
|
||||||
- name: "mask mrzcpd on capture_packet_type is pcap"
|
- name: "mask mrzcpd on capture_packet_type is pcap"
|
||||||
systemd:
|
systemd:
|
||||||
name: mrzcpd
|
name: mrzcpd
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
|
{% set data_incoming_list = [] %}
|
||||||
|
{% for device_config in inline_device_config_list %}
|
||||||
|
{% set tmp = data_incoming_list.append(device_config.data_incoming) %}
|
||||||
|
{% endfor %}
|
||||||
[device]
|
[device]
|
||||||
device={{inline_device_config.data_incoming}},vxlan_user,vxlan_fwd
|
device={{ data_incoming_list | join(",") }},vxlan_user,vxlan_fwd
|
||||||
sz_tunnel=8192
|
sz_tunnel=8192
|
||||||
sz_buffer=0
|
sz_buffer=0
|
||||||
|
|
||||||
[device:{{inline_device_config.data_incoming}}]
|
{% for device_config in inline_device_config_list %}
|
||||||
{% if traffic_attr_type == 0 %}
|
[device:{{device_config.data_incoming}}]
|
||||||
in_addr={{inline_device_config.keepalive_ip}}
|
{% if traffic_attr_type == 1 %}
|
||||||
in_mask={{inline_device_config.keepalive_mask}}
|
in_addr={{device_config.keepalive_ip}}
|
||||||
|
in_mask={{device_config.keepalive_mask}}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
jumbo_frame=1
|
jumbo_frame=1
|
||||||
max_rx_pkt_len=15360
|
max_rx_pkt_len=15360
|
||||||
clear_tx_flags=1
|
clear_tx_flags=1
|
||||||
|
{% endfor %}
|
||||||
#[device:]
|
|
||||||
#jumbo_frame=1
|
|
||||||
#max_rx_pkt_len=15360
|
|
||||||
#clear_tx_flags=1
|
|
||||||
#promisc=1
|
|
||||||
|
|
||||||
[service]
|
[service]
|
||||||
# lcore id for i/o service, use comma to split
|
# lcore id for i/o service, use comma to split
|
||||||
@@ -41,9 +41,3 @@ sz_indirect_pktmbuf=8192
|
|||||||
sz_cache=256
|
sz_cache=256
|
||||||
sz_data=4096
|
sz_data=4096
|
||||||
|
|
||||||
[forward]
|
|
||||||
nr_forward_rule=4
|
|
||||||
forward_rule_0=pv,{{inline_device_config.data_incoming}},{{inline_device_config.data_incoming}}
|
|
||||||
forward_rule_1=vp,{{inline_device_config.data_incoming}},{{inline_device_config.data_incoming}}
|
|
||||||
forward_rule_2=vv,vxlan_fwd,vxlan_user
|
|
||||||
forward_rule_3=vv,vxlan_user,vxlan_fwd
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[tunnat]
|
[tunnat]
|
||||||
lcore_id={{ mrtunnat.lcore_id }}
|
lcore_id={{ mrtunnat.lcore_id }}
|
||||||
appsym=tunnat
|
appsym=tunnat
|
||||||
phydev={{inline_device_config.data_incoming}}
|
phydev=eth0
|
||||||
virtdev=vxlan_fwd
|
virtdev=vxlan_fwd
|
||||||
nr_max_sessions=524280
|
nr_max_sessions=524280
|
||||||
nr_slots=1048576
|
nr_slots=1048576
|
||||||
|
|||||||
@@ -81,16 +81,16 @@ dictator_enable=0
|
|||||||
[packet_io.internal.interface]
|
[packet_io.internal.interface]
|
||||||
{% if capture_packet_type == 0 %}
|
{% if capture_packet_type == 0 %}
|
||||||
type=pcap
|
type=pcap
|
||||||
name={{packet_io.internal_interface}}
|
name={{packet_io.internal_interface | join(",")}}
|
||||||
{% else %}
|
{% else %}
|
||||||
type=marsio
|
type=marsio
|
||||||
name={{nic_data_incoming.name}}
|
name={{packet_io.internal_interface | join(",")}}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
[packet_io.external.interface]
|
[packet_io.external.interface]
|
||||||
{% if capture_packet_type == 0 %}
|
{% if capture_packet_type == 0 %}
|
||||||
type=pcap
|
type=pcap
|
||||||
name={{packet_io.external_interface}}
|
name={{packet_io.external_interface | join(",")}}
|
||||||
{% else %}
|
{% else %}
|
||||||
type=pcap
|
type=pcap
|
||||||
name=lo
|
name=lo
|
||||||
|
|||||||
41
tasks/collect/collect_rpm_info.yml
Normal file
41
tasks/collect/collect_rpm_info.yml
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
- hosts: platform
|
||||||
|
remote_user: root
|
||||||
|
tasks:
|
||||||
|
- name: "collect rpm info: excute shell to get rpm install info"
|
||||||
|
shell: rpm -q {{item}}
|
||||||
|
with_items:
|
||||||
|
- libcjson
|
||||||
|
- libdocumentanalyze
|
||||||
|
- libmaatframe
|
||||||
|
- libMESA_field_stat
|
||||||
|
- libMESA_field_stat2
|
||||||
|
- libMESA_handle_logger
|
||||||
|
- libMESA_htable
|
||||||
|
- libMESA_prof_load
|
||||||
|
- librdkafka
|
||||||
|
- librulescan
|
||||||
|
- libtsglua
|
||||||
|
- libwiredcfg
|
||||||
|
- libWiredLB
|
||||||
|
- lz4
|
||||||
|
- libbreakpad_mini
|
||||||
|
- dns
|
||||||
|
- ftp
|
||||||
|
- http
|
||||||
|
- mail
|
||||||
|
- quic
|
||||||
|
- ssl
|
||||||
|
- mrzcpd
|
||||||
|
- sapp
|
||||||
|
register: rpm_results
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- name: "collect rpm info: combine list format for output rpm install infomation"
|
||||||
|
set_fact:
|
||||||
|
install_info: '{{ install_info | default([]) + [{"name": item.item, "installed": not item.failed, "version": item.stdout}] | list }}'
|
||||||
|
with_items: "{{ rpm_results.results }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: "collect rpm info: output rpm install infomation"
|
||||||
|
debug:
|
||||||
|
var: install_info
|
||||||
20
tasks/unistall/uninstall_firewall.yml
Normal file
20
tasks/unistall/uninstall_firewall.yml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
- hosts: platform
|
||||||
|
remote_user: root
|
||||||
|
tasks:
|
||||||
|
- name: "uninstall firewall: stop sapp.service"
|
||||||
|
systemd:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: stopped
|
||||||
|
with_items:
|
||||||
|
- sapp.service
|
||||||
|
|
||||||
|
- name: "uninstall firewall: absent firewall rpm packages"
|
||||||
|
shell: rpm -e --nodeps {{item}}
|
||||||
|
with_items:
|
||||||
|
- dns
|
||||||
|
- ftp
|
||||||
|
- http
|
||||||
|
- mail
|
||||||
|
- quic
|
||||||
|
- ssl
|
||||||
|
ignore_errors: yes
|
||||||
22
tasks/unistall/uninstall_framework.yml
Normal file
22
tasks/unistall/uninstall_framework.yml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
- hosts: platform
|
||||||
|
remote_user: root
|
||||||
|
tasks:
|
||||||
|
- name: "uninstall framework: absent framework rpm packages"
|
||||||
|
shell: rpm -e --nodeps {{item}}
|
||||||
|
with_items:
|
||||||
|
- libcjson
|
||||||
|
- libdocumentanalyze
|
||||||
|
- libmaatframe
|
||||||
|
- libMESA_field_stat
|
||||||
|
- libMESA_field_stat2
|
||||||
|
- libMESA_handle_logger
|
||||||
|
- libMESA_htable
|
||||||
|
- libMESA_prof_load
|
||||||
|
- librdkafka
|
||||||
|
- librulescan
|
||||||
|
- libtsglua
|
||||||
|
- libwiredcfg
|
||||||
|
- libWiredLB
|
||||||
|
- lz4
|
||||||
|
- libbreakpad_mini
|
||||||
|
ignore_errors: yes
|
||||||
13
tasks/unistall/uninstall_mrzcpd.yml
Normal file
13
tasks/unistall/uninstall_mrzcpd.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
- hosts: platform
|
||||||
|
remote_user: root
|
||||||
|
tasks:
|
||||||
|
- name: "uninstall mrzcpd: stop mrzcpd.service"
|
||||||
|
systemd:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: stopped
|
||||||
|
with_items:
|
||||||
|
- mrzcpd.service
|
||||||
|
|
||||||
|
- name: "uninstall mrzcpd:absent mrzcpd rpm package"
|
||||||
|
shell: rpm -e --nodeps mrzcpd
|
||||||
|
ignore_errors: yes
|
||||||
5
tasks/unistall/uninstall_platform.yml
Normal file
5
tasks/unistall/uninstall_platform.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- include: uninstall_firewall.yml
|
||||||
|
- include: uninstall_sapp.yml
|
||||||
|
- include: uninstall_mrzcpd.yml
|
||||||
|
- include: uninstall_framework.yml
|
||||||
13
tasks/unistall/uninstall_sapp.yml
Normal file
13
tasks/unistall/uninstall_sapp.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
- hosts: platform
|
||||||
|
remote_user: root
|
||||||
|
tasks:
|
||||||
|
- name: "uninstall sapp: stop sapp.service"
|
||||||
|
systemd:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: stopped
|
||||||
|
with_items:
|
||||||
|
- sapp.service
|
||||||
|
|
||||||
|
- name: "uninstall sapp:absent sapp rpm package"
|
||||||
|
shell: rpm -e --nodeps sapp
|
||||||
|
ignore_errors: yes
|
||||||
Reference in New Issue
Block a user