当前位置:网站首页>Large scale e-commerce project - environment construction
Large scale e-commerce project - environment construction
2022-07-03 10:49:00 【Broken programmer】
1. Use docker install mysq5.7 and redis
docker pull mysql:5.7
Execute the following instructions , then mysql Just put it on
docker run -p 3306:3306 --name mysql \
-v /mydata/mysql/log:/var/log/mysql \
-v /mydata/mysql/data:/var/lib/mysql \
-v /mydata/mysql/conf:/etc/mysql \
-e MYSQL_ROOT_PASSWORD=root \
-d mysql:5.7 Use docker -ps View the running container

As shown in the figure below mysql A container has been installed and created and is running
Instructions :
docker run -p 3306:3306 --name mysql Create and launch mysql Containers
ip In front of a 3306 yes docker The port of , hinder 3306 It's inside the container mysql The port of
--name Is to give a name to the running container
-v /mydata/mysql/log:/var/log/mysql \ /mydata/mysql/log yes linux Directory of this machine , Back /var/log/mysql \ yes mysql The contents in the container , This means , Mount the directory in the container to this computer , When the files in the corresponding directory in the container change , The local linux The contents of the corresponding directory will also change , This is done to simplify the operation , You don't have to go into the container every time you want to see the file . After external modification , The interior of the container will also change .
Actually , Each container is a complete linux Running environment , take mysql Both say ,mysql The container contains linux Of kernel( kernel ) and mysql Software
To configure mysql, stay /mydata/mysql/conf New under the directory my.cnf file , Add the following configuration
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
init_connect='SET collation_connection=utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
skip-name-resolve
install redis
docker pull redis
Then configure redis, Execute the following command , establish redis Container and in mydata Mapping below redis Configuration file for
docker run -p 6379:6379 --name redis \
-v /mydata/redis/data:/data \
-v /mydata/redis/conf/redis.conf:/etc/redis/redis.conf \
-d redis redis-server /etc/redis/redis.conf test redis, start-up redis client
docker exec -it redis redis-cli

By this time redis Data can only be saved in memory , It doesn't last , To configure redis The persistence of , Turn on aof Persistence . stay redis.conf Add configuration... To the configuration file
appendonly yes
边栏推荐
- Leetcode skimming ---1
- Common scenarios in which Seata distributed transactions fail and do not take effect (transactions do not rollback)
- 项目组织战略管理
- Ut2014 learning notes
- Leetcode skimming ---189
- Leetcode skimming ---704
- QT:QSS自定义QListView实例
- Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported
- Jetson TX2 刷机
- Numpy quick start (III) -- array advanced operation
猜你喜欢

缓存路由组件
![[untitled]](/img/41/adf5638e4a36417ce8dba3f2c4d9ed.jpg)
[untitled]
![[untitled]](/img/2b/177970366174e50e75b5c820c95d08.jpg)
[untitled]

EFFICIENT PROBABILISTIC LOGIC REASONING WITH GRAPH NEURAL NETWORKS

Jupiter notebook changing font style and font size

Pytoch has been installed, but vs code still displays no module named 'torch‘

Automatic derivation of introduction to deep learning (pytoch)

8、 Transaction control language of MySQL

Interviewer: what is the internal implementation of the list in redis?
![[combinatorial mathematics] pigeon nest principle (simple form examples of pigeon nest Principle 4 and 5)](/img/0b/8dac418b32422f46a643158485c40f.jpg)
[combinatorial mathematics] pigeon nest principle (simple form examples of pigeon nest Principle 4 and 5)
随机推荐
深度学习入门之线性代数(PyTorch)
QT:QSS自定义QTableView实例
Jupiter notebook changing font style and font size
Ut2011 learning notes
Jetson TX2 刷机
Ind FHL first week
神经网络入门之矩阵计算(Pytorch)
Mysql--索引原理+如何使用
MySQL checks for automatic updates at 0:00 every day
QT:QSS自定义QToolBar和QToolBox实例
Redis 笔记 01:入门篇
正常一英寸25.4厘米,在影像领域是16厘米
QT:QSS自定义 QSplitter实例
Leaders always entrust the work to flattering employees
项目组织战略管理
Mysql5.7 installation and configuration tutorial (Graphic ultra detailed version)
如何在游戏中制作一个血条
Linear regression of introduction to deep learning (pytorch)
How to hide cvxpy warnings: warn: a- > P (column pointers) not strictly increasing, column x empty?
QT:QSS自定义QToolButton实例