Compare commits

6 Commits

Author SHA1 Message Date
fumingwei
0274e06e3c 删除mrzcpd 输出promethus 的service 2021-03-04 11:28:50 +08:00
fumingwei
378df7b9d5 1、增加部分变量注释
2、增加sapp,mrzcpd部署完以后自启动
2021-03-04 11:11:33 +08:00
fumingwei
bcf8342fa8 删除inlinene_devicece_config 变量引用 2021-03-03 16:14:06 +08:00
fumingwei
eb1ddb8a40 更改查询rpm输出状态字段key名字 2021-03-01 17:12:24 +08:00
fumingwei
d8f9ac6623 1、增加mrzcpd 对device list的支持
2、增加sapp 的internal 和external interface 的网卡list的支持
3、增加卸载部署脚本
4、增加查询指定rpm安装情况部署脚本
2021-03-01 16:47:01 +08:00
fumingwei
500d852468 删除安装内核 2021-02-26 10:33:32 +08:00
22 changed files with 176 additions and 73 deletions

6
Readme.txt Normal file
View 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

View File

@@ -34,14 +34,25 @@ sapp:
inbound_route_dir: 1
#########################################
#Sapp Double-Arm Config
#config for sapp nic that data comming
packet_io:
internal_interface: eth2
external_interface: eth3
internal_interface:
- 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:
iocore: 39
@@ -49,14 +60,27 @@ mrtunnat:
lcore_id: 38
#########################################
#Inline Device Config
inline_device_config:
keepalive_ip: 192.168.1.30
keepalive_mask: 255.255.255.252
data_incoming: eth5
#config for mrzcpd nic that data comming.
inline_device_config_list:
- keepalive_ip: 192.168.1.30
keepalive_mask: 255.255.255.252
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_port: 9273
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"

View File

@@ -4,7 +4,6 @@
- install_config/group_vars/platform.yml
roles:
- {role: framework, tags: framework}
- {role: kernel-ml, tags: kernel-ml}
- {role: mrzcpd, tags: mrzcpd}
- {role: sapp, tags: sapp}
- {role: firewall, tags: firewall}

View File

@@ -18,4 +18,9 @@
- /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
- name: "start sapp"
systemd:
name: sapp
enabled: yes
daemon_reload: yes
state: started

View File

@@ -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"

View File

@@ -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

View File

@@ -35,6 +35,7 @@
name: mrenv
enabled: yes
daemon_reload: yes
state: started
when:
- capture_packet_type == 1
@@ -43,21 +44,10 @@
name: mrzcpd
enabled: yes
daemon_reload: yes
state: started
when:
- 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"
systemd:
name: mrzcpd

View File

@@ -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={{inline_device_config.data_incoming}},vxlan_user,vxlan_fwd
device={{ data_incoming_list | join(",") }},vxlan_user,vxlan_fwd
sz_tunnel=8192
sz_buffer=0
[device:{{inline_device_config.data_incoming}}]
{% if traffic_attr_type == 0 %}
in_addr={{inline_device_config.keepalive_ip}}
in_mask={{inline_device_config.keepalive_mask}}
{% for device_config in inline_device_config_list %}
[device:{{device_config.data_incoming}}]
{% if traffic_attr_type == 1 %}
in_addr={{device_config.keepalive_ip}}
in_mask={{device_config.keepalive_mask}}
{% endif %}
jumbo_frame=1
max_rx_pkt_len=15360
clear_tx_flags=1
#[device:]
#jumbo_frame=1
#max_rx_pkt_len=15360
#clear_tx_flags=1
#promisc=1
{% endfor %}
[service]
# lcore id for i/o service, use comma to split
@@ -41,9 +41,3 @@ sz_indirect_pktmbuf=8192
sz_cache=256
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

View File

@@ -1,7 +1,7 @@
[tunnat]
lcore_id={{ mrtunnat.lcore_id }}
appsym=tunnat
phydev={{inline_device_config.data_incoming}}
phydev=eth0
virtdev=vxlan_fwd
nr_max_sessions=524280
nr_slots=1048576

View File

@@ -81,16 +81,16 @@ dictator_enable=0
[packet_io.internal.interface]
{% if capture_packet_type == 0 %}
type=pcap
name={{packet_io.internal_interface}}
name={{packet_io.internal_interface | join(",")}}
{% else %}
type=marsio
name={{nic_data_incoming.name}}
name={{packet_io.internal_interface | join(",")}}
{% endif %}
[packet_io.external.interface]
{% if capture_packet_type == 0 %}
type=pcap
name={{packet_io.external_interface}}
name={{packet_io.external_interface | join(",")}}
{% else %}
type=pcap
name=lo

View 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

View 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

View 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

View 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

View File

@@ -0,0 +1,5 @@
---
- include: uninstall_firewall.yml
- include: uninstall_sapp.yml
- include: uninstall_mrzcpd.yml
- include: uninstall_framework.yml

View 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