首页 > 其他分享 >5、tomcat_install_docker

5、tomcat_install_docker

时间:2023-02-09 03:12:18浏览次数:43  
标签:bin install tomcat etc && mysql docker DIR

#!/bin/bash
#
#********************************************************************
#Author:		    zhuzikang
#QQ: 			    985848343
#Date: 			    2021-08-18
#FileName:		    wcp.sh
#URL: 			    www.zhuzikang.cn
#Description:		The test script
#Copyright (C): 	2021 All rights reserved
#********************************************************************
DIR=`pwd`
PORINT_NAME="mysql-5.7.32-linux-glibc2.12-x86_64"
PACKAGE_NAME="${PORINT_NAME}.tar.gz"
DOCKER_FILE=${DIR}/${PACKAGE_NAME}
DIR2="/usr/local"
PORINT_NAME2="apache-tomcat-7.0.109"
PACKAGE_NAME2="apache-tomcat-7.0.109.tar.gz"
DOCKER_FILE2=${DIR2}/${PORINT_NAME2}

centos_install_docker(){
    grep "Kernel"  /etc/issue  &> /dev/null
    if [ $? -eq 0 ];then
        /bin/echo "当前系统是`cat /etc/redhat-release`,即将开始系统初始化、配置与安装mysql" && sleep 1
       systemctl stop firewalld && systemctl disable firewalld && echo "防火墙已关闭" && sleep 1
      systemctl stop NetworkManager && systemctl disable NetworkManager && echo  "NetworkManager" && sleep 1
      sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux && setenforce 0 && echo "selinux 已关闭" && sleep 1

      /bin/tar xvf ${DOCKER_FILE}
     if [ -e  ${DIR}/mysql ];then 
         action "mysql  已经安装" false
         exit  3
    else
        mv  ${DIR}/${PORINT_NAME}     mysql
        mkdir -p  ${DIR}/mysql/logs
     fi
     grep mysql  /etc/passwd &> /dev/null
      if [ $? -eq 1 ];then      
     groupadd -r mysql && useradd -r -g mysql -s /sbin/nologin -M mysql
     chown -R mysql:mysql  ${DIR}/mysql
      fi 

     \cp -rf  ${DIR}/mysql/support-files/mysql.server  /etc/init.d/mysqld
     chmod +x /etc/init.d/mysqld
     /lib/systemd/systemd-sysv-install enable mysqld
     systemctl enable mysqld  
     if [ $? -eq 0 ];then        
     /lib/systemd/systemd-sysv-install enable mysqld
    systemctl restart mysqld
    fi
    echo "export MYSQL_HOME=/opt/mysql"  >>  /etc/profile 
    echo "export PATH=\$PATH:\$MYSQL_HOME/bin"  >>  /etc/profile 

     source /etc/profile
     yum install libaio*  -y

     cat > /etc/my.cnf <<-EOF
[mysqld]
datadir=${DIR}/mysql/data
basedir=${DIR}/mysql
socket=${DIR}/mysql/mysql.sock
lower_case_table_names=1
!includedir /etc/my.cnf.d 
EOF

     mysqld --initialize-insecure --user=mysql --basedir=${DIR}/mysql --datadir=${DIR}/mysql/data
     systemctl start mysqld && systemctl status mysqld
     ln -sv ${DIR}/mysql/mysql.sock   /tmp/mysql.sock 
     service mysql restart  && source /etc/profile  && exit
  
  fi
}

tomcat_install_docker(){
      grep windows /etc/passwd &> /dev/null
      if [ $? -eq 1 ];then      
      useradd windows &&  groupadd  windows
      fi 
      /bin/tar xvf ${DIR}/${PACKAGE_NAME2} -C  ${DIR2}
      chown -R  windows.windows   ${DOCKER_FILE2}
      ${DOCKER_FILE2}/bin/catalina.sh  start
}

main(){
tomcat_install_docker
centos_install_docker
}

main

标签:bin,install,tomcat,etc,&&,mysql,docker,DIR
From: https://www.cnblogs.com/zikang/p/17103939.html

相关文章

  • 6、install_jdk
    #!/bin/bash#[----------]#--------------------------------------------------------------#Author:jackie#QQ:[email protected]......
  • 7、install_mysql_httpd_php_wordpress
    #!/bin/bash##********************************************************************#Author: zikang#QQ: [email protected]#Date: 2021-03-03......
  • 通过Docker安装JIRA和Confluence
    一、安装mysql5.7dockerfile#启动容器mysqldockerrun--namemysql\--restartalways\-p3306:3306\-eMYSQL_ROOT_PASSWORD=zagame10086\-v......
  • 记录一次vue部署docker步骤
    vue部署docker拉取nginx镜像dockerpullnginx有Dockerfile文件步骤:1、打包vuenpmrunbuild2、写一个default.conf文件,替换镜像中的conf文件server{liste......
  • centOS中安装docker
    docker问题1.安装docker下载依赖环境 yum-yinstallyum-utilsdevice-mapper-persistent-datalvm2指定Docker镜像源 #使用的是阿里的 yum-config-ma......
  • Docker安装
    卸载旧版本yumremovedocker\docker-client\docker-client-latest\docker-common\d......
  • Docker-harbor私有仓库的部署与管理
    一、Harbor概述1、Harbor的概念•Harbor是VMware公司开源的企业级DockerRegistry项目,其目标是帮助用户迅速搭建一个企业级的DockerRegistry服务•Harbor以Docker......
  • docker容器ping不通宿主机与外网问题排查及解决
    一台虚拟机里突然遇到docker容器一直重启,看了下logs,发现是访问外网失败引起的,网上看到这个解决方案,这边记录一下。首先需要明确docker的网桥模式,网桥工作在二层(OSI堆栈),是通......
  • Docker 部署Prometheus
    拉取镜像dockerpullprom/prometheus:latest创建网络(可不用)#方便其他组件连接Prometheusdockernetworkcreateprom-network--driverbridge持久化数据库(可......
  • Solon 能打出 war 包放到 tomcat 下运行吗?
    Solon是一个强调自启动的框架,原则上是不推荐war容器运行的,但总会有些甲方有硬性规定,或者旧环境不能变。1、操作指南:在普通项目增加几项内容即可打war包(仍可打jar......