-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
252 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -380,7 +380,7 @@ mariadb | |
redis-cli | ||
auth sunlight2010 | ||
CONFIG SET | ||
monitor | ||
// 监听过滤,只监测KEYS | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,202 @@ | ||
## ubuntu说明 | ||
``` | ||
https://blog.csdn.net/holyvslin/article/details/131780197 | ||
``` | ||
|
||
## 开启Docker | ||
``` | ||
// 启动docker守护进程 | ||
systemctl start docker | ||
// 配置让docker服务岁系统自动启动 | ||
systemctl enable docker | ||
// 取消开机自动启动 | ||
systemctl disable docker | ||
// 停止docker服务 | ||
systemctl stop docker | ||
// 查看docker版本,确认docker是否安装成功 | ||
docker version | ||
``` | ||
|
||
|
||
## 安装git | ||
``` | ||
// 安装git | ||
apt-get install git | ||
// 查看git版本 | ||
git version | ||
// 查看OpenSSH版本 | ||
ssh -V | ||
// 生成ssh密钥对 | ||
ssh-keygen -t rsa -b 4096 | ||
// 一路默认即可,生成 | ||
// 生成的路径一般在/root/.ssh/ | ||
// 查看 | ||
ls -li | ||
920236 -rw------- 1 root root 406 Dec 28 19:12 authorized_keys | ||
919704 -rw------- 1 root root 3369 Dec 28 19:39 id_rsa | ||
919708 -rw-r--r-- 1 root root 737 Dec 28 19:39 id_rsa.pub | ||
一般是将id_rsa.pub拷贝到服务器或者直接将里面的长字符串进行配置后使用 | ||
我这里是将id_rsa.pub 拷贝到了github上用来拉去项目的 | ||
``` | ||
|
||
## 准备mysql redis rabbitmq | ||
``` | ||
cd /root | ||
mkdir docker | ||
cd docker | ||
mkdir redis | ||
mkdir mysql | ||
mkdir rabbitmq | ||
``` | ||
|
||
## redis 配置 | ||
- 配置文件位置 | ||
- 英文版 https://raw.githubusercontent.com/antirez/redis/7.0/redis.conf | ||
- 中文版 https://juejin.cn/post/7316794084998348851?searchId=20231228200452F893C938CCCBA53BD65F | ||
|
||
我这里主要修改了 | ||
- 英文版中的requirepass密码 然后拷贝到/root/docker/redis/conf中去了 | ||
- # bind 127.0.0.1 -::1 将这一行暂时注释掉 | ||
|
||
``` | ||
docker run --restart=always \ | ||
-p 6379:6379 \ | ||
--name redis \ | ||
-e "TZ=Asia/Shanghai" \ | ||
-v /root/docker/redis/conf/redis.conf:/etc/redis/redis.conf \ | ||
-v /root/docker/redis/data:/data \ | ||
-itd redis:7.0.12 redis-server /etc/redis/redis.conf | ||
``` | ||
|
||
## mysql配置 | ||
docker search mysql | ||
|
||
docker pull mysql | ||
|
||
- https://www.jianshu.com/p/e8a4ac2a92e0 | ||
``` | ||
docker run --name mysql \ | ||
--restart always \ | ||
--privileged=true \ | ||
-p 13306:3306 \ | ||
-v /root/docker/mysql/log:/var/log/mysql \ | ||
-v /root/docker/mysql/conf/my.cnf:/etc/mysql/my.cnf \ | ||
-v /root/docker/mysql/data:/var/lib/mysql \ | ||
-e MYSQL_ROOT_PASSWORD="M9y2512!" \ | ||
-e MYSQL_USER="root" \ | ||
-e MYSQL_PASSWORD="M9y2512!" \ | ||
-d mysql:8.0 | ||
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'M9y2512!'; | ||
FLUSH PRIVILEGES; | ||
``` | ||
|
||
## rabbitmq | ||
``` | ||
docker search rabbitmq | ||
docker pull rabbitmq | ||
docker run --restart always -itd --name rabbitmq -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=admin -p 15672:15672 -p 5672:5672 rabbitmq | ||
// 15672进入rabbitmq数据管理后台的 | ||
上面创建并运行容器后其实已经设置用户名和密码来登录15672: admin admin | ||
rabbitmq port 15672端口无法访问 | ||
- https://blog.csdn.net/web18334137065/article/details/126327427 | ||
docker exec -it rabbitmq bash | ||
// 进入容器启用插件 | ||
rabbitmq-plugins enable rabbitmq_management | ||
``` | ||
|
||
## seq | ||
``` | ||
docker pull datalust/seq | ||
// 设置seq密码,默认用户名为admin | ||
SeqPwd=$(echo 'sunlight2023' | docker run --rm -i datalust/seq config hash) | ||
// 设置seq日志存放映射的路径 | ||
/usr/local/sunlight/docker/seq/data | ||
// 5341 代码里调用的路径 | ||
// 80 查看日志的UI | ||
docker run --restart always --name seq -itd -e ACCEPT_EULA=Y -e SEQ_FIRSTRUN_ADMINPASSWORDHASH="$SeqPwd" -v /root/docker/seq/data:/data --memory=512m --memory-swap=512m -e SEQ_CACHE_SYSTEMRAMTARGET=0 -p 12000:80 -p 5341:5341 datalust/seq` | ||
``` | ||
## git拉取项目 | ||
``` | ||
cd /root | ||
// 创建目录,并cd过去 | ||
mkdir github | ||
cd github | ||
//克隆项目 | ||
git clone [email protected]:aehyok/NET8.0.git | ||
//给脚本授权 | ||
chmod 777 run.sh | ||
``` | ||
|
||
## systemd 服务 | ||
``` | ||
DOTNET_FILE=aspnetcore-runtime-8.0.0-linux-x64.tar.gz | ||
export =$(pwd)/.dotnet | ||
mkdir -p "$DOTNET_ROOT" && tar zxf "$DOTNET_FILE" -C "$DOTNET_ROOT" | ||
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools | ||
``` | ||
|
||
|
||
## 安装nginx | ||
``` | ||
// 安装nginx | ||
apt install nginx | ||
// 查看版本 | ||
nginx -V | ||
``` | ||
|
||
|
||
## goploy | ||
``` | ||
docker search goploy | ||
docker pull zhenorzz/goploy | ||
//创建mysql数据库 | ||
// 并初始化数据库结构 | ||
https://github.com/zhenorzz/goploy/blob/master/database/goploy.sql | ||
// 创建docker参数 https://hub.docker.com/r/zhenorzz/goploy | ||
docker run -it \ | ||
-p 9000:80 \ | ||
-v ~/.ssh:/root/.ssh \ | ||
-v ~/.ssh/known_hosts:/etc/hosts \ | ||
-v /root/docker/goploy/repository:/opt/goploy/repository \ | ||
zhenorzz/goploy | ||
- 然后设置一些数据库的初始化参数 | ||
访问9000查看页面 | ||
初始化的用户名和密码 | ||
admin admin!@# | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters