Untitled
ubuntu22.04 server报错:Failed to restart docker.service: Unit docker.service not found
原因
这是因为安装docker没有使用官方安装包,也没有使用apt,而是安装Ubuntu的时候我选了一同安装docker,所以是用snap安装的
现象
sudo systemctl restart docker sudo service docker restart sudo systemctl start docker.service
但是一直报错: Failed to restart docker.service: Unit docker.service not found.
解决问题的命令
sudo snap restart docker
snap包管理工具的其他用法
snap list 查看snap安装的包:
sudo snap restart docker 重启docker sudo snap remove docker 卸载docker
卸载并重新安装do ...
扩展磁盘
esxi7 分配磁盘后一定要重启机器
检查剩余空间是否已分配给卷组你当前的卷组(ubuntu-vg)可能还没有使用你在/dev/sda3上剩余的空间。首先检查卷组的可用空间:
1vgdisplay ubuntu-vg
在输出中查找Free PE / Size,查看卷组是否有未分配的空间。
123456789101112131415161718192021root@sitdb:~# vgdisplay ubuntu-vg --- Volume group --- VG Name ubuntu-vg System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 2 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV ...
Mysql 查询数据库容量
查看 MySQL「所有库」的容量大小12345678910SELECT table_schema as '数据库',sum(table_rows) as '记录数',sum(truncate(data_length/1024/1024, 2)) as '数据容量(MB)',sum(truncate(index_length/1024/1024, 2)) as '索引容量(MB)',sum(truncate(DATA_FREE/1024/1024, 2)) as '碎片占用(MB)'from information_schema.tablesgroup by table_schemaorder by sum(data_length) desc, sum(index_length) desc;123456789
特别提示:data_length 、index_length 等字段,所存储的容量信息单位是字节,所以我们要除以 2 个 1024 把字节转化为可读性更强的 MB
查看 MySQL ...
mysql 安装mysqldump
在线安装这里安装5.7
123456curl -LO https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm && \rpm -ivh mysql80-community-release-el7-3.noarch.rpm && \yum-config-manager --disable mysql80-community && \yum-config-manager --enable mysql57-community && \rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 && \yum install -y mysql-community-client && \
离线安装1、下载依赖
https://downloads.mysql.com/archives/community/
2、下载内容
123mysql-community ...
mysql学习笔记
性能监控
旧版 show profiles 显示sql 执行的过程
但是这个官网显示已经废弃了
performance_schema
默认情况开启的
show processlist 查看当前mysql 有多小个连接
idea 内存溢出oom 为题
编辑idea64.exe.vm文件的位置C:\Users\你的用户名\AppData\Roaming\JetBrains\IntelliJIdea2021.1
IntelliJIdea2021.1 是我的 IDE 版本
或者用everything 找一下就行
在idea 里面设置也是一样的
第一行为最小占用内存,第二行为最大占用内存,(我之前改了4096 都不够,日了狗了)第三行为代码使用空间,第四行为算法。
其他的参数自行查找
重启idea 即可
maven依赖传递失败问题
主 pom 定义
12345678910111213141516171819202122<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>common-must</artifactId> <version>${revision ...
maven引入第三方jar
上传到私服自己上传到私服引入即可
安装到本地仓库1mvn install:install-file -Dfile=c:/xxx/xxx.jar -DgroupId=jeewx -DartifactId=jeewx-Dversion=1.0 -Dpackaging=jar
自己创建一个本地仓库
123456<repositories> <repository> <id>maven-repository-local</id> <url>file:///${project.basedir}/lib</url> </repository></repositories>
lib 目录
1234567891011121314151617181920212223242526272829303132333435363738│ └─com ├─aspose │ └─aspose-words │ └─20.12. ...
maven自定义archetype生成项目骨架
引入archetype插件在项目添加 依赖
12345 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-archetype-plugin</artifactId> <version>3.2.1</version></plugin>
新建archetype.properties文件在项目根目录下新建archetype.properties模板规则文件
12345# 添加不需要放到模板的正则匹配excludePatterns=.idea/**,README.md,.mvn/wrapper/*,logs/**# 需要替换处理的文件后缀,默认没有yml、yamlarchetype.filteredExtensions=java,yml,yaml,xml,txt,groovy,cs,mdo,aj,jsp,gsp,vm,html,xhtml,properties,classpath,pr ...
mp生成代码工具
这里使用的版本
1mybatis-plus version 3.4.3.1
1234567891011<dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-generator</artifactId> <version>3.5.1</version></dependency><dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity-engine-core</artifactId> <version>2.3</version></dependency>
1234567891011121314151617181920212223242526272829303132333435363738 ...