tidb-ansible 部署pump 报The error was: 'firewalld_ports' is undefined\ \ The error appears to have been in '/home/tidb/tidb-ansible-2.1.0/roles/pump/tasks/main.yml'

【概述】tidb 版本2.1.0目前正常跑着,是想 开启pump服务,但是部署pump时 ansible报错,提示说
main.yml 文件中的防火墙哪里有问题。

下面是ansible ansible-playbook deploy.yml -t pump 后的输出

TASK [systemd : reload systemd] ************************************************************************************************************************************
changed: [10.91.0.214]
changed: [10.91.0.94]

TASK [pump : prepare firewalld white list] *************************************************************************************************************************
fatal: [10.91.0.214]: FAILED! => {“msg”: "The task includes an option with an undefined variable. The error was: ‘firewalld_ports’ is undefined

The error appears to have been in ‘/home/tidb/tidb-ansible-2.1.0/roles/pump/tasks/main.yml’: line 53, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

\

  • name: prepare firewalld white list
    ^ here
    "}
    fatal: [10.91.0.94]: FAILED! => {“msg”: "The task includes an option with an undefined variable. The error was: ‘firewalld_ports’ is undefined

    The error appears to have been in ‘/home/tidb/tidb-ansible-2.1.0/roles/pump/tasks/main.yml’: line 53, column 3, but may
    be elsewhere in the file depending on the exact syntax problem.

    The offending line appears to be:

    \
  • name: prepare firewalld white list
    ^ here
    "}
    to retry, use: --limit @/home/tidb/tidb-ansible-2.1.0/retry_files/deploy.retry

PLAY RECAP *********************************************************************************************************************************************************
10.91.0.113 : ok=4 changed=0 unreachable=0 failed=0
10.91.0.196 : ok=4 changed=0 unreachable=0 failed=0
10.91.0.214 : ok=21 changed=1 unreachable=0 failed=1
10.91.0.68 : ok=4 changed=0 unreachable=0 failed=0
10.91.0.87 : ok=4 changed=0 unreachable=0 failed=0
10.91.0.94 : ok=20 changed=1 unreachable=0 failed=1
localhost : ok=1 changed=0 unreachable=0 failed=0

ERROR MESSAGE SUMMARY **********************************************************************************************************************************************
[10.91.0.214]: Ansible FAILED! => playbook: deploy.yml; TASK: pump : prepare firewalld white list; message: {“msg”: "The task includes an option with an undefined variable. The error was: ‘firewalld_ports’ is undefined

The error appears to have been in ‘/home/tidb/tidb-ansible-2.1.0/roles/pump/tasks/main.yml’: line 53, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

\

  • name: prepare firewalld white list
    ^ here
    "}
    [10.91.0.94]: Ansible FAILED! => playbook: deploy.yml; TASK: pump : prepare firewalld white list; message: {“msg”: "The task includes an option with an undefined variable. The error was: ‘firewalld_ports’ is undefined

    The error appears to have been in ‘/home/tidb/tidb-ansible-2.1.0/roles/pump/tasks/main.yml’: line 53, column 3, but may
    be elsewhere in the file depending on the exact syntax problem.

    The offending line appears to be:

    \
  • name: prepare firewalld white list
    ^ here
    "}
    Ask for help:
    Contact us: support@pingcap.com
    It seems that you encounter some problems. You can send an email to the above email address, attached with the tidb-ansible/inventory.ini and tidb-ansible/log/ansible.log files and the error message, or new issue on https://github.com/pingcap/tidb-ansible/issues. We’ll try our best to help you deploy a TiDB cluster. Thanks. :slight_smile:
    [tidb@endong-test-6 10:10:29 ~/tidb-ansible-2.1.0]/$ ansible-playbook deploy.yml -t pump

【背景】tidb版本是2.1.0,然后想部署开启pump服务。执行命令
ansible-playbook deploy.yml -t pump

【现象】业务和数据库现象

【业务影响】

【TiDB 版本】
mysql> select tidb_version();
±--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
±--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v2.1.0-rc.3-199-gc84537d
Git Commit Hash: c84537dc944853c02c2ead9500cedf681eb4a175
Git Branch: master
UTC Build Time: 2018-11-19 06:24:07
GoVersion: go version go1.11 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
±--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

inventory.ini 文件如下

TiDB Cluster Part

[tidb_servers]
10.91.0.214
10.91.0.94
10.91.0.68
[tikv_servers]
10.91.0.113
10.91.0.196
10.91.0.87
[pd_servers]
10.91.0.214
10.91.0.94
10.91.0.68
[spark_master]

[spark_slaves]

[lightning_server]

[importer_server]

Monitoring Part

prometheus and pushgateway servers

[monitoring_servers]
10.91.0.68
[grafana_servers]
10.91.0.68

node_exporter and blackbox_exporter servers

[monitored_servers]
10.91.0.214
10.91.0.94
10.91.0.68
10.91.0.113
10.91.0.196
10.91.0.87

[drainer_servers]

Group variables

[pd_servers:vars]

location_labels = [“zone”,“rack”,“host”]

Global variables

[all:vars]
deploy_dir = /tidbdata/tidb/deploy

Connection

ssh via normal user

ansible_user = tidb

cluster_name = zhao-tidbcluster-test

tidb_version = latest

process supervision, [systemd, supervise]

process_supervision = systemd

timezone = Asia/Shanghai

enable_firewalld = False

check NTP service

enable_ntpd = False
set_hostname = False

binlog trigger

enable_binlog = True
[pump_servers]
10.91.0.214
10.91.0.94

kafka cluster address for monitoring, example:

kafka_addrs = “192.168.0.11:9092,192.168.0.12:9092,192.168.0.13:9092”

kafka_addrs = “”

zookeeper address of kafka cluster for monitoring, example:

zookeeper_addrs = “192.168.0.11:2181,192.168.0.12:2181,192.168.0.13:2181”

zookeeper_addrs = “”

store slow query log into seperate file

enable_slow_query_log =True

enable TLS authentication in the TiDB cluster

enable_tls = False

KV mode

deploy_without_tidb = False

Optional: Set if you already have a alertmanager server.

Format: alertmanager_host:alertmanager_port

alertmanager_target = “”

grafana_admin_user = “admin”
grafana_admin_password = “admin”

Collect diagnosis

collect_log_recent_hours = 2

enable_bandwidth_limit = True

default: 10Mb/s, unit: Kbit/s

collect_bandwidth_limit = 10000

‘firewalld_ports’ 这个参数如果不需要删除掉吧

你的意思是在main.yml 里注释掉‘firewalld_ports’么?

是的哈 ~ 另外如果部署的,我建议部署 4.0 或者 5.0 部署支持线上使用。可以先将 TiDB 集群通过 TiUP 工具升级到 4.0 或者 5.0 版本,然后部署 TiCDC 工具或者 TiDB-binlog 工具支持线上业务。

感谢,你说的对的,我这里的线上版本是2.1.0,正式由于版本比较老,所有才想计划要升级到4.0.9.所以才在测试环境中遇到一些问题的

现在问题解决了吗 ?

你好,注释掉之后,没有报错了。感谢!

感谢反馈:ok_hand:

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。