# Ansible第三次练习 | ID | Creation Date | Assignee | Status | |----|----------------|----------|--------| | OSS-18 | 2020-03-10T23:58:14.000+0800 | 王宇 | 完成 | --- 1.安装zookeeper报错 !image-2020-03-16-18-37-32-523.png! 报错说明:with_item不是任务有效属性,在/root/wangyu/roles/zookeeper/tasks/main.yml着个文件中,名叫copy any scripts模块中。 解决方法: 查看/root/wangyu/roles/zookeeper/tasks/main.yml文件第18行 !image-2020-03-16-18-39-45-595.png! With_item少了个s,因该是with_items。   2.安装kafka报错 !image-2020-03-16-18-43-34-764.png! 查看/root/wangyu/roles/kafka/tasks/main.yml文件。 解决方法: !image-2020-03-16-18-45-19-458.png! 格式问题把mode权限设置放到循环上面。   3.安装kafka-manager报错 !image-2020-03-16-18-46-44-899.png! 在/root/wangyu/roles/kafka-manager/tasks/main.yml脚本中有格式错误。 解决方法: !image-2020-03-16-18-47-59-963.png! 在框中少了一个引号,添加上就行。   4.安装jdk报错 !image-2020-03-16-18-49-10-948.png! 查看/root/wangyu/roles/jdk1.8.0_73/tasks/main.yml脚本。 !image-2020-03-16-18-49-49-649.png! 报错1:reqister判断的变量混乱。 报错2:第二次判断中少配置ignore_errors: true。 解决方法: 1.捋顺判断变量名称。 2.在第二次判断模块上添加参数。   5.安装zookeeper报错 !image-2020-03-16-18-54-03-687.png! 错误原因:在剧本中只创建了一个叫bigdata的文件,不是目录。 解决方法: !image-2020-03-16-18-56-54-469.png! 把创建类型从touch改成directory   6.安装zookeeper报错 !image-2020-03-16-18-57-54-367.png! 错误原因: 错误是没有读取到version变量。 !image-2020-03-16-18-59-10-105.png! 解决方法: 修改version变量,把变量改成zookeeper.version。   7.安装zookeeper报错 !image-2020-03-16-19-00-58-867.png! Keepalived服务没有起来 解决方法: !image-2020-03-16-19-02-46-980.png! 服务名称写错   更改完服务名称后就好了。   8. 安装kafka报错 !image-2020-03-16-19-03-41-306.png! 缺少变量配置 !image-2020-03-16-19-04-03-559.png! 解决方法: 配置文件中的broker-id这个变量写错了,变量中不可以用中划线(-),改成下划线(_)就好。   9. 安装kafka报错 !image-2020-03-16-19-05-13-672.png! Ethname单词有错误。 解决方法: 改正Ethname。   10.安装zookeeper报错 !image-2020-03-16-19-06-35-959.png! 变量中的version变量的值不对。 解决方法 补全变量。   11.安装kafka-manager报错 !image-2020-03-16-19-08-20-360.png! 解决方法 !image-2020-03-16-19-09-12-858.png! 在执行脚本中加入一条命令。   # Attachments Attachment: image-2020-03-16-18-37-32-523.png ![image-2020-03-16-18-37-32-523.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10598/image-2020-03-16-18-37-32-523.png) Attachment: image-2020-03-16-18-39-45-595.png ![image-2020-03-16-18-39-45-595.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10599/image-2020-03-16-18-39-45-595.png) Attachment: image-2020-03-16-18-43-34-764.png ![image-2020-03-16-18-43-34-764.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10600/image-2020-03-16-18-43-34-764.png) Attachment: image-2020-03-16-18-45-19-458.png ![image-2020-03-16-18-45-19-458.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10601/image-2020-03-16-18-45-19-458.png) Attachment: image-2020-03-16-18-46-44-899.png ![image-2020-03-16-18-46-44-899.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10602/image-2020-03-16-18-46-44-899.png) Attachment: image-2020-03-16-18-47-17-993.png ![image-2020-03-16-18-47-17-993.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10603/image-2020-03-16-18-47-17-993.png) Attachment: image-2020-03-16-18-47-59-963.png ![image-2020-03-16-18-47-59-963.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10604/image-2020-03-16-18-47-59-963.png) Attachment: image-2020-03-16-18-49-10-948.png ![image-2020-03-16-18-49-10-948.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10605/image-2020-03-16-18-49-10-948.png) Attachment: image-2020-03-16-18-49-49-649.png ![image-2020-03-16-18-49-49-649.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10606/image-2020-03-16-18-49-49-649.png) Attachment: image-2020-03-16-18-54-03-687.png ![image-2020-03-16-18-54-03-687.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10607/image-2020-03-16-18-54-03-687.png) Attachment: image-2020-03-16-18-56-54-469.png ![image-2020-03-16-18-56-54-469.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10608/image-2020-03-16-18-56-54-469.png) Attachment: image-2020-03-16-18-57-54-367.png ![image-2020-03-16-18-57-54-367.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10609/image-2020-03-16-18-57-54-367.png) Attachment: image-2020-03-16-18-58-39-891.png ![image-2020-03-16-18-58-39-891.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10610/image-2020-03-16-18-58-39-891.png) Attachment: image-2020-03-16-18-59-10-105.png ![image-2020-03-16-18-59-10-105.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10611/image-2020-03-16-18-59-10-105.png) Attachment: image-2020-03-16-19-00-58-867.png ![image-2020-03-16-19-00-58-867.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10612/image-2020-03-16-19-00-58-867.png) Attachment: image-2020-03-16-19-02-46-980.png ![image-2020-03-16-19-02-46-980.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10613/image-2020-03-16-19-02-46-980.png) Attachment: image-2020-03-16-19-03-41-306.png ![image-2020-03-16-19-03-41-306.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10614/image-2020-03-16-19-03-41-306.png) Attachment: image-2020-03-16-19-04-03-559.png ![image-2020-03-16-19-04-03-559.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10615/image-2020-03-16-19-04-03-559.png) Attachment: image-2020-03-16-19-05-13-672.png ![image-2020-03-16-19-05-13-672.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10616/image-2020-03-16-19-05-13-672.png) Attachment: image-2020-03-16-19-06-35-959.png ![image-2020-03-16-19-06-35-959.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10617/image-2020-03-16-19-06-35-959.png) Attachment: image-2020-03-16-19-08-20-360.png ![image-2020-03-16-19-08-20-360.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10618/image-2020-03-16-19-08-20-360.png) Attachment: image-2020-03-16-19-09-12-858.png ![image-2020-03-16-19-09-12-858.png](https://gfwleak.exec.li/admin/geedge-jira/raw/branch/master/attachment/10619/image-2020-03-16-19-09-12-858.png)