如何有效的修改Linux云服务器的hosts配置
操作场景在2018年3月1号之后,腾讯云官网提供的 Linux 公有镜像预安装了纯开源的工具 Cloud-Init,并通过 Cloud-Init 实现了实例的所有初始化操作,使得整个实例内部的操作更加的透明,详情请参见 Cloud-Init。Cloud-Init 在每次启动时会根据 /etc/cloud/templates/hosts.${os_type}.tmpl 模板生成一份新的 /etc/hosts 文件覆盖实例原有的 /etc/hosts 文件,导致用户在实例内部手动修改 /etc/hosts 配置并重启实例后, /etc/hosts 配置又变为原始默认配置。 前提条件腾讯云针对 Cloud-Init 的覆盖操作已经做了优化,2018年9月后使用公共镜像创建的实例不会出现 /etc/hosts 配置在重启后被覆盖的问题。若您的实例创建于2018年9月前,请通过下面的解决方案进行修改。 操作步骤方案一 登录 Linux 服务器。 执行...
hexo中图片无法加载
配置开关首先确认根目录_config.yml中有: 1 | post_asset_folder: true —|— 安装工具然后在blog/下执行 1 | npm install https://github.com/CodeFalling/hexo-asset-image --save —|— 创建同名的图片目录确保在blog/source/_posts下创建和md文件同名的目录,在里面放该md需要的图片,然后在md中插入 1 |  —|— 修改md文件在md文件中插入图片时只需写 1 |  —|— 配置生效配置完成之后,执行下列操作 1 2 3 | $ hexo c $ hexo g $ hexo s —|—
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post1 | $ hexo new "My New Post" —|— More info: Writing Run server1 | $ hexo server —|— More info: Server Generate static files1 | $ hexo generate —|— More info: Generating Deploy to remote sites1 | $ hexo deploy —|— M...
SLUB:Unable to Allocate Memory
故障 如图:系统日志中报出不能分配内存 解决方法: 临时解决:重启相关节点 永久解决: 升级内核:3.10.0-1062.XXX.el7.x86_64 1 2 3 | yum provides kernel yum install -y kernel-3.10.0-1062.9.1.el7.x86_64 awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg —|— * 添加内核参数 cgroup.memory=nokmem 1 2 3 4 5 6 7 8 9 10 11 | [root@acp2-node-1 ~]# cat /etc/d...
重启服务器导致docker中redis无法启动的问题解决
故障现像 harbor服务里的redis容器启动失败 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | [root@acp2-master-1 ~]# kubectl get po -n default NAME READY STATUS RESTARTS AGE docker-registry-fb854474f-jmwq5 1/1 Running 16 212d gitlab-ce-gitlab-ce-5c7b984fc-85clk 1/1 Running 8 9d gitlab-ce-gitlab-ce-database-8f7d789ff-hm2rf ...
使用etcd快照恢复集群数据
备份etcd及相关证书1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #!/bin/bash set -eux mkdir -p /cpaas/{etcd_bak,pki_bak} BACKUP_ETC_DIR=/cpaas/etcd_bak BACKUP_PKI_DIR=/cpaas/pki_bak/ IP=`/usr/sbin/ifconfig eth0 | grep -w 'inet' | awk '{print $2}'` ETCDCTL=/usr/local/bin/etcdctl TAR=/usr/bin/tar backup_etcd() { ETCDCTL_API=3 ${ETCDCTL} --endpoi...
理解和配置Out of Memory: Kill Process
理解 OOM killer最近有位 VPS 客户抱怨 MySQL 无缘无故挂掉,还有位客户抱怨 VPS 经常死机,登陆到终端看了一下,都是常见的 Out of memory 问题。这通常是因为某时刻应用程序大量请求内存导致系统内存不足造成的,这通常会触发 Linux 内核里的 Out of Memory (OOM) killer,OOM killer 会杀掉某个进程以腾出内存留给系统用,不致于让系统立刻崩溃。如果检查相关的日志文件(/var/log/messages)就会看到下面类似的 Out of memory: Kill process 信息: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ... Out of memory: Kill process 9682 (mysqld) score 9 or sacrifice child Killed process 9682, UID 27, (mysqld) total-vm:...
Captain 运维手册
captain 安装 安装包 1 | helm install --version <captain chart version> --debug --namespace=<ns> --set global.registry.address=<init registry> --set alaudaChartRepoURL=<init 节点上的 chart repo> --set namespace=<ns> --name=captain stable/captain --wait --timeout 3000 —|— kubectl-captain 在安装目录下的 other 目录里 安装要求 软件依赖 captain 依赖 cert-manager ,必须在 cert-manager 部署成功后,安装 captain 硬件依赖 均可 用 captain 替换 helm 已经通过 helm 部署的 chart 怎样迁移到 helm 上 详见升级说明文档,大致流程如下...
Helm常用命令手册
Helm 常用命令 查看版本 1 | helm version —|— 查看当前安装的charts 1 | helm list —|— 查询 charts 1 | helm search nginx —|— 下载远程安装包到本地 1 | helm fetch rancher-stable/rancher —|— 查看package详细信息 1 | helm inspect chart —|— 安装charts 1 | #helm install --name nginx --namespaces prod bitnami/nginx —|— 查看charts状态 1 | #helm status nginx —|— 删除charts 1 | #helm delete --p...
K8s环境使用老IP添加一个新的master节点
注:以下为k8s 1.16版本,并且是新加节点,无备份的操作 备份 配置etcd 3 1 2 | docker cp `docker ps |grep etcd |grep -v pause |awk '{print $1}'`:/usr/local/bin/etcdctl /tmp/ export `cat /etc/kubernetes/manifests/etcd.yaml |grep ETCDCTL_API -A1 |xargs |sed 's/^.//g' |awk '{print $1 }'` ;echo $ETCDCTL_API —|— * 获取etcd指令: 1 | export etcdctl=`cat /etc/kubernetes/manifests/etcd.yaml |grep ETCDCTL_API -A1 |xargs |sed 's/^.//g' |s...