From 63dfe77055f6a7849c18bafd0c45b91087a95796 Mon Sep 17 00:00:00 2001 From: "Harris.Chu" <1726587+HarrisChu@users.noreply.github.com> Date: Mon, 17 Jan 2022 13:55:14 +0800 Subject: [PATCH] update the idle seconds (#11) support all in one --- group_vars/all.yml | 34 ++++++++++++++++++------------- inventory.allinone.ini | 32 +++++++++++++++++++++++++++++ templates/nebula-graphd.conf.j2 | 18 ++++++++-------- templates/nebula-metad.conf.j2 | 10 ++++----- templates/nebula-storaged.conf.j2 | 8 ++++---- 5 files changed, 70 insertions(+), 32 deletions(-) create mode 100644 inventory.allinone.ini diff --git a/group_vars/all.yml b/group_vars/all.yml index 2e97d2d..a779426 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -1,24 +1,30 @@ nebula_packages: - name: - "{%- if install_source_type == 'GA' -%} + name: "{%- if install_source_type == 'GA' -%} nebula-graph-{{ nebula_version }}.{{ os_version }}.{{ arc }}.{{ pkg }} - {%- else -%} + {%- else -%} nebula-graph-{{ now()|yesterday_format }}-nightly.{{ os_version }}.{{ arc }}.{{ pkg }} {%- endif -%}" - - version: - "{%- if install_source_type.lower() == 'ga' -%} + + version: "{%- if install_source_type.lower() == 'ga' -%} {{ nebula_version }} - {%- else -%} + {%- else -%} {{ nebula_version }}-{{ now()|yesterday_format }}-nightly {%- endif -%}" - url: - "{%- if install_source_type.lower() == 'ga' -%} - https://oss-cdn.nebula-graph.io/package/{{ nebula_version }}/nebula-graph-{{ nebula_version }}.{{ os_version }}.{{ arc }}.{{ pkg }} - {%- else -%} - https://oss-cdn.nebula-graph.io/package/nightly/{{ now()|yesterday_format }}/nebula-graph-{{ now()|yesterday_format }}-nightly.{{ os_version }}.{{ arc }}.{{ pkg }} + url: "{%- if install_source_type.lower() == 'ga' -%} + https://oss-cdn.nebula-graph.com.cn/package/{{ nebula_version }}/nebula-graph-{{ nebula_version }}.{{ os_version }}.{{ arc }}.{{ pkg }} + {%- else -%} + https://oss-cdn.nebula-graph.com.cn/package/nightly/{{ now()|yesterday_format }}/nebula-graph-{{ now()|yesterday_format }}-nightly.{{ os_version }}.{{ arc }}.{{ pkg }} {%- endif -%}" - - +metad_port: 9559 +graphd_port: 9669 +storaged_port: 9779 +meta_server_addrs: [ + "{%- for metad in groups['metad'] -%} + {%- if loop.index != 1 -%} + , + {%- endif -%} + {{ hostvars[metad].ansible_default_ipv4.address }}:{{ hostvars[metad].metad_port }} + {%- endfor -%}", + ] diff --git a/inventory.allinone.ini b/inventory.allinone.ini new file mode 100644 index 0000000..6f418db --- /dev/null +++ b/inventory.allinone.ini @@ -0,0 +1,32 @@ +[all:vars] +# GA or nightly +install_source_type = nightly +#install_source_type = GA +nebula_version = 2.6.1 +os_version = el7 +arc = x86_64 +pkg = rpm + +packages_dir = {{ playbook_dir }}/packages +deploy_dir = /home/vesoft/nebula +data_dir = {{ deploy_dir }}/data + +# ssh user +ansible_ssh_user = vesoft + +force_download = False + +[metad] +metad1 ansible_ssh_host=192.168.15.13 deploy_dir=/home/vesoft/nebula/nebula1 metad_port=1559 +metad2 ansible_ssh_host=192.168.15.13 deploy_dir=/home/vesoft/nebula/nebula2 metad_port=2559 +metad3 ansible_ssh_host=192.168.15.13 deploy_dir=/home/vesoft/nebula/nebula3 metad_port=3559 + +[graphd] +graphd1 ansible_ssh_host=192.168.15.13 deploy_dir=/home/vesoft/nebula/nebula1 graphd_port=1669 +graphd2 ansible_ssh_host=192.168.15.13 deploy_dir=/home/vesoft/nebula/nebula2 graphd_port=2669 +graphd3 ansible_ssh_host=192.168.15.13 deploy_dir=/home/vesoft/nebula/nebula3 graphd_port=3669 + +[storaged] +storaged1 ansible_ssh_host=192.168.15.13 deploy_dir=/home/vesoft/nebula/nebula1 storaged_port=1779 +storaged2 ansible_ssh_host=192.168.15.13 deploy_dir=/home/vesoft/nebula/nebula2 storaged_port=2779 +storaged3 ansible_ssh_host=192.168.15.13 deploy_dir=/home/vesoft/nebula/nebula3 storaged_port=3779 diff --git a/templates/nebula-graphd.conf.j2 b/templates/nebula-graphd.conf.j2 index 51f09cd..5bcee8f 100644 --- a/templates/nebula-graphd.conf.j2 +++ b/templates/nebula-graphd.conf.j2 @@ -30,7 +30,7 @@ ########## networking ########## # Comma separated Meta Server Addresses ---meta_server_addrs={{ groups['metad']|map('map_format', '%s:9559')|join(',') }} +--meta_server_addrs={{ meta_server_addrs|join(',') }} # Local IP used to identify the nebula-graphd process. # Change it to an address other than loopback if the service is distributed or # will be accessed remotely. @@ -38,15 +38,15 @@ # Network device to listen on --listen_netdev=any # Port to listen on ---port=9669 +--port={{ hostvars[inventory_hostname].graphd_port }} # To turn on SO_REUSEPORT or not --reuse_port=false # Backlog of the listen socket, adjust this together with net.core.somaxconn --listen_backlog=1024 -# Seconds before the idle connections are closed, 0 for never closed ---client_idle_timeout_secs=0 -# Seconds before the idle sessions are expired, 0 for no expiration ---session_idle_timeout_secs=0 +# Seconds before the idle connections are closed. +--client_idle_timeout_secs=28800 +# Seconds before the idle sessions are expired. +--session_idle_timeout_secs=28800 # The number of threads to accept incoming connections --num_accept_threads=1 # The number of networking IO threads, 0 for # of CPU cores @@ -56,11 +56,11 @@ # HTTP service ip --ws_ip=0.0.0.0 # HTTP service port ---ws_http_port=19669 +--ws_http_port=1{{ hostvars[inventory_hostname].graphd_port }} # HTTP2 service port ---ws_h2_port=19670 +--ws_h2_port=2{{ hostvars[inventory_hostname].graphd_port }} # The Meta HTTP service port ---ws_meta_http_port=19559 +--ws_meta_http_port=1{{ hostvars[inventory_hostname].metad_port }} # The default charset when a space is created --default_charset=utf8 # The defaule collate when a space is created diff --git a/templates/nebula-metad.conf.j2 b/templates/nebula-metad.conf.j2 index c772166..91b5c88 100644 --- a/templates/nebula-metad.conf.j2 +++ b/templates/nebula-metad.conf.j2 @@ -23,21 +23,21 @@ ########## networking ########## # Comma separated Meta Server addresses ---meta_server_addrs={{ groups['metad']|map('map_format', '%s:9559')|join(',') }} +--meta_server_addrs={{ meta_server_addrs|join(',') }} # Local IP used to identify the nebula-metad process. # Change it to an address other than loopback if the service is distributed or # will be accessed remotely. --local_ip={{ hostvars[inventory_hostname].ansible_default_ipv4.address }} # Meta daemon listening port ---port=9559 +--port={{ hostvars[inventory_hostname].metad_port }} # HTTP service ip --ws_ip=0.0.0.0 # HTTP service port ---ws_http_port=19559 +--ws_http_port=1{{ hostvars[inventory_hostname].metad_port }} # HTTP2 service port ---ws_h2_port=19560 +--ws_h2_port=2{{ hostvars[inventory_hostname].metad_port }} # The Storage HTTP service port ---ws_storage_http_port=19779 +--ws_storage_http_port=1{{ hostvars[inventory_hostname].storaged_port }} ########## storage ########## # Root data path, here should be only single path for metad --data_path=data/meta diff --git a/templates/nebula-storaged.conf.j2 b/templates/nebula-storaged.conf.j2 index 60571d2..6c5688b 100644 --- a/templates/nebula-storaged.conf.j2 +++ b/templates/nebula-storaged.conf.j2 @@ -24,19 +24,19 @@ ########## networking ########## # Comma separated Meta server addresses ---meta_server_addrs={{ groups['metad']|map('map_format', '%s:9559')|join(',') }} +--meta_server_addrs={{ meta_server_addrs|join(',') }} # Local IP used to identify the nebula-storaged process. # Change it to an address other than loopback if the service is distributed or # will be accessed remotely. --local_ip={{ hostvars[inventory_hostname].ansible_default_ipv4.address }} # Storage daemon listening port ---port=9779 +--port={{ hostvars[inventory_hostname].storaged_port }} # HTTP service ip --ws_ip=0.0.0.0 # HTTP service port ---ws_http_port=19779 +--ws_http_port=1{{ hostvars[inventory_hostname].storaged_port }} # HTTP2 service port ---ws_h2_port=19780 +--ws_h2_port=2{{ hostvars[inventory_hostname].storaged_port }} # heartbeat with meta service --heartbeat_interval_secs=10