Halo博客FAQ以及升级手册

Halo博客FAQ以及升级手册

misty 496 2021-06-16

基础设置问题

更换头像镜像源

因为默认的镜像源在国内是无法访问的,会导致浏览器tab页面一直卷圈圈(逼死强迫症啊),所以需要替换一下镜像源
系统/博客设置/Gravatar镜像源/设置为//gravatar.loli.net/avatar/

Halo升级问题

直接按照官方迁移文档将1.4.3迁移到1.4.8使用docker部署出现如下问题

  • https://docs.halo.run/install/docker
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
        at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-java-8.0.23.jar:8.0.23]

....

org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[application/:na]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:107) ~[application/:na]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[application/:na]
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[application/:na]
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure

docker容器无法访问宿主主机问题

  • https://bbs.halo.run/?q=docker%20mysql

  • docker容器默认是bridge的适合h2数据库无法访问到宿主主机docker run -it -d --name halo -p 8090:8090 -v ~/.halo:/root/.halo --restart=always halohub/halo

  • 改用host网络创建容器即可 docker run -it -d --net host --name halo -p 8090:8090 -v ~/.halo:/root/.halo --restart=always halohub/halo

因为使用本机的端口和ip,那么-P或者-p可能出现如下警告


# halo