In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to deploy Tomcat in Ansible". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to deploy Tomcat in Ansible.
Features of Ansible:
Ansible is based on Python, Paramiko, PyYAML, JinJia2 main modules use SSH to link the host, deployment is simple can use custom modules, can also use modules written in other languages, based on the module can complete a variety of tasks. 1. Prepare three machines first
Ansible machine: 192.168.52.34
Target host: 192.168.52.35
Target host: 192.168.52.36
2. Close the firewall [root@localhost ~] # systemctl stop firewalld [root@localhost ~] # setenforce 03, configure secret-free login 4, install ansibleyum-y install ansible5, Add the target host vim / etc/ansible/hosts## [webservers] # # alpha.example.org## beta.example.org## 192.168.1.100 hosts # 192.168.1.110 [tomcat] 192.168.52.35192.168.52.3 to the configuration file of ansible, and check whether the ansible is connected to the target host.
7. Upload tomcat, jdk [root@localhost ~] # rz [root@localhost ~] # rz [root@localhost ~] # lsanaconda-ks.cfg apache-tomcat-8.5.35.tar.gz jdk-8u131-linux-x64_.rpm original-ks.cfg [root@localhost ~] # 8 Write tomcat.yml [root @ localhost ~] # vim tomcat.yml---- hosts: tomcattasks:- name: turn off firewall shell: systemctl stop firewalld- name: turn off selinuxshell: setenforce 0-name: push jdk Java environment copy: src=jdk-8u131-linux-x64_.rpm dest=/root- name: create folder file: path=/opt/tomcat state=directory- name: push tomcat compressed package unarchive: src=apache-tomcat-8.5.35.tar.gz dest=/opt/ Tomcat- name: install jdkyum: name=jdk-8u131-linux-x64_.rpm state=installed- name: start tomcatshell: nohup / opt/tomcat/apache-tomcat-8.5.35/bin/startup.sh9, Check tomcat.yml [root@localhost ~] # ansible-playbook-- syntax-check tomcat.yml# this is a warning meaning can be ignored [WARNING]: Could not match supplied host pattern Ignoring: tomcatplaybook: tomcat.yml [root@localhost ~] # 10, execute tomcat.yml [root@localhost ~] # ansible-playbook tomcat.yml, thank you for reading The above is the content of "how Ansible deploys Tomcat". After the study of this article, I believe you have a deeper understanding of how Ansible deploys Tomcat, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.