
记录从零开始,使用 vuepress 搭建博客部署到 GitHub pages 的过程
心有所向 日复一日 必有精进✨
记录从零开始,使用 vuepress 搭建博客部署到 GitHub pages 的过程
并发、IO、容器的工具类不会在本文提及,后面会有专题一一道来。
https://github.com/coder-xuyong/netty
private final ServerBootstrap serverBootstrap = new ServerBootstrap();
private final EventLoopGroup bossGroup = new NioEventLoopGroup(1);
private final EventLoopGroup workerGroup = new NioEventLoopGroup(2);
public NettyServer() {
serverBootstrap
.group(bossGroup, workerGroup)
.channel(NioServerSocketChannel.class)
.childHandler(new ChannelInitializer<NioSocketChannel>() {
@Override
protected void initChannel(NioSocketChannel ch) {
ch.pipeline().addLast(new StringDecoder());
}
});
}
public void start(int port) {
ChannelFuture channelFuture = serverBootstrap.bind(port);
channelFuture.addListener(future -> {
if (future.isSuccess()) {
log.info("端口[{}]绑定成功", port);
} else {
log.error("端口[{}]绑定异常!", port);
}
});
try {
// 阻塞在此处,直到绑定端口完成
channelFuture.sync();
} catch (InterruptedException e) {
log.error(e.getMessage());
e.printStackTrace();
}
}
从jdk1.4起,JDK开始自带一套日志系统。JDK Logger最大的优点就是不需要任何类库的支持,只要有Java的运行环境就可以使用。
JDK默认的logging配置文件为:$JAVA_HOME/jre/lib/logging.properties,可以使用系统属性java.util.logging.config.file指定相应的配置文件对默认的配置文件进行覆盖,比如, java -Djava.util.logging.config.file=myfile
JDK Logging把日志分为如下七个级别,等级依次降低。
日志使用中出现的错误
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
在 github 中找到 redis 的版本发布页面,选择相应的版本。
点击链接:https://github.com/tporadowski/redis
找到右边的 release ,点击跳转后,选择合适的版本下载安装(如*.zip)。
在Redis的安装目录下打开cmd窗口
查看版本:
redis-server --version
DNS(域名系统,Domain Name System)适用于将 域名 转换为 IP 的服务。
域名与 IP 的映射:DNS 本质上是一个分布式数据库,存储了域名与对应 IP 地址的映射关系。
根域(.) → 顶级域(.com) → 二级域(sbnvidia.com) → 子域(www.sbnvidia.com)
database1 ——> 生成 IBD
IBD ——> database2
其中 database1 和 database2 的版本要一致。
此外
需要有表结构的备份。
表结构的 ROW_FORMAT 最好为 DYNAMIC
使用下面命令删除新建表的表空间(即新表的.ibd 文件)。
ALTER TABLE tableName DISCARD TABLESPACE;
union
用于把来自多个 select
语句的结果组合到一个结果集合中。
语法为:
select column,......from table1
union [all]
select column,...... from table2
...
通过 CDN(内容分发网络)将静态资源缓存到全球节点,显著提升访问速度。
因此可使用 cdn 提升 github pages 访问速度慢的问题。
访问阿里云官网获取:https://wanwang.aliyun.com/domain
身份验证需要花费半小时的时间。