Detailed process analysis of docker deployment of snail cinema system

Detailed process analysis of docker deployment of snail cinema system

Environmental Statement

  • Host OS: Cetnos7.9 Minimum installation
  • docker Version: 20.10.6
  • System requirements: CPU 2 cores or above, 8G memory

If the number of CPU cores is less than 2, the theater will not be able to log in

  • mysql database: mysql5.6 container
  • redis database: redis4.0 container

Install centos7.9

First stop the firewall and turn off SELinux

Check the firewall status

firewall-cmd --state
# or systemctl status firewalld.service

Stop the firewall

systemctl stop firewalld.service

Disable firewall startup

systemctl disable firewalld.service

Permanently disable selinux (optional)

Enter the /etc/selinux/config file

vi /etc/selinux/config

Change SELINUX=enforcing to SELINUX=disabled

Disable SELinux service

setenforce 0

Check SELinux status

sestatus

Install dependency packages

# Install redhat-lsb
yum install -y redhat-lsb
# Install yum-config-manager, otherwise it will report: yum-config-manager: command not found yum -y install yum-utils
# Snail Ticketing depends on net-tools
yum install net-tools -y

Install Docker on CentOS 7.9

# Configure aliyun's docker installation source yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

Install Docker dependencies

yum install -y yum-utils device-mapper-persistent-data lvm2

Check the docker version in the installation source

yum list docker-ce --showduplicates | sort -r

Install the latest version of Docker (20.10.6)

yum install docker-ce -y

Check the Docker version

docker version

Configure Docker image aliyun accelerator

# Create the /etc/docker directory mkdir -p /etc/docker

#Edit and create daemon.json
tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://isdp30x2.mirror.aliyuncs.com"]
}
EOF

Restart the Docker daemon

# Restart the daemon process sudo systemctl daemon-reload
# Restart the docker service sudo systemctl restart docker 
# Set Docker to start automatically at boot systemctl enable docker

Deploy redis in docker

Create a local mount directory

mkdir /data/redis/{conf,data} -p

Create a redis container

# First enter the /data/redis/directory cd /data/redis

# Create and run a container named myredis docker run -itd --name myredis \
-p 6379:6379 \
-v /data/redis/data:/data \
--restart always redis --appendonly yes --requirepass "123456"

# Parameter explanation -d -> Start the container as a daemon -p 6379:6379 -> Bind to host port, 6379 host port, 6379 container port --name myredis -> Specify container name --restart always -> Start at boot# --privileged=true -> Increase permissions in the container --requirepass -> Set login password -v /data/redis/data:/data -> Map data directory --appendonly yes -> Enable data persistence

Docker deployment of mysql5.6

Docker runs mysql and persists data

Pull the mysql5.6 image:

docker pull mysql:5.6

Create a mysql local data storage mapping directory:

#MySQL's default data directory is /var/lib/mysql/
#Configure foldersudo mkdir -p /data/mysql/conf
## Create a persistent data folder for mysql data sudo mkdir -p /data/mysql/data
## Create a mysql log folder sudo mkdir -p /data/mysql/logs

## Create mkdir /data/mysql/{conf,data,logs} -p at one time

Running the MySQL container

docker run -dti -p 3306:3306 --name mysql56 -v /data/mysql/conf:/etc/mysql/conf.d -v /data/mysql/logs:/logs -v /data/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=Woniu123 --restart=always mysql:5.6

Use navicat to connect to the database, restore the database character encoding to utf8mb4 , and sort by default

insert image description here

Install jdk8 on the host

1. Download JDK8 from the official website

Address: http://www.oracle.com/technetwork/articles/javase/index-jsp-138363.html

Select the corresponding .gz package to download

2. Unzip and put it in the specified directory (take jdk-7u60-linux-x64.gz as an example)

Create a directory:

sudo mkdir /usr/lib/jvm

Unzip to the specified directory:

 sudo tar -zxvf jdk-7u60-linux-x64.gz -C /usr/lib/jvm

3. Modify environment variables:

sudo vim ~/.bashrc

Append the following to the end of the file:

#set oracle jdk environment

export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_60 ## Note that the directory should be changed to the JDK directory you unzipped export JRE_HOME=${JAVA_HOME}/jre  
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH

Make the environment variable take effect immediately

 source ~/.bashrc

Check whether jdk is effective

# View the java main program directory which java
# Check the java version java -version

Upload the server program qianyao directory to the host machine's /opt directory

Start the Cinema Server

cd /opt/qianyao
# Start the server./qianyao.sh start all
# Wait for all 10 service programs to start, which takes about two minutes 

insert image description here

Testing Process

  • Backstage
  • New Cinema
  • New screening room
  • Add Movies
  • Search Movies
  • Buy movie tickets
  • Payment

The above is the detailed content of the detailed process analysis of the docker deployment of the snail cinema system. For more information about docker deployment of snail, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • How to build a docker local image warehouse under centos7 system
  • Detailed explanation of Docker container basic system image packaging
  • Detailed explanation of how to mount the file system in a running Docker container

<<:  MySQL data table partitioning strategy and advantages and disadvantages analysis

>>:  100-1% of the content on the website is navigation

Recommend

Markup Language - List

Standardized design solutions - markup languages ...

Beginners learn some HTML tags (3)

Related articles: Beginners learn some HTML tags ...

How to configure MGR single master and multiple slaves in MySQL 8.0.15

1. Introduction MySQL Group Replication (MGR for ...

A good way to improve your design skills

So-called talent (left brain and right brain) Tha...

Introduction to the process of installing MySQL 8.0 in Linux environment

Table of contents Preface 1. Linux changes the yu...

Detailed explanation of overflow-scrolling to solve scrolling lag problem

Preface If you use the overflow: scroll attribute...

Setting up shared folders in Ubuntu virtual machine of VMWare14.0.0

This is my first blog post. Due to time constrain...

Detailed explanation of Docker basic network configuration

External Access Randomly map ports Using the -P f...

Vue project implements graphic verification code

This article example shares the specific code of ...

Detailed explanation of MySql view trigger stored procedure

view: When a temporary table is used repeatedly, ...

A brief analysis of SQL examples for finding uncommitted transactions in MySQL

A long time ago, I summarized a blog post titled ...

Difference between MySQL btree index and hash index

In MySQL, most indexes (such as PRIMARY KEY, UNIQ...

Vue+Openlayer realizes the dragging and rotation deformation effect of graphics

Table of contents Preface Related Materials Achie...

The whole process record of Vue export Excel function

Table of contents 1. Front-end leading process: 2...