# HITSword's Blog > Play Through Life ## 页面 - [关于](https://www.hitsword.org/about) - [留言](https://www.hitsword.org/guestbook) ## 文章 - [Proxmox VE LXC容器显示宿主CPU负载修复](https://www.hitsword.org/2023/397.html): PVE 的LXC容器默认是显示宿主CPU... - [Iptables 根据IP、端口、MAC做策略路由](https://www.hitsword.org/2021/385.html): 添加一条默认路由到188路由表: 给数据... - [Avocent IPKVM 网络连接错误问题](https://www.hitsword.org/2021/378.html): 闲鱼淘了个Avocent的IPKVM老家... - [Linux Ping实现停电关机脚本](https://www.hitsword.org/2021/375.html): 路由器IP地址192. 168. 5. ... - [[Linux笔记]Debian 10 配置GRUB串口输出控制台](https://www.hitsword.org/2021/362.html): 超微的IPMI里有个SOL(Serial... - [[Linux笔记]Centos8更换Yum国内源](https://www.hitsword.org/2020/358.html): sed -e 's|^mirrorlis... - [DirectAdmin 指定 phpmyadmin版本](https://www.hitsword.org/2020/343.html): 经常在给客户搭建DirectAdmin面... - [Directadmin修改Mysql Root密码脚本](https://www.hitsword.org/2020/341.html): #! /bin/sh random_pa... - [中兴 ZXR10 5228F交换机配置LACP](https://www.hitsword.org/2020/337.html): 先进入configure termina... - [ProxmoxVE6.x 防火墙示例](https://www.hitsword.org/2020/322.html): 参考ProxmoxVE6. x 默认防火... - [ProxmoxVE6.x 默认防火墙规则](https://www.hitsword.org/2020/311.html): 打开防火墙后默认允许以下流量 loopb... - [Nginx反向代理后在IOS下网站无法打开](https://www.hitsword.org/2020/306.html): 1. 使用Nginx 反向代理个站点,后... - [Linux USB-SSD固态硬盘开启Trim](https://www.hitsword.org/2020/301.html): 在使用Proxmox的时候,想吧SATA... - [firewall-cmd通过rich-rule和ipset封IP](https://www.hitsword.org/2020/296.html): 单独封222. 222. 222. 22... - [DirectAdmin开启Apache和PHP-FPM的STATUS页面](https://www.hitsword.org/2020/285.html): 1. 开启Apache的Status页面... - [iptables和firewall-cmd配置NAT转发重定向](https://www.hitsword.org/2020/280.html): 在做NAT转发网关时,有些站点需要做劫持... - [DirectAdmin皮肤Evolution汉化包安装](https://www.hitsword.org/2020/275.html): 感谢BakaSoniji提供汉化. 安装... - [DirectAdmin Proftpd TLS 425错误](https://www.hitsword.org/2020/271.html): 修改proftpd. conf配置: - [DirectAdmin在Centos8防火墙配置](https://www.hitsword.org/2020/267.html): #常用端口和服务 firewall-cm... - [Linux通过Find批量修改文件权限](https://www.hitsword.org/2020/263.html): #批量修改文件夹权限为755 find ... - [Proxmox更换ZFS系统盘](https://www.hitsword.org/2020/261.html): 之前配置的Proxmox服务器系统盘一律... - [Proxmox配置国内更新源](https://www.hitsword.org/2020/252.html): Debian系统源(PVE5) - [Shell脚本异步执行实现](https://www.hitsword.org/2019/245.html): 在写Shell脚本调用HTTP接口的时候... - [老毛子Padavan配置公网IPv6](https://www.hitsword.org/2019/234.html): 最近听说广州电信已经支持IPv4和IPv... - [Tengine主动监测后端服务器状态](https://www.hitsword.org/2019/232.html): Tengine附带了nginx_upst... - [Nginx使用stream模块实现无证书TCP反向代理HTTPS](https://www.hitsword.org/2019/226.html): 之前在部署小型CDN的时候实现HTTPS... - [Centos6配置静态路由](https://www.hitsword.org/2019/215.html): 方法1:写在开机脚本/etc/rc. l... - [Centos单网卡双网关配置](https://www.hitsword.org/2018/212.html): 在网关做端口映射的时候遇到这种问题。网关... - [DirectAdmin安装suhosin并禁用eval](https://www.hitsword.org/2018/207.html): 一键搜索目录下所有php - [Centos 6 + iptables 作为网关NAT转发、端口转发笔记](https://www.hitsword.org/2018/165.html): 偶尔会使用iptables的NAT转发功... - [Padavan 设置dnsmasq静态DHCP](https://www.hitsword.org/2018/162.html): 有些应用环境必须打开DHCP功能,但是又... - [HP Quanta 广达 LB6M LACP配置VLAN](https://www.hitsword.org/2018/153.html): 设置LACP参考之前文章:配置LACP教... - [HP Quanta 广达 LB6M 配置VLAN](https://www.hitsword.org/2018/139.html): 之前发过LACP配置VLAN。在先配置好... - [Ceph注意事项](https://www.hitsword.org/2018/150.html): 时间服务器 最好自建时间服务器,并注意不... - [Ceph更换Journal盘](https://www.hitsword.org/2018/145.html): 更换Journal盘有2种情况: 一. ... - [Proxmox创建集群](https://www.hitsword.org/2018/102.html): 创建和加入集群(默认配置,不建议) 创建... - [HP Quanta LB6M配置LACP](https://www.hitsword.org/2018/131.html): 连接LB6M后进入enable模式 - [HP Quanta LB6M交换机常用配置命令](https://www.hitsword.org/2018/104.html): Console连接 可以使用Cisco ... - [Proxmox 关掉烦人没有有效认购](https://www.hitsword.org/2017/94.html): 关掉后浏览器可能还有js缓存,重新启动浏... - [Proxmox apt-get update 更新报错](https://www.hitsword.org/2017/89.html): Proxmox apt-get upda... - [Proxmox systemd-timesyncd修改NTP服务器](https://www.hitsword.org/2017/87.html): 修改/etc/systemd/times... - [Proxmox ZFS 无法引导](https://www.hitsword.org/2017/82.html): Proxmox使用ZFS间歇性无法引导,... - [[开发笔记]Linux PHP获取CPU内存带宽使用情况](https://www.hitsword.org/2016/80.html) - [[开发笔记]ThinkPHP3写入配置文件](https://www.hitsword.org/2016/70.html): $config为参数的数组。 - [[开发笔记]WordPress百度地图ShortCode](https://www.hitsword.org/2015/64.html): 调用百度地图JavaScript API... - [[开发笔记]PHP获取当前页面完整URL](https://www.hitsword.org/2015/47.html): 开发用到的函数,获取当前页面的URL,自... - [[开发笔记]PHP通过浏览器头判断是否微信访客](https://www.hitsword.org/2015/42.html): 最近做了好多微信开发,常用到的一个函数。... - [[开发笔记]js修改url中某个指定的GET参数的值](https://www.hitsword.org/2015/33.html): 当一个页面上的搜索条件很多而且需要进行联... - [WordPress,你好!](https://www.hitsword.org/2013/1.html): 欢迎使用 WordPress。这是系统自... # # Detailed Content ## 页面 ## 文章 - Published: 2023-06-20 - Modified: 2023-06-20 - URL: https://www.hitsword.org/2023/397.html - 分类目录: Proxmox - 标签: Proxmox PVE 的LXC容器默认是显示宿主CPU负载的,不想让容器看到宿主机的CPU负载的话,要给lxcfs服务加参数 nano /lib/systemd/system/lxcfs. service #给/usr/bin/lxcfs加个-l参数 ExecStart=/usr/bin/lxcfs -l /var/lib/lxcfs/ #然后重启服务 systemctl daemon-reload service lxcfs restart - Published: 2021-12-03 - Modified: 2021-12-03 - URL: https://www.hitsword.org/2021/385.html - 分类目录: 网关 - 标签: iptables 添加一条默认路由到188路由表: ip route add default via 127. 0. 0. 1 table 188 给数据包mark上标签 ##根据IP iptables -t mangle -A PREROUTING -s 192. 168. 1. 100 -j MARK --set-mark 188 iptables -t mangle -A PREROUTING -d 192. 168. 1. 100 -j MARK --set-mark 188 ##根据IP段和端口 ipt... - Published: 2021-08-10 - Modified: 2021-08-10 - URL: https://www.hitsword.org/2021/378.html - 分类目录: 运维笔记 - 标签: Avocent, IPKVM 闲鱼淘了个Avocent的IPKVM老家伙。发现IPKVM连不上。 找了一下资料,记录一下: 1. 在Java控制面板里的“安全”选项,添加“例外站点”。把KVM的IP添加进去:http://x. x. x. x 2. 修改jre的安全配置文件: #C:\Program Files (x86)\Java\jre1. 8. 0_291\lib\security\java. security #注释掉原来的jdk. tls. disabledAlgorithms配置,并添加下面这个 jdk. tls... - Published: 2021-07-13 - Modified: 2021-07-13 - URL: https://www.hitsword.org/2021/375.html - 分类目录: Debian, 运维笔记 - 标签: Ping, 停电关机 路由器IP地址192. 168. 5. 1,没有接UPS。 把下面脚本写到/root/powercheck. sh并chmod +x /root/powercheck. sh赋予执行权限。 crontab -e 添加 * * * * * /root/powercheck. sh 每分钟执行。 #! /bin/sh ret=`ping -c 3 192. 168. 5. 1 | grep '0 received' | wc -l` if [ $ret -eq 0 ]; then echo 'AC ... - Published: 2021-02-10 - Modified: 2021-02-10 - URL: https://www.hitsword.org/2021/362.html - 分类目录: Debian - 标签: console, Debian, serial 超微的IPMI里有个SOL(Serial-Over-LAN)功能,折腾了一下。 nano /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="quiet" #修改成: GRUB_CMDLINE_LINUX_DEFAULT="quiet console=ttyS2,115200n8 console=tty0" #其中ttyS2通常代表COM3,ttyS0通常代表COM1. 后面的console=tty0是把内容也输出到显示器. #注意两个"console=t... - Published: 2020-12-26 - Modified: 2021-07-01 - URL: https://www.hitsword.org/2020/358.html - 分类目录: Centos - 标签: Centos, Linux sed -e 's|^mirrorlist=|#mirrorlist=|g' \ -e 's|^#baseurl=http://mirror. centos. org/$contentdir|baseurl=https://mirrors. aliyun. com/centos|g' \ -i. bak \ /etc/yum. repos. d/CentOS-Linux-AppStream. repo \ /etc/yum. repos. d/CentOS-Linux-BaseOS. repo ... - Published: 2020-11-05 - Modified: 2020-11-11 - URL: https://www.hitsword.org/2020/343.html - 分类目录: Centos - 标签: DirectAdmin 经常在给客户搭建DirectAdmin面板的时候同时装了PHP7. 3和PHP5. 6,但是由于要使用5. 6的网站太多,一个个改不现实。只能默认PHP1用5. 6,PHP2用7. 3。 但是这样又不能用最新版phpmyadmin了。看了官方论坛找到解决方案,记录一下: (更多... ) - Published: 2020-11-05 - Modified: 2020-11-05 - URL: https://www.hitsword.org/2020/341.html - 分类目录: Shell脚本 - 标签: DirectAdmin #! /bin/sh random_pass { PASS_LEN=`perl -le 'print int(rand(6))+9'` START_LEN=`perl -le 'print int(rand(8))+1'` END_LEN=$(expr ${PASS_LEN} - ${START_LEN}) SPECIAL_CHAR=`perl -le 'print map { (qw{@ ^ _ -})[rand 6] } 1'`; NUMERIC_CHAR=`perl -le 'print ... - Published: 2020-10-20 - Modified: 2020-10-20 - URL: https://www.hitsword.org/2020/337.html - 分类目录: 交换机 - 标签: 5228F, 中兴 先进入configure terminal模式 interface smartgroup1 exit lacp interface smartgroup1 lacp mode 802. 3ad exit interface xgei-1/1/1/26 smartgroup 1 mode active exit interface xgei-2/1/1/26 smartgroup 1 mode active exit ZXR10#show lacp internal Smartgroup:1 Fl... - Published: 2020-09-03 - Modified: 2020-09-03 - URL: https://www.hitsword.org/2020/322.html - 分类目录: Proxmox - 标签: ARP, Proxmox, 防火墙 参考ProxmoxVE6. x 默认防火墙规则,除去PVE默认已开放的流量,作出以下配置. 集群结构: 本地网 : vmbr0 网段:192. 168. 88. 0/24 网关:192. 168. 88. 254 集群网 : vmbr1 网段:192. 168. 34. 0/24 网关:无 存储网 : vmbr2 网段:192. 168. 35. 0/24 网关:无 使用Ceph : 是 集群防火墙: cat /etc/pve/firewall/cluster. fw [OPTIONS] ena... - Published: 2020-09-03 - Modified: 2020-09-03 - URL: https://www.hitsword.org/2020/311.html - 分类目录: Proxmox - 标签: ebtables, Proxmox, 防火墙 打开防火墙后默认允许以下流量 loopback流量 已建立连接的流量 IGMP流量 【管理端口】相同子网访问TCP8006端口(WEB管理界面)的流量 【管理端口】相同子网访问TCP5900-5999端口(VNC)的流量 【管理端口】相同子网访问TCP3128端口(SPICE)的流量 【集群网络】访问UDP5404:5405端口(Corosync)的流量 【集群网络】UDP多播流量 ICMP流量:类型3(无法到达的目标),类型4(拥塞控制),类型11(超时) 【管理端口】为安装PVE过程中设置I... - Published: 2020-06-17 - Modified: 2020-09-03 - URL: https://www.hitsword.org/2020/306.html - 分类目录: Nginx - 标签: IOS, Nginx, 反向代理 1. 使用Nginx 反向代理个站点,后端是apache。Nginx配了http和https。 2. 在电脑和安卓手机打开http和https一切正常,在ios的safari浏览器和微信内置浏览器、Chrome都打不开。 3. 一直找不到原因,搜索了好久终于知道是HTTP2返回头问题:https://www. v2ex. com/amp/t/416055 4. 解决修改nginx proxy中配置 proxy_hide_header Upgrade; - Published: 2020-06-11 - Modified: 2020-06-11 - URL: https://www.hitsword.org/2020/301.html - 分类目录: Proxmox - 标签: fstrim, Proxmox, SSD, trim, 固态硬盘 在使用Proxmox的时候,想吧SATA控制器直通给虚拟机(受制于PCIE槽不足、机箱空间不足、散热、功耗、成本等原因)。就把系统盘做到USB3. 0的SSD上。在网上找了很多资料,基本上都是英文的,配置好后还是记录一下: 1. 使用ASM1153E芯片的ngff转usb转接卡 2. 在linux系统看看硬盘是不是已经支持trim: root@pve:~#lsblk --discard /dev/sda NAME DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO sda... - Published: 2020-05-19 - Modified: 2021-11-28 - URL: https://www.hitsword.org/2020/296.html - 分类目录: Centos - 标签: Centos, firewall-cmd, ipset, 防火墙 单独封222. 222. 222. 222/24 firewall-cmd --permanent --zone=public --add-rich-rule 'rule family="ipv4" source address="222. 222. 222. 222/24" drop' firewall-cmd --reload 解封222. 222. 222. 222/24 firewall-cmd --permanent --zone=public --remove-rich-rule '... - Published: 2020-05-19 - Modified: 2020-11-05 - URL: https://www.hitsword.org/2020/285.html - 分类目录: Centos - 标签: Apache, DirectAdmin, PHP 1. 开启Apache的Status页面: vi /usr/local/directadmin/custombuild/configure/ap2/conf/extra/httpd-info. conf #在文件末端插入以下内容 #APACHE-STATUS SetHandler server-status Require ip 192. 168. 1 127 #APACHE-INFO SetHandler server-info Require ip 192. 168. 1 127 (更多..... - Published: 2020-05-17 - Modified: 2021-11-28 - URL: https://www.hitsword.org/2020/280.html - 分类目录: Centos, 网关 - 标签: firewall-cmd, iptables, NAT, 防火墙 在做NAT转发网关时,有些站点需要做劫持重定向,把一些下载站点重定向到本地的一个镜像节点。 例如mirrors. 163. com的IP是59. 111. 0. 251,重定向到本地192. 168. 1. 100 iptables命令: iptables -A PREROUTING -d 59. 111. 0. 251/32 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192. 168. 1. 100 (更多... ) - Published: 2020-03-08 - Modified: 2020-03-08 - URL: https://www.hitsword.org/2020/275.html - 分类目录: Centos - 标签: DirectAdmin 感谢BakaSoniji提供汉化. 安装: yum install git -y cd /usr/local/directadmin/data/skins/evolution/lang/ git clone https://github. com/BakaSoniji/DirectAdmin-EvolutionSkin-SimplifiedChinese. git SimplifiedChinese_Git ln -s SimplifiedChinese_Git/zh_Hans. po zh_H... - Published: 2020-02-28 - Modified: 2020-11-05 - URL: https://www.hitsword.org/2020/271.html - 分类目录: Centos - 标签: DirectAdmin 修改proftpd. conf配置: # For some clients, if not set NoSessionReuseRequired receve error "425 Unable to build data connection: Operation not permitted" TLSOptions NoSessionReuseRequired - Published: 2020-02-28 - Modified: 2020-11-11 - URL: https://www.hitsword.org/2020/267.html - 分类目录: Centos - 标签: DirectAdmin, firewall-cmd, 防火墙 #常用端口和服务 firewall-cmd --zone=public --add-service=http --permanent firewall-cmd --zone=public --add-service=https --permanent firewall-cmd --zone=public --add-service=ftp --permanent firewall-cmd --zone=public --add-port=35000-35999/tcp --permanent f... - Published: 2020-01-29 - Modified: 2020-01-29 - URL: https://www.hitsword.org/2020/263.html - 分类目录: Centos, Shell脚本 - 标签: Centos, Linux #批量修改文件夹权限为755 find -type d -print0 | xargs -0 chmod 755 #批量修改文件权限为644 find -type f -print0 | xargs -0 chmod 644 - Published: 2020-01-02 - Modified: 2020-01-02 - URL: https://www.hitsword.org/2020/261.html - 分类目录: Proxmox - 标签: Proxmox, ZFS 之前配置的Proxmox服务器系统盘一律使用ZFS Mirror模式,前段时间SMART提示有个硬盘有坏道了。拿了个新盘替换上去,做个笔记记录一下操作流程。 (更多... ) - Published: 2020-01-02 - Modified: 2021-05-22 - URL: https://www.hitsword.org/2020/252.html - 分类目录: Proxmox - 标签: Proxmox, 虚拟化 Debian系统源(PVE5) nano /etc/apt/sources. list #deb http://ftp. debian. org/debian stretch main contrib deb http://mirrors. 163. com/debian stretch main contrib #deb http://ftp. debian. org/debian stretch-updates main contrib deb http://mirrors. 163. co... - Published: 2019-11-12 - Modified: 2020-01-02 - URL: https://www.hitsword.org/2019/245.html - 分类目录: Shell脚本 - 标签: Shell脚本, 异步 在写Shell脚本调用HTTP接口的时候,遇到了异步执行的需求,实现方法如下: 脚本test1. sh #! /bin/bash echo '开始脚本 test1' #调用test2脚本并在后台运行 nohup sh test2. sh >/dev/null 2>&1 & date echo '结束脚本 test1' (更多... ) - Published: 2019-10-14 - Modified: 2019-10-14 - URL: https://www.hitsword.org/2019/234.html - 分类目录: 网关 - 标签: IPv6, Padavan, 公网 最近听说广州电信已经支持IPv4和IPv6双栈公网IP。研究了一下怎么配置。 1. 首先光猫里配置桥接和开启IPv4+IPv6,参考配置: 光猫的其他配置不要乱动,广州电信的超级管理员是telecomadmin,密码是nE7jA%5m。 (更多... ) - Published: 2019-10-10 - Modified: 2019-10-10 - URL: https://www.hitsword.org/2019/232.html - 分类目录: Nginx - 标签: Nginx, Tengine, 反向代理, 后端 Tengine附带了nginx_upstream_check_module模块,用于主动监测后端服务器状态进行宕机切换。 先编译nginx时带上参数 --add-module=modules/ngx_http_upstream_check_module (更多... ) - Published: 2019-09-29 - Modified: 2019-09-29 - URL: https://www.hitsword.org/2019/226.html - 分类目录: Nginx - 标签: CDN, HTTPS, Nginx, SSL, 反向代理 之前在部署小型CDN的时候实现HTTPS要一个个配置证书文件,不太好实现。 最近找到TCP反向代理方式,实现方法如下: 先编译nginx时带上参数 --with-stream 然后把下面代码放在nginx. conf文件里的http外面。 ##TCP by Custom stream { server { listen 443; proxy_pass 192. 168. 1. 100:443; } } 上面192. 168. 1. 100是后端地址。 通过TCP反向代理方式实现缺点是后端apac... - Published: 2019-07-16 - Modified: 2019-07-16 - URL: https://www.hitsword.org/2019/215.html - 分类目录: 网关 - 标签: Centos, 路由 方法1:写在开机脚本/etc/rc. local route add -net 10. 8. 0. 0/8 gw 192. 168. 1. 2 方法2:在route和rule配置文件配置 /etc/sysconfig/network-scripts/route-{interferface}【对应ip route add】 /etc/sysconfig/network-scripts/rule-{interferface}【对应ip rule add】 ({interferface}为网卡接口,如... - Published: 2018-10-29 - Modified: 2020-08-30 - URL: https://www.hitsword.org/2018/212.html - 分类目录: 网关 - 标签: Centos, 网关 在网关做端口映射的时候遇到这种问题。网关192. 168. 0. 1映射端口22给192. 168. 0. 100时可以,但是同时192. 168. 0. 2映射端口给192. 168. 0. 100就不行,是应为Centos数据包默认走默认网关,而不是原路返回。 网络结构如下: 网卡eth0 IP 192. 168. 0. 100/24 默认网关 192. 168. 0. 1 网卡eth0:0 IP 192. 168. 0. 101/24 专属网关 192. 168. 0. 2 (更多... ... - Published: 2018-09-21 - Modified: 2018-09-21 - URL: https://www.hitsword.org/2018/207.html - 分类目录: 未分类 - 标签: DirectAdmin, eval, PHP, suhosin cd /usr/local/directadmin/custombuild . /build set suhosin yes . /build suhosin cat /usr/local/php56/lib/php. conf. d/10-directadmin. ini echo "suhosin. executor. disable_eval = on" >> /usr/local/php56/lib/php. conf. d/20-custom. ini 一键搜索目录下所有php fin... - Published: 2018-07-15 - Modified: 2018-09-12 - URL: https://www.hitsword.org/2018/165.html - 分类目录: 网关 - 标签: Centos, iptables, NAT, 端口, 网关 偶尔会使用iptables的NAT转发功能,但是每次都没做笔记。每次都忘记导致调试半天。还是做个笔记吧: 首先开启ip转发功能 echo "1" > /proc/sys/net/ipv4/ip_forward #修改net. ipv4. ip_forward = 1 vim /etc/sysctl. conf #生效配置文件。 sysctl -p 以下命令3选一 #只指定出口网卡 iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE #指定只转... - Published: 2018-06-22 - Modified: 2018-09-12 - URL: https://www.hitsword.org/2018/162.html - 分类目录: 网关 - 标签: DHCP, dnsmasq, Padavan, 网关, 路由器 有些应用环境必须打开DHCP功能,但是又不想所有设备都能自动获取到IP怎么办?通过以下方法设置: 1. 设置静态DHCP列表 a. 使用Padavan的话先在【内部网络 (LAN)】->【DHCP 服务器】页面下方开启【手动指定 IP 的 DHCP 列表】,并填写好MAC、IP、主机名并保存。 b. 自己搭建dnsmasq服务的话,在dnsmasq. conf配置文件添加静态DHCP列表,参考如下。 (更多... ) - Published: 2018-06-20 - Modified: 2018-09-12 - URL: https://www.hitsword.org/2018/153.html - 分类目录: 交换机 - 标签: LACP, LB6M, VLAN, 交换机 设置LACP参考之前文章:配置LACP教程 以下命令设置LACP端口 1/1放行1,123两个VLAN。 (更多... ) - Published: 2018-06-20 - Modified: 2018-09-12 - URL: https://www.hitsword.org/2018/139.html - 分类目录: 交换机 - 标签: LB6M, VLAN, 交换机 之前发过LACP配置VLAN。在先配置好VLAN database后进行下面的命令,给端口绑VLAN。 以下命令把0/1端口绑定为VLAN123,并不允许VLAN1通过。 (更多... ) - Published: 2018-05-17 - Modified: 2018-05-17 - URL: https://www.hitsword.org/2018/150.html - 分类目录: Ceph - 标签: Ceph 时间服务器 最好自建时间服务器,并注意不要出现时间跳跃。否则可能出现Ceph集群挂起甚至崩溃! 备份Journal盘分区 如果没备份Journal盘分区,一旦Journal盘挂了就只能删除OSD然后重新添加OSD,并等待数据填充。 - Published: 2018-02-09 - Modified: 2018-09-12 - URL: https://www.hitsword.org/2018/145.html - 分类目录: Ceph - 标签: Ceph, Journal, 维护 更换Journal盘有2种情况: 一. Journal盘挂了,只能删除对应的OSD重新创建。 二. Journal还在运行 1. 设置noout 2. 停止关联的OSD 3. 备份Journal分区表 (更多... ) - Published: 2018-01-25 - Modified: 2018-09-12 - URL: https://www.hitsword.org/2018/102.html - 分类目录: Proxmox - 标签: KVM, Proxmox, 集群 创建和加入集群(默认配置,不建议) pvecm create test//创建集群 //pvecm create pvecm add 10. 10. 10. 1//加入集群 //pvecm add 创建和加入集群(专用网络,建议) pvecm create test --ring0_addr 10. 10. 10. 1 --bindnet0_addr 10. 10. 10. 0//创建集群 //pvecm create --ring0_addr --bindnet0_addr pvecm add... - Published: 2018-01-21 - Modified: 2018-09-12 - URL: https://www.hitsword.org/2018/131.html - 分类目录: 交换机 - 标签: LACP, LB6M, 交换机 连接LB6M后进入enable模式 configure//进入配置模式 interface 0/17-0/24//进入17端口与24端口配置(根据自己需求选择端口,最多8个) addport 1/1//把端口加入port-channel 1/1 description 'LACP-10GSW-1N2'//设置这几个端口的描述 exit//退出刚才选择的端口 interface 1/1//选择port-channel 1/1 description 'LACP-10GSW-1N2'//设置这个po... - Published: 2018-01-21 - Modified: 2018-09-12 - URL: https://www.hitsword.org/2018/104.html - 分类目录: 交换机 - 标签: Cisco, LB6M, 交换机 Console连接 可以使用Cisco Console线 波特率:9600 数据位:8 停止位:1 流量控制:无 默认账号:admin 默认密码:空 进入enable模式:enable 默认enable密码:空 刷机/备份固件 连接LB6M后进入enable模式 show bootvar //显示当前固件 copy tftp://IP/xxx. img backup//从tftp上传固件到backup boot system backup //下次启动使用backup固件启动 reload //... - Published: 2017-10-27 - Modified: 2018-09-12 - URL: https://www.hitsword.org/2017/94.html - 分类目录: Proxmox - 标签: Proxmox, 虚拟化 关掉后浏览器可能还有js缓存,重新启动浏览器再试就OK了. sed -i. bak "s/data. status ! == 'Active'/false/g" /usr/share/pve-manager/js/pvemanagerlib. js - Published: 2017-10-27 - Modified: 2018-09-12 - URL: https://www.hitsword.org/2017/89.html - 分类目录: Proxmox - 标签: KVM, Proxmox, 更新 Proxmox apt-get update 更新报错: Err:4 https://enterprise. proxmox. com/debian/pve stretch/pve-enterprise amd64 Packages 401 Unauthorized Ign:5 https://enterprise. proxmox. com/debian/pve stretch/pve-enterprise all Packages Ign:6 https://enterprise. prox... - Published: 2017-10-27 - Modified: 2018-09-12 - URL: https://www.hitsword.org/2017/87.html - 分类目录: Proxmox - 标签: KVM, NTP, Proxmox, 虚拟化 修改/etc/systemd/timesyncd. conf文件,在[Time]下加入NTP服务器列表,例: [Time] Servers=server ntp1. internal. local server ntp2. internal. local 然后重启systemd-timesyncd systemctl restart systemd-timesyncd - Published: 2017-10-27 - Modified: 2018-09-12 - URL: https://www.hitsword.org/2017/82.html - 分类目录: Proxmox - 标签: KVM, Proxmox, ZFS, 虚拟化 Proxmox使用ZFS间歇性无法引导,提示: Failed to import pool 'rpool' Manually import the pool and exit. (更多... ) - Published: 2016-04-29 - Modified: 2019-09-29 - URL: https://www.hitsword.org/2016/70.html - 分类目录: PHP - 标签: PHP, ThinkPHP, 配置文件 $config为参数的数组。 $content = ""; file_put_contents(CONF_PATH. 'config. php',$content); - Published: 2015-08-26 - Modified: 2018-09-12 - URL: https://www.hitsword.org/2015/64.html - 分类目录: PHP, WordPress - 标签: PHP, ShortCode, WordPress, 地图, 百度, 短代码 调用百度地图JavaScript API: 【APIKEY】换成自己的APIKEY function extras_scripts { wp_enqueue_script( 'map-api', 'http://api. map. baidu. com/api? v=2. 0&ak=【APIKEY】', array, NULL, false ); } add_action( 'wp_enqueue_scripts', 'extras_scripts' ); 短代码部分代码: /** * 百度地图... - Published: 2015-07-03 - Modified: 2018-09-12 - URL: https://www.hitsword.org/2015/47.html - 分类目录: PHP, 开发笔记 - 标签: PHP, URL, 开发笔记, 编程 开发用到的函数,获取当前页面的URL,自动识别HTTP和HTTPS、端口。 (更多... ) - Published: 2015-07-03 - Modified: 2018-09-12 - URL: https://www.hitsword.org/2015/42.html - 分类目录: PHP, 开发笔记 - 标签: PHP, 开发笔记, 微信, 浏览器 最近做了好多微信开发,常用到的一个函数。MARK一下。 (更多... ) - Published: 2015-07-03 - Modified: 2018-09-12 - URL: https://www.hitsword.org/2015/33.html - 分类目录: JavaScript, 开发笔记 - 标签: GET, javascript, JS, URL, 编程 当一个页面上的搜索条件很多而且需要进行联合get查询的时候,我们按照一定的规则将其组织为一个正确的url这是没有问题的,但是当这个联合查询可以无限制的进行下去的话,你该如何组织你的url呢?无限制的在当前的url后面附加你的查询参数吗?很显然这是不科学的。下面分享一个办法可以直接修改当前url中的某个参数的值而不会导致这个url中同一个参数存在多个值的情况。这在一定程度上就将url的长度控制到了最短。既人性化又利于搜索引擎的优化。下面是利用javascript修改url中某个参数的值的具体思路:... - Published: 2013-04-13 - Modified: 2017-08-24 - URL: https://www.hitsword.org/2013/1.html - 分类目录: 未分类 - 标签: Blog, Bo-Blog, HITSword, WordPress 欢迎使用 WordPress。这是系统自动生成的演示文章。编辑或者删除它,然后开始您的博客! HITSword抛弃了多年不更新的Bo-Blog,用WordPress重做一个HITSword's Blog。 此Blog定位为互联网行业Bolg啦,主要是关注一些互联网行业的信息与对此行业的一些见解与心得进行交流。 好了,不啰嗦了,有空就更新这个Blog呗。