Skip to content

Commit

Permalink
chore:12约9日
Browse files Browse the repository at this point in the history
  • Loading branch information
aehyok committed Dec 29, 2023
1 parent 99734bc commit 397035c
Show file tree
Hide file tree
Showing 6 changed files with 252 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/javascript/2022-10-26-redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ mariadb
redis-cli
auth sunlight2010
CONFIG SET
monitor
// 监听过滤,只监测KEYS
Expand Down
11 changes: 5 additions & 6 deletions docs/javascript/2023-10-26-培训.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,16 @@ docker -v

docker pull datalust/seq

// 设置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 --name seq -d -e ACCEPT_EULA=Y -e SEQ_FIRSTRUN_ADMINPASSWORDHASH="$SeqPwd" -v /data/work/seq/data:/data --memory=512m --memory-swap=512m -e SEQ_CACHE_SYSTEMRAMTARGET=0 -p 12000:80 -p 5341:5341 datalust/seq

docker run --restart always --name seq -d -e ACCEPT_EULA=Y -e SEQ_FIRSTRUN_ADMINPASSWORDHASH="$SeqPwd" -v /root/seq/data:/data --memory=512m --memory-swap=512m -e SEQ_CACHE_SYSTEMRAMTARGET=0 -p 12000:80 -p 5341:5341 datalust/seq
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

// nginx 进行配置转发
netstat -ntlp|grep 12000
Expand Down Expand Up @@ -269,15 +268,15 @@ echo $USER
https://github.com/zhenorzz/goploy

docker run -it \
-p 19029:80 \
-p 9000:80 \
-v ~/.ssh:/root/.ssh \
-v ~/.ssh/known_hosts:/etc/hosts \
-v /root/goploy/repository:/opt/goploy/repository \
-v /root/docker/goploy/repository:/opt/goploy/repository \
zhenorzz/goploy

docker run -it -d \
--name goploy \
-p 19029:80 \
-p 9000:80 \
-v ~/.ssh:/root/.ssh \
-v ~/.ssh/known_hosts:/etc/hosts \
-v /root/goploy/repository:/opt/goploy/repository \
Expand Down
6 changes: 3 additions & 3 deletions docs/javascript/2023-11-15-docker-mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

```
docker run -p 13306:3306 --name mysql --restart=always --privileged=true \
-v /data/work/docker/mysql/log:/var/log/mysql \
-v /data/work/docker/mysql/data:/var/lib/mysql \
-v /data/work/docker/mysql/conf:/etc/mysql \
-v /root/docker/mysql/log:/var/log/mysql \
-v /rootdocker/mysql/data:/var/lib/mysql \
-v /root/docker/mysql/conf:/etc/mysql \
-v /etc/local/docker/mysql/conf.d:/etc/mysql/conf.d \
-e MYSQL_ROOT_PASSWORD=123456 -d mysql
```
Expand Down
2 changes: 1 addition & 1 deletion docs/javascript/2023-12-23-net8.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ docker run --restart always -itd --name ak2 -p 11001:8080 ak-basic
```
docker run -d --name nginx --network mynetwork -p 80:80 -v /path/to/nginx/conf:/etc/nginx/conf.d nginx
docker run -d --name nginx --network mynetwork -p 80:80 -v /root/github/NET8.0/nginx.conf:/etc/nginx/conf.d/dvs.conf nginx
docker run --restart always -itd --name nginx -p 80:80 -v /root/github/NET8.0/nginx.conf:/etc/nginx/conf.d/dvs.conf nginx
docker run --restart always -itd --name nginx -p 80:80 -v /root/github/NET8.0/nginx.conf:/etc/nginx/conf.d/default.conf nginx
Expand Down
202 changes: 202 additions & 0 deletions docs/javascript/2023-12-28-debian.md
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!@#
```
40 changes: 40 additions & 0 deletions docs/javascript/2023-12-28-ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ docker run --restart=always \
```

## mysql配置
docker search mysql

docker pull mysql

- https://www.jianshu.com/p/e8a4ac2a92e0
```
docker run --name mysql \
Expand All @@ -120,6 +124,42 @@ 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拉取项目
```

Expand Down

0 comments on commit 397035c

Please sign in to comment.