添加单独安装文档

This commit is contained in:
Bunny 2024-07-28 00:12:36 +08:00
parent b4c6f7e863
commit 29d93f635e
7 changed files with 256 additions and 93 deletions

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/init-docs.iml" filepath="$PROJECT_DIR$/.idea/init-docs.iml" />
</modules>
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="5c10715c-69bb-4ecf-aa15-58a0bbd8c270" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/操作日志.md" beforeDir="false" afterPath="$PROJECT_DIR$/操作日志.md" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 8
}</component>
<component name="ProjectId" id="2aReJ3HnuGX1x2g25HgPbO8b2Ik" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;master&quot;,
&quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}</component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="jdk-21.0.1-openjdk-21.0.1-f644763e9732-f98dd351" />
</set>
</attachedChunks>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="5c10715c-69bb-4ecf-aa15-58a0bbd8c270" name="Changes" comment="" />
<created>1704285744174</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1704285744174</updated>
<workItem from="1704285747019" duration="14000" />
<workItem from="1704287692940" duration="4000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
</project>

View File

@ -195,7 +195,6 @@ docker ps
```sh
docker pull redis:7.0.10
mkdir -p /var/lib/docker/volumes/redis-config/_data
```
### 编写配置文件
@ -214,19 +213,29 @@ appendonly yes #redis持久化  默认是no
tcp-keepalive 300 #防止出现远程主机强迫关闭了一个现有的连接的错误 默认是300
```
删除注释
```
daemonize no
requirepass 123456
appendonly yes
tcp-keepalive 300
```
**将文件移出**
```sh
mkdir /data/redis/ -p
mv redis.conf /data/redis/redis.conf
mkdir /bunny/redis/ -p.
vim /bunny/redis/redis.conf
mv redis.conf /bunny/redis/redis.conf
```
**启动docker**
```sh
docker run -p 6379:6379 --name redis \
-v /data/redis/redis.conf:/etc/redis/redis.conf \
-v /data/redis/data:/data \
-v /bunny/redis/redis.conf:/etc/redis/redis.conf \
-v /bunny/redis/data:/data \
--restart=always \
-d redis:7.0.10 redis-server /etc/redis/redis.conf --appendonly yes
```

242
安装docker内容.md Normal file
View File

@ -0,0 +1,242 @@
# 安装docker内容
```shell
# 安装必要依赖
yum install -y yum-utils device-mapper-persistent-data lvm2
# 设置镜像源
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum list docker-ce --showduplicates | sort -r
# 安装docker
yum -y install docker-ce.x86_64
# 开机启动docker
systemctl enable docker
systemctl start docker
```
## 安装Redis
### 编写配置文件
```sh
mkdir /bunny/redis/ -p
vim /bunny/redis/redis.conf
```
**添加以下内容**
```
# bind 127.0.0.1 #注释掉这部分使redis可以外部访问
daemonize no #用守护线程的方式启动
requirepass 123456
appendonly yes #redis持久化  默认是no
tcp-keepalive 300 #防止出现远程主机强迫关闭了一个现有的连接的错误 默认是300
```
**删除注释**
```
daemonize no
requirepass 123456
appendonly yes
tcp-keepalive 300
```
### 启动docker
```sh
docker pull redis:7.0.10
docker run -p 6379:6379 --name redis_master \
-v /bunny/docker/redis/master/redis.conf:/etc/redis/redis.conf \
-v /bunny/docker/redis/master/data:/data \
--restart=always \
-d redis:7.0.10 redis-server /etc/redis/redis.conf --appendonly yes
```
## 安装MySQL
**设置开机启动**
**执行启动3306**
```sh
docker run --name mysql_master -p 3306:3306 \
-v /bunny/docker/mysql/master/conf:/etc/mysql/conf.d \
-v /bunny/docker/mysql/master/data:/var/lib/mysql \
--restart=always --privileged=true \
-e MYSQL_ROOT_PASSWORD=02120212 mysql:8.0.33
```
**执行启动3305**
```shell
docker run --name mysql_slave1 -p 3305:3306 \
-v /bunny/docker/mysql/slave1/conf:/etc/mysql/conf.d \
-v /bunny/docker/mysql/slave1/data:/var/lib/mysql \
--restart=always --privileged=true \
-e MYSQL_ROOT_PASSWORD=02120212 mysql:8.0.33
```
**修改密码:**
```sh
docker exec -it mysql_master /bin/bash
mysql -uroot -p02120212
use mysql
ALTER USER 'root'@'%' IDENTIFIED BY "02120212";
FLUSH PRIVILEGES;
```
## 安装Minio
```sh
docker run -d \
-p 9000:9000 \
-p 9090:9090 \
--name minio \
-v /bunny/docker/minio/data:/data \
-e "MINIO_ROOT_USER=bunny" \
-e "MINIO_ROOT_PASSWORD=02120212" \
minio/minio server /data --console-address ":9090"
```
## 安装Nacos
```sh
docker run --name nacos -e MODE=standalone -p 8848:8848 -p 9848:9848 -d nacos/nacos-server:v2.1.0
```
## 安装rabbitmq
```sh
docker run \
-e RABBITMQ_DEFAULT_USER=bunny \
-e RABBITMQ_DEFAULT_PASS=02120212 \
-v /bunny/docker/rabbitmq/plugin:/plugins \
--name rabbitmq \
--hostname rabbitmq \
-p 15672:15672 \
-p 5672:5672 \
--network rabbitmq \
-d rabbitmq:3.8-management
```
### 进入容器
```sh
docker exec -it rabbitmq bash
rabbitmq-plugins enable rabbitmq_management
```
### 无法登录
```sh
#进入容器
docker exec -it 你的容器名或者id /bash
# 添加用户
rabbitmqctl add_user 用户名 密码
# 如果存在可以先删除
rabbitmqctl delete_user 用户名
#设置用户操作权限
rabbitmqctl set_user_tags 用户名 administrator
```
#### 添加
```sh
#进入容器
docker exec -it 你的容器名或者id /bin/bash
# 添加用户
rabbitmqctl add_user admin 123456
#设置用户操作权限
rabbitmqctl set_user_tags admin administrator
```
## 安装elasticsearch
### 创建网络
```sh
docker network create es-net
```
### 加载镜像
```sh
# 导入数据
docker load -i es.tar
```
### 部署
```sh
docker run -d \
--name elasticsearch \
-e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \
-e "discovery.type=single-node" \
-v /bunny/docker/es/data:/usr/share/elasticsearch/data \
-v /bunny/docker/es/plugins:/usr/share/elasticsearch/plugins \
--privileged \
--network es-net \
-p 9200:9200 \
-p 9300:9300 \
--restart=always elasticsearch:7.12.1
```
> 验证http://192.168.3.98:9200/
## Harbor安装
### 下载Harbor
github下载地址https://github.com/goharbor/harbor/releases
```shell
# 解压tgz包
tar -zxvf harbor-offline-installer-v2.10.1.tgz
# 进入目录后进行复制配置文件
cd harbor/
# 创建一个配置文件
cp harbor.yml.tmpl harbor.yml
# 修改配置文件
vim harbor.yml
```
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/a858dc861de941c2a524e88629895e1a.png)
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/96d1256a5e3dfc2a23f124537ea94c0e.png)
在我的当前版本中默认密码修改后无法访问,需要查看数据库密码
```bash
# 进入容器
docker exec -it harbor-core bash
# 查看密码
printenv | grep PASSWORD
```
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/db3790d36b78a5ccf0627c468f03d64d.png)
### 安装Harbor
```shell
sh install.sh
```
启动相关命令
这个启动方式需要在你的目录/harbor/下执行,我的当前目录是/root/harbor/所以需要在这个目录下启动,否则会报找不到指定文件等错误。
```shell
# 关闭 Harbor
docker compose -f docker-compose.yml stop
# 启动 Harbor
docker compose -f docker-compose.yml up -d
```