- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
新的ansible用户(v2.3)并为github拉取了剧本,但不了解幂等性。一旦安装了Elasticsearch并从Playbook开始,我现在希望能够修改或添加es_config参数,然后重新运行Playbook,期待已更新的elasticsearch.yml配置文件并重新启动elasticsearch。但是,该include_roles elasticsearch在重新运行时会被跳过,不确定是否要进行更改以进行更改。
ansible-playbook --ask-become-pass -vv elk.yml
---
#
# Playbook to install the ELK stack
#
- hosts: servers
strategy: debug
remote_user: ansible
become: yes
become_user: root
tasks:
- debug: msg="elk main"
- include_role:
name: java
name: elasticsearch
name: kibana
name: nginx
name: logstash
vars:
es_instance_name: "node1"
es_config: {
discovery.zen.ping.unicast.hosts: "logstash-2, logstash-3",
network.host: _eno1_,
cluster.name: logstash,
node.name: "{{ ansible_hostname }}",
http.port: 9200,
transport.tcp.port: 9300,
node.data: true,
node.master: true,
bootstrap.memory_lock: true,
index.number_of_shards: 3,
index.number_of_replicas: 1
}
es_major_version: "6.x"
es_version: "6.2.1"
es_heap_size: "26g"
es_cluster_name: "logstash"
---
- name: os-specific vars
include_vars: "{{ansible_os_family}}.yml"
tags:
- always
- debug: msg="es parms"
- name: check-set-parameters
# include: elasticsearch-parameters.yml
include_tasks: elasticsearch-parameters.yml
tags:
- always
#- include: java.yml
# when: es_java_install
# tags:
# - java
#- include: elasticsearch.yml
- include_tasks: elasticsearch.yml
---
- name: Include optional user and group creation.
when: (es_user_id is defined) and (es_group_id is defined)
include_tasks: elasticsearch-optional-user.yml
- name: Include specific Elasticsearch
include_tasks: elasticsearch-Debian.yml
when: ansible_os_family == 'Debian'
---
- set_fact: force_install=no
- set_fact: force_install=yes
when: es_allow_downgrades
- name: Debian - Install apt-transport-https to support https APT downloads
become: yes
apt: name=apt-transport-https state=present
when: es_use_repository
- name: Debian - Add Elasticsearch repository key
become: yes
apt_key: url="{{ es_apt_key }}" state=present
when: es_use_repository and es_apt_key
- name: Debian - Add elasticsearch repository
become: yes
apt_repository: repo={{ item.repo }} state={{ item.state}}
with_items:
- { repo: "{{ es_apt_url_old }}", state: "absent" }
- { repo: "{{ es_apt_url }}", state: "present" }
when: es_use_repository
- name: Debian - Include versionlock
include: elasticsearch-Debian-version-lock.yml
when: es_version_lock
- name: Debian - Ensure elasticsearch is installed
become: yes
apt: name=elasticsearch{% if es_version is defined and es_version != ""
%}={{$
when: es_use_repository
register: debian_elasticsearch_install_from_repo
notify: restart elasticsearch
- name: Debian - Download elasticsearch from url
get_url: url={% if es_custom_package_url is defined %}{{
es_custom_package_ur$
when: not es_use_repository
- name: Debian - Ensure elasticsearch is installed from downloaded package
become: yes
apt: deb=/tmp/elasticsearch-{{ es_version }}.deb
when: not es_use_repository
register: elasticsearch_install_from_package
notify: restart elasticsearch
# Check for mandatory parameters
- fail: msg="es_instance_name must be specified and cannot be blank"
when: es_instance_name is not defined or es_instance_name == ''
- fail: msg="es_proxy_port must be specified and cannot be blank when
es_proxy_$
when: (es_proxy_port is not defined or es_proxy_port == '') and
(es_proxy_hos$
- debug: msg="WARNING - It is recommended you specify the parameter
'http.port'"
when: es_config['http.port'] is not defined
- debug: msg="WARNING - It is recommended you specify the parameter
'transport.$
when: es_config['transport.tcp.port'] is not defined
- debug: msg="WARNING - It is recommended you specify the parameter
'discovery.$
when: es_config['discovery.zen.ping.unicast.hosts'] is not defined
#If the user attempts to lock memory they must specify a heap size
- fail: msg="If locking memory with bootstrap.memory_lock a heap size must
be s$
when: es_config['bootstrap.memory_lock'] is defined and
es_config['bootstrap.$
#Check if working with security we have an es_api_basic_auth_username and
es_ap$
- fail: msg="Enabling security requires an es_api_basic_auth_username and
es_ap$
when: es_enable_xpack and ("security" in es_xpack_features) and
es_api_basic_$
- set_fact: file_reserved_users={{ es_users.file.keys() | intersect
(reserved_x$
when: es_users is defined and es_users.file is defined and
(es_users.file.key$
- fail:
msg: "ERROR: INVALID CONFIG - YOU CANNOT CHANGE RESERVED USERS THROUGH THE$
when: file_reserved_users | default([]) | length > 0
- set_fact: instance_default_file={{default_file |
dirname}}/{{es_instance_name$
- set_fact: instance_init_script={{init_script | dirname
}}/{{es_instance_name}$
- set_fact: conf_dir={{ es_conf_dir }}/{{es_instance_name}}
- set_fact: m_lock_enabled={{ es_config['bootstrap.memory_lock'] is defined
and$
#TODO - if transport.host is not local maybe error on boostrap checks
#Use systemd for the following distributions:
#Ubuntu 15 and up
#Debian 8 and up
#Centos 7 and up
#Relies on elasticsearch distribution installing a serviced script to
determine$
- set_fact: use_system_d={{(ansible_distribution == 'Debian' and
ansible_distri$
- set_fact: instance_sysd_script={{sysd_script | dirname
}}/{{es_instance_name}$
when: use_system_d
#For directories we also use the {{inventory_hostname}}-{{ es_instance_name
}} $
- set_fact: instance_suffix={{inventory_hostname}}-{{ es_instance_name }}
- set_fact: pid_dir={{ es_pid_dir }}/{{instance_suffix}}
- set_fact: log_dir={{ es_log_dir }}/{{instance_suffix}}
- set_fact: data_dirs={{ es_data_dirs | append_to_list('/'+instance_suffix)
}}
最佳答案
include_role的格式问题。每个角色包含一个角色的已解决问题如下:
- include_role:
name: java
- include_role:
name: elasticsearch
关于elasticsearch - elasticsearch.yml的Ansible幂等,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49722908/
我在编写数学函数时遇到了麻烦。它应该接受 3 个变量并像这样计算方程。 答案 = x(1 + y/100)^ z 我把它写成: public compute_cert (int years, doub
我正在开发一个计算器,以便更好地学习 Java。我编写了自己的代码来使用 BigDecimal 参数计算幂。截至目前,代码无法处理分数幂,例如 2^2.2。为了解决这个问题,我想在我的代码中实现指数恒
我正在寻找一种算法(或者更好的是,代码!)来生成幂,特别是奇数指数大于 1 的数字:三次幂、五次幂、七次幂等等。然后我想要的输出是 8, 27, 32, 125, 128, 216, 243, 343
在 Codewars 上找到这个。该函数接受两个参数 A 和 B,并返回 A^B 的最后一位。下面的代码通过了前两个测试用例,但不会通过下一个测试用例。 def last_digit(n1, n2):
像 2^(2%1) 这样的表达式在 GHCi 中不会进行类型检查,并且错误消息是神秘的。为什么这不起作用,我需要改变什么? 我无法转换为其他类型,我希望将其用于 27^(1%3) 等表达式。 最佳答案
我的二次幂没有达到应有的水平,所以我想也许我可以 #define 做点什么。 不幸的是,我在预处理器指令方面经验不足,我不知道如何做 for 循环之类的事情。我看了看: http://www.cplu
如何在 Math.net 中获得三角函数的幂? Expr x = Expr.Variable("x"); Expr g = (2 * x).Sinh().Pow(2); g.ToString()给出输
我正在尝试拟合这个渐近接近零(但从未达到它)的数据。 我相信最好的曲线是逆逻辑函数,但欢迎建议。关键是预期的衰减“S 曲线”形状。 这是我到目前为止的代码,以及下面的绘图图像,这是一个非常丑陋的适合。
这个问题在这里已经有了答案: The most efficient way to implement an integer based power function pow(int, int) (2
我试图获得指数非常大的 double 值的幂(Java BigInteger 可以包含它(指数),例如:10^30 ) 也就是说,我想找到类似 1.75^(10^30) 或 1.23^(3423453
我有一个数学表达式,例如: ((2-x+3)^2+(x-5+7)^10)^0.5 我需要更换 ^符号到pow C语言的功能。我认为正则表达式是我需要的,但我不知道像专业人士那样的正则表达式。所以我最终
这是我的 previous question on bit flags 的后续内容,我澄清了一些重大误解。 我需要创建这些函数来查找包含零个或多个标志的 int 中的单个位标志: BitBinaryU
我已经在 java 中为 BigInteger 尝试过 modPow() 函数。 但它需要太长时间。 我知道模乘法,甚至也知道求幂。 但由于条件限制,我无法解决这个问题。 a、b 的值可以包含 100
我是一名优秀的程序员,十分优秀!