全栈开发笔记

感触 置顶 精帖
sqeven 2017-12-18 10:23:40发布
42 1665
镜像下载慢,如何提高下载速度?
touch /etc/docker/daemon.json
cat >> /etc/docker/daemon.json <<EOF
{
"insecure-registries": ["0.0.0.0/0"],
"registry-mirrors": ["https://7bezldxe.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload && systemctl restart docker

如何配置Docker后端存储驱动?
以overlay为例
touch /etc/docker/daemon.json
cat >> /etc/docker/daemon.json <<EOF
{
"storage-driver": "overlay"
}
EOF
systemctl daemon-reload && systemctl restart docker

#seven# #sqeven#
追加内容 2017-12-18 11:11:35
Rancher-k8s加速安装文档
docker run -d --restart always –name rancher_server -p 8080:8080 rancher/server:stable && sudo docker logs -f rancher-server
docker run -d --name rancher-server -p 8080:8080 --restart=unless-stopped -e DEFAULT_CATTLE_CATALOG_URL='{"catalogs":{"library":{"url":"http://git.oschina.net/rancher/rancher-catalog.git","branch":"k8s-cn"}}}' rancher/server:stable && sudo docker logs -f rancher-server

Rancher基本配置:
因为Rancher修改过的设置参数无法同步到已创建的环境,所以在创建环境前要把相关设置配置好。比如,如果你想让Rancher默认去拉取私有仓库的镜像,需要配置registry.default= 参数等。

应用商店(Catalog)地址配置:在系统管理\系统设置中,找到应用商店。禁用Rancher 官方认证仓库并按照下图配置。

名称:library (全小写)
地址: https://git.oschina.net/rancher/rancher-catalog.git
分支: k8s-cn
追加内容 2019-01-08 15:11:52
# 集群
1. 集群状态
```bash
ceph -s
```
2. 集群实时运行状态
```bash
ceph -w
```
3. 集群健康状态细节
```bash
ceph health detail
```
4. 查看ceph存储空间
```bash
ceph df
```
5. 查看集群的详细配置
```bash
ceph daemon mon.by-master01 config show | more
```
6. 查看ceph log日志所在的目录
```bash
ceph-conf --name mon.node1 --show-config-value log_file
```
7. 查看集群配置
```bash
ceph --show-config
```
# mon
1. 查看mon的状态信息
```bash
ceph mon stat
```
2. 查看mon的选举状态
```bash
ceph quorum_status
```
3. 查看mon的映射信息
```bash
ceph mon dump
```
4. 删除一个mon节点
```bash
ceph mon remove node1
```
5. 获得一个正在运行的mon map,并保存在1.txt文件中
```bash
ceph mon remove node1
```
6. 查看上面获得的map
```bash
monmaptool --print 1.txt
```
7. 查看mon的详细状态
```bash
ceph daemon mon.node1 mon_status
```
# 修改配置文件
```bash
# 临时修改所有OSD和恢复相关的选项
ceph tell osd.* injectargs '--osd-max-backfills 1' # 并发回填操作数
ceph tell osd.* injectargs '--osd-recovery-threads 1' # 恢复线程数量
ceph tell osd.* injectargs '--osd-recovery-op-priority 1' # 恢复线程优先级
ceph tell osd.* injectargs '--osd-client-op-priority 63' # 客户端线程优先级
ceph tell osd.* injectargs '--osd-recovery-max-active 1' # 最大活跃的恢复请求数
```
# osd
1. 查看ceph osd运行状态
```bash
ceph osd stat
```
2. 查看osd映射信息
```bash
ceph osd dump
```
3. 查看osd的目录树
```bash
ceph osd tree / ceph osd df tree (osd使用情况)
```
4. down掉一个osd硬盘
```bash
ceph osd down 0 # down掉osd.0节点
```
5. 在集群中删除一个osd硬盘
```bash
ceph osd rm 0
```
6. 在集群中删除一个osd 硬盘 crush map
```bash
ceph osd crush rm osd.0
```
7. 在集群中删除一个osd的host节点
```bash
ceph osd crush rm node1
```
8. 查看最大osd的个数
```bash
ceph osd getmaxosd
```
9. 设置最大的osd的个数(当扩大osd节点的时候必须扩大这个值)
```bash
ceph osd setmaxosd 10
```
10. 设置osd crush的权重
```bash
ceph osd crush reweight osd.3 1.0
```
11. 把一个osd节点逐出集群
```bash
ceph osd out osd.3
```
12. 把逐出的osd加入集群
```bash
ceph osd in osd.3
```
13. 暂停osd (暂停后整个集群不再接收数据)
```bash
ceph osd pause
```
14. 再次开启osd
```bash
ceph osd unpause
```
15. 把逐出的osd加入集群
```bash
ceph osd in osd.3
```
16. 重启osd
```bash
systemctl restart ceph-osd.target
```
# pg
1. 查看pg状态
```bash
ceph pg stat
```
2. 查看pg组的映射信息
```bash
ceph pg dump
```
3. 查看一个PG的map
```bash
ceph pg map 0.3f
```
4. 查询一个pg的详细信息
```bash
ceph pg 0.26 query
```
5. 查看pg中stuck的状态
```bash
ceph pg dump_stuck unclean
ceph pg dump_stuck inactive
ceph pg dump_stuck stale
```
6. 恢复一个丢失的pg
```bash
ceph pg {pg-id} mark_unfound_lost revert
```
# pool
1. 查看pool数量
```bash
ceph osd lspools
```
2. 创建一个pool
```bash
ceph osd pool create test 100 #这里的100指的是pg组
```
3. 为一个ceph pool配置配额
```bash
ceph osd pool set-quota data max_objects 10000
```
4. 在集群中删除一个pool
```bash
ceph osd pool delete test test --yes-i-really-really-mean-it #集群名字需要重复两次
```
5. 显示集群中pool的详细信息
```bash
rados df
```
6. 给一个pool创建一个快照
```bash
ceph osd pool mksnap test test-snap
```
7. 删除pool的快照
```bash
ceph osd pool rmsnap test test-snap
```
8. 查看test池的pg数量
```bash
ceph osd pool set test pg_num 100
```
9. 设置test池的最大存储空间为100T(默认是1T)
```bash
ceph osd pool set test target_max_bytes 100000000000000
```
10. 设置test池的副本数是3
```bash
ceph osd pool set test size 3
```
11. 设置test池能接受写操作的最小副本为2
```bash
ceph osd pool set test min_size 2
```
12. 查看集群中所有pool的副本参数
```bash
ceph osd dump | grep 'replicated size'
```
13. 设置一个pool的pgp数量
```bash
ceph osd pool set test pgp_num 100
```
# ceph 常用运维操作
## ceph full 处理方法
```bash
1. 设置 osd 禁止读写
ceph osd pause
2. 通知 mon 和 osd 修改 full 阈值
ceph tell mon.* injectargs "--mon-osd-full-ratio 0.96"
ceph tell osd.* injectargs "--mon-osd-full-ratio 0.96"
3. 通知 pg 修改 full 阈值
ceph pg set_full_ratio 0.96 (Luminous版本之前)
ceph osd set-full-ratio 0.96 (Luminous版本)
4. 解除 osd 禁止读写
ceph osd unpause
5. 删除相关数据
最好是 nova 或者 glance 删除
也可以在 ceph 层面删除
6. 配置还原
ceph tell mon.* injectargs "--mon-osd-full-ratio 0.95"
ceph tell osd.* injectargs "--mon-osd-full-ratio 0.95"
ceph pg set_full_ratio 0.95 (Luminous版本之前)
ceph osd set-full-ratio 0.95 (Luminous版本)
OpenShift
https://github.com/ceph/ceph-docker
https://github.com/ceph/ceph-ansible
https://github.com/ceph/ceph-deploy

评论42

  • 2017-12-18 11:37:37 回复
  • 方法1:直接改表数据
    update user set host = '%' where user = 'root' limit 1;
    flush privileges;
    方法2:授权法
    例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。
    GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
    FLUSH PRIVILEGES;
    如果你想允许用户myuser从ip为192.168.1.6的主机连接到mysql服务器,并使用mypassword作为密码
    GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
    FLUSH PRIVILEGES;
    如果你想允许用户myuser从ip为192.168.1.6的主机连接到mysql服务器的dk数据库,并使用mypassword作为密码
    GRANT ALL PRIVILEGES ON dk.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
    FLUSH PRIVILEGES;

    2017-12-20 11:43:53 回复
  • pip install airflow[all]
    这样就可以安装所有依赖的东西,
    配置环境变量:
    export AIRFLOW_HOME=~/airflow
    配置mysql数据库存储airflow信息:
    sql_alchemy_conn = mysql://user:password@ip:port/airflow
    初始化数据库:
    airflow initdb
    启动Web Server,指定端口:
    airflow webserver –p 18080

    2017-12-20 11:47:45 回复
  • sql_mode = "STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER"

    2017-12-20 11:54:34 回复
  • sql_mode = 'NO_ENGINE_SUBSTITUTION'

    2017-12-20 11:58:37 回复
  • docker rm -f $(docker ps -qa)
    rm -rf /var/etcd/
    for m in $(tac /proc/mounts | awk '{print $2}' | grep /var/lib/kubelet); do
    umount $m || true
    done
    rm -rf /var/lib/kubelet/
    for m in $(tac /proc/mounts | awk '{print $2}' | grep /var/lib/rancher); do
    umount $m || true
    done
    rm -rf /var/lib/rancher/
    rm -rf /run/kubernetes/

    2017-12-23 23:01:55 回复
  • docker run -d --restart=unless-stopped \
    -e DEFAULT_CATTLE_CATALOG_URL='{"catalogs":{"community":{"url":"https://github.com/rancher/community-catalog.git","branch":"master"},"library":{"url":"https://github.com/niusmallnan/rancher-catalog.git","branch":"k8s-cn"}}}' \
    --name rancher-server \
    -p 8080:8080 rancher/server:stable

    2017-12-23 23:03:56 回复
  • docker login --username=xiaoseven1164749586 registry.cn-hangzhou.aliyuncs.com
    docker tag [ImageId] registry.cn-hangzhou.aliyuncs.com/sqeven/tomcat:[镜像版本号]
    docker push registry.cn-hangzhou.aliyuncs.com/sqeven/tomcat:[镜像版本号]

    2018-01-08 18:47:04 回复
  • 宝塔一键宝
    yum install -y wget && wget -O install.sh http://download.bt.cn/install/install.sh && sh install.sh
    wget -O install.sh http://download.bt.cn/install/install-ubuntu.sh && sudo bash install.sh
    /etc/init.d/bt start restart stop
    /etc/init.d/bt stop && chkconfig --del bt && rm -f /etc/init.d/bt && rm -rf /www/server/panel
    cat /www/server/panel/data/port.pl

    2018-02-07 11:11:25 回复
  • {"code":0,"msg":"OK","data":{"subscribe":1,"openid":"oy4hH1s9X6YZC4wCazAG28qf_7J8","nickname":"sqeven","sex":1,"language":"zh_CN","city":"","province":"","country":"\u5229\u6bd4\u4e9a","headimgurl":"http:\/\/thirdwx.qlogo.cn\/mmopen\/PiajxSqBRaEL6kMH6w9tfI0xMhPu68XaaJ9cYBhpibiazLLAJMiattjUqrffQ7XDAQ9wgibNibQVl0Py7XGV4DGSwGSg\/132","subscribe_time":1491538168,"unionid":"oJ_d1w9xOyQwJDxrgrT4_ygyqwFk","remark":"","groupid":100,"tagid_list":[100],"subscribe_scene":"ADD_SCENE_OTHERS","qr_scene":0,"qr_scene_str":""}}

    2018-05-14 11:58:37 回复
  • eyJpZCI6IkxUQUlHU1NSZ0FPb2t6ck4iLCJzZWNyZXQiOiJNZW5hTW16bTdKN3pQUlhWTTVYOVlxZUE3NUh1OVQiLCJkZXNjIjoiaWNhcmVwaG9uZSIsInJlZ2lvbiI6Im9zcy1jbi1zaGVuemhlbiIsIm9zc3BhdGgiOiJvc3M6Ly9za3lkYXRhL21wL25ldy8iLCJlcHRwbCI6Imh0dHBzOi8ve3JlZ2lvbn0uYWxpeXVuY3MuY29tIn0=
    2018-07-12 15:57:42 回复
  • 1. 显示所有进出链接
    netstat -anp |grep ‘ESTABLISHED’ |grep ‘python’
    //把所有的进出链接都列出来,Shadowsocks客户端在链接服务器后 本地的IP和端口 是 “进” 的,服务器在接收到Shadowsocks客户端的数据后会去访问指定的网站或IP,而这是 “出”的。这一条命令就是把这 一进一出 的信息都列出来,可以知道客户端用户连接的是哪个 SS端口,还有客户自身的IP和端口。
    2.仅显示链接服务器的用户连接
    netstat -anp |grep ‘ESTABLISHED’ |grep ‘python’ |grep ‘tcp6’
    //仅显示链接服务器的用户的链接,也就是上面一段话中说的 “进”,这个命令不会吧服务器在访问的网站或IP给列出来,纯粹用来看 Shadowsocks用户的链接信息。
    3.仅显示链接服务器的用户连接数量
    netstat -anp |grep ‘ESTABLISHED’ |grep ‘python’ |grep ‘tcp6’ |wc -l
    仅显示链接服务器的用户连接数量,有时候链接 当前服务器的 Shadowsocks用户很多,你只想知道有几个人链接,那就用这一条命令(这个链接数量不是准确的,具体看下面的注意说明)。
    4.仅显示链接服务器的用户连接并写入到文件
    netstat -anp |grep ‘ESTABLISHED’ |grep ‘python’ |grep ‘tcp6’>>/root/log.txt
    //仅显示链接服务器的用户连接并写入到文件,有时候在ssh上面查看大量文本不是一个好主意,所以保存到某个目录,然后自己去用sftp下载下来看信息是个不错的选择。

    5.如果你是多用户版(多个端口)的服务端,那么你可以用下面这个命令显示当前链接服务器的用户的SS端口
    netstat -anp |grep ‘ESTABLISHED’ |grep ‘python’ |grep ‘tcp6’ |awk ‘{print $4}’ |sort -u
    //显示当前链接服务器的用户的SS端口,这个命令会去除重复的,最后显示的只有 正在链接SS服务器的用户的SS端口。
    # CentOS6系统用这个,CentOS7用上面那个。
    netstat -anp |grep ‘ESTABLISHED’ |grep ‘python’ |grep ‘tcp’ | grep ‘::ffff:’ |awk ‘{print $4}’ |sort -u

    6.显示当前链接服务器的用户的SS端口数量
    netstat -anp |grep ‘ESTABLISHED’ |grep ‘python’ |grep ‘tcp6’ |awk ‘{print $4}’ |sort -u |wc -l
    # CentOS6系统用这个,CentOS7用上面那个。
    netstat -anp |grep ‘ESTABLISHED’ |grep ‘python’ |grep ‘tcp’ | grep ‘::ffff:’ |awk ‘{print $4}’ |sort -u |wc -l
    //显示当前链接服务器的用户的SS端口数量,这个就是显示 数量。
    7. 显示当前所有链接SS的用户IP
    netstat -anp |grep ‘ESTABLISHED’ |grep ‘python’ |grep ‘tcp6’ |awk ‘{print $5}’ |awk -F “:” ‘{print $1}’ |sort -u
    8.显示当前所有链接SS的用户IP数量
    netstat -anp |grep ‘ESTABLISHED’ |grep ‘python’ |grep ‘tcp6’ |awk ‘{print $5}’ |awk -F “:” ‘{print $1}’ |sort -u |wc -l
    注意:你经常会看到 用户IP一样但后面的端口不一样(1.1.1.1:3333、1.1.1.1:6666),那是因为他的SS客户端开了好几条TCP链接,所以一般情况下还是一个人在使用,但是也不排除路由器局域网情况下多个人同时使用,这时候也是这样显示的。
    ——————————————————————————–
    如果你想单独查看一个SS端口的链接数,那你可以看看下面几条命令。
    netstat -anp |grep ‘ESTABLISHED’ |grep ‘python’ |grep ‘tcp6’ |grep VPS_IP:SS_Port
    # 示例 netstat -anp |grep ‘ESTABLISHED’ |grep ‘python’ |grep ‘tcp6’ |grep 233.233.233.233:10000
    // 列出 当前SS端口连接的链接数。比如:服务器IP是 233.233.233.233 ,然后你想要知道链接数的端口是 10000,命令就是如上的示例。
    netstat -anp |grep ‘ESTABLISHED’ |grep ‘python’ |grep ‘tcp6’ |grep VPS_IP:SS_Port |wc -l
    # 示例 netstat -anp |grep ‘ESTABLISHED’ |grep ‘python’ |grep ‘tcp6’ |grep 233.233.233.233:10000 |wc -l

    2018-08-02 11:08:51 回复
  • T val = ExprEval ( this->m_pArg, tMatch )
    define USE_LIBICONV 0
    git clone https://github.com/sqeven/soft.git
    tar -xzf coreseek-4.1-beta.tar.gz
    AM_INIT_AUTOMAKE([-Wall foreign])
    yum -y install patch
    patch -p1 < /root/sphinx/soft/sphinxexpr.cpp-csft-4.1-beta.patch
    /root/sphinx/soft/coreseek-4.1-beta/csft-4.1/src/sphinxexpr.cpp
    sh buildconf.sh
    ./configure --prefix=/usr/local/coreseek --without-unixodbc --with-mmseg --with-mmseg-includes=/usr/local/mmseg3/include/mmseg/ --with-mmseg-libs=/usr/local/mmseg3/lib/ --with-mysql
    make && make install
    https://www.cnblogs.com/wangzhilei/p/6711035.html
    cd /usr/local/coreseek/etc
    /usr/local/coreseek/bin/indexer -c /usr/local/coreseek/etc/sphinx.conf --all
    /usr/local/coreseek/bin/indexer -c /usr/local/coreseek/etc/csft.conf --all --rotate
    /usr/local/coreseek/bin/searchd -c /usr/local/coreseek/etc/sphinx.conf
    /usr/local/coreseek/bin/searchd -c /usr/local/coreseek/etc/sphinx.conf --stop
    /usr/local/coreseek/bin/search -c /usr/local/coreseek/etc/sphinx.conf 戚培珍
    cp /usr/local/coreseek/bin/* /usr/bin/
    ##
    /usr/local/coreseek/bin/indexer -c /usr/local/coreseek/etc/csft.conf -rotate index_main
    /usr/local/coreseek/bin/indexer -c /usr/local/coreseek/etc/csft.conf -rotate index_add
    indexer --config /usr/local/coreseek/etc/csft.conf --merge index_main index_add --merge-dst-range deleted 0 0 -rotate
    /usr/local/coreseek/bin/indexer -c /usr/local/coreseek/etc/csft.conf --rotate --all
    ##
    wget http://git.php.net/?p=pecl/search_engine/sphinx.git;a=snapshot;h=339e123acb0ce7beb2d9d4f9094d6f8bcf15fb54;sf=tgz
    tar zxvf sphinx-339e123.tar.gz
    cd sphinx-339e123
    phpize
    ./configure
    $sphinx = new SphinxClient();
    $sphinx->SetServer("127.0.0.1",9312);
    $sphinx->SetMatchMode(SPH_MATCH_ALL);
    $sphinx->SetLimits(0, 20, 1000);
    $sphinx->SetArrayResult(true);
    $result = $sphinx -> query("one","test1");
    CREATE TABLE `sph_counter` (
    `counter_id` int(11) NOT NULL COMMENT '标识不同的数据表',
    `max_doc_id` int(11) NOT NULL COMMENT '每个索引表的最大ID,会实时更新',
    PRIMARY KEY (`counter_id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8
    source main_src
    {
    type = mysql
    sql_host = localhost
    sql_user = seven
    sql_pass = ********
    sql_db = test
    sql_port = 3306
    sql_sock = /tmp/mysql.sock
    sql_query_pre = SET NAMES utf8
    sql_query = \
    SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content \
    FROM documents
    sql_attr_uint = group_id
    sql_attr_timestamp = date_added
    sql_query_info = SELECT * FROM documents WHERE id=$id
    }
    index main
    {
    source = main_src
    path = /data/backup/dbs/data/test1
    docinfo = extern
    charset_type = zh_cn.utf-8
    mlock = 0
    morphology = none
    min_word_len = 1
    html_strip = 0
    charset_dictpath = /usr/local/mmseg3/etc/
    ngram_len = 0
    }
    indexer
    {
    mem_limit = 32M
    }
    searchd
    {
    port = 29312
    log = /usr/local/coreseek/var/log/searchd.log
    query_log = /usr/local/coreseek/var/log/query.log
    read_timeout = 5
    max_children = 30
    pid_file = /usr/local/coreseek/var/log/searchd.pid
    max_matches = 1000
    seamless_rotate = 1
    preopen_indexes = 0
    unlink_old = 1
    }

    2018-09-11 20:29:04 回复
  • git clone https://github.com/sqeven/soft.git
    tar -xzf coreseek-4.1-beta.tar.gz
    cd coreseek-4.1-beta/mmseg-3.2.14/
    ./bootstrap
    ./configure --prefix=/usr/local/mmseg3
    make && make install
    cd ../csft-4.1
    vim configure.ac
    AM_INIT_AUTOMAKE([-Wall foreign])
    yum -y install patch
    patch -p1 < /root/seven/soft/sphinxexpr.cpp-csft-4.1-beta.patch
    /root/seven/soft/coreseek-4.1-beta/csft-4.1/src/sphinxexpr.cpp
    sh buildconf.sh
    ./configure --prefix=/usr/local/coreseek --without-unixodbc --with-mmseg --with-mmseg-includes=/usr/local/mmseg3/include/mmseg/ --with-mmseg-libs=/usr/local/mmseg3/lib/ --with-mysql
    make && make install

    2018-09-12 21:32:09 回复
  • -----------------k8s 1.11.3 HA离线安装----------------------
    ## 1,修改主机名/ssh/绑定主机名 免密钥登录
    hostnamectl set-hostname #注意:主机名,不能用特殊符号(比如:jmsw-xx.hnser.com),可直接(node1)这种就可以。
    vim /etc/hosts #绑定主机名
    ##vim .ssh/authorized_keys #创建免密钥登录 “可不用”
    ## 2, 升级内核
    rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm ;yum --enablerepo=elrepo-kernel install kernel-lt-devel kernel-lt -y
    #查看默认启动顺序
    [commond:]# awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
    CentOS Linux (4.4.4-1.el7.elrepo.x86_64) 7 (Core)
    CentOS Linux (3.10.0-327.10.1.el7.x86_64) 7 (Core)
    CentOS Linux (0-rescue-c52097a1078c403da03b8eddeac5080b) 7 (Core)
    #默认启动的顺序是从0开始,新内核是从头插入(目前位置在0,而4.4.4的是在1),所以需要选择0。
    [commond:]# grub2-set-default 0
    #重启
    [commond:]# reboot
    #检查内核,成功升级到4.4
    [commond:]# uname -a
    Linux bigdata5 4.4.104-1.el7.elrepo.x86_64 #1 SMP Tue Dec 5 12:46:32 EST 2017 x86_64 x86_64 x86_64 GNU/Linux
    ## 3,虚拟机修改网卡名 ----如果是eth0 名就不需要修改(注意:可不用执行此步骤)
    ## 编辑/etc/default/grub文件内容,增加“net.ifnames=0 biosdevname=0”
    GRUB_CMDLINE_LINUX="crashkernel=auto net.ifnames=0 biosdevname=0 rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"
    grub2-mkconfig -o /boot/grub2/grub.cfg
    mv /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts/ifcfg-eth0
    sed -i "s/ens33/eth0/g" /etc/sysconfig/network-scripts/ifcfg-eth0
    cat /etc/sysconfig/network-scripts/ifcfg-eth0
    reboot
    ## 4,执行优化脚本/拷贝相关文件都执行服务器
    ### 把已经下载好的kube1.11.3.tar.gz 版本/脚本init.sh /配置文件keepalived.conf check_haproxy.sh ---》拷贝到服务器的相关目录下
    cd ~
    sh init.sh
    reboot
    curl https://quay.io
    cp keepalived.conf check_haproxy.sh /etc/keepalived ---》#覆盖自带的
    systemctl enable keepalived && systemctl start keepalived && systemctl status keepalived
    ## 5,安装 docker (所有server)
    ### https://docs.docker.com/install/linux/docker-ce/centos/#install-docker-ce-1 官网install
    # 安装 yum-config-manager
    yum install -y yum-utils device-mapper-persistent-data lvm2 yum-plugin-ovl
    # 导入
    yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    # 更新 repo
    yum makecache && yum list docker-ce.x86_64 --showduplicates |sort -r
    yum install -y docker-ce #18.03版本默认 文件系统为ovelay2驱动
    systemctl enable docker && systemctl start docker && systemctl status docker
    ## 6,拉取镜像/进入容器
    docker run --rm -v /data/kube1.11.3.tar.gz:/data/kube1.11.3.tar.gz -it -w /etc/ansible fanux/sealos:latest bash
    ## 7,在容器里---》创建免密钥登录/将密钥拷贝到各安装服务器上
    mkdir ~/.ssh
    cd ~/.ssh
    ssh-keygen -t rsa
    cat ~/.ssh/id_rsa.pub
    ## 8,在容器里---》修改的ansible/hosts文件/把IP、name、VIP换成自己服务器的/1.11.1改成1.11.3
    cd /etc/ansible/
    vi hosts
    ## 9,在容器里---》执行install 等待结果.....
    ansible-playbook roles/install-all.yaml
    ## 10,在容器里---》install 失败执行
    ansible-playbook roles/uninstall-all.yaml
    kubeadm reset
    rm -rf ~/.kube/ && rm -rf /etc/kubernetes/ && rm -rf /etc/systemd/system/kubelet.service.d && rm -rf /etc/systemd/system/kubelet.service && rm -rf /usr/bin/kube*
    rm -rf /etc/cni && rm -rf /opt/cni && rm -rf /var/lib/etcd && rm -rf /var/etcd
    ## 11,验证dashboard/监控平台
    https://server_ip:32000
    http://server_ip:32001
    ## 12,如果需要节点执行kubectl get 相关命令
    把 master 文件拷贝到各节点
    scp -r .kube 192.168.xxx:/root
    #注意:
    节点报错:file_linux.go:61] Unable to read config path "/etc/kubernetes/manifests": path does not exist, ignoring
    解决办法:mkdir -p /etc/kubernetes/manifests
    重启命令:
    swapoff -a&& setenforce 0&&systemctl start kubelet
    etcdctl cluster-healthy
    #coreDNS默认安装

    2018-09-20 11:43:24 回复
  • npm install -g commitizen conventional-changelog conventional-changelog-cli cz-customizable
    echo '{ "path": "cz-customizable" }' > ~/.czrc
    wget https://raw.githubusercontent.com/nielsgl/conventional-changelog-emoji/master/.cz-config.js -O ~/.cz-config.js

    2019-09-10 15:43:40 回复
  • goproxy.io
    goproxy.cn
    athens.azurefd.net
    mirrors.aliyun.com/goproxy/

    2019-09-23 10:51:49 回复
  • docker exec -it elk bash -c "rm -rf /opt/logstash/shop && rm -rf /var/tmp/shop*" && curl -XDELETE 'http://localhost:9200/shop'

    2019-09-24 11:22:26 回复
  • PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.7.4

    2019-09-29 14:04:47 回复
  • 02006323131
    AJFMUEDC

    2019-10-09 21:29:11 回复
  • http-snippet: |
    split_clients "$date_gmt" $mirror_servers {
    50% dev.icarephone.com;
    50% test.icarephone.com;
    }

    2019-10-09 22:10:32 回复
  • serveo -private_key_path=$HOME/.ssh/id_rsa -port=2222 -http_port=8080 -https_port=18443 -domain=skydaq.cn

    2019-10-12 15:25:43 回复
  • ssh -R sqeven:80:localhost:5000 skydaq.cn

    2019-10-12 15:47:28 回复
  • defaults write com.apple.systempreferences AttentionPrefBundleIDs 0

    2019-10-12 17:12:57 回复
  • 2019-11-13 16:55:39 回复
  • 2019-11-14 16:06:56 回复
  • 2019-12-10 10:11:00 回复
  • 当你的才华还撑不起你的野心的时候,你就应该静下心来学习。当你的能力还驾驭不了你的目标的时候,你就应该沉下心来历练。问问自己,想要怎样的人生。
    2019-12-10 14:12:53 回复
  • 2020-02-17 16:33:51 回复
  • 2020-04-02 17:39:15 回复
  • 2020-05-09 18:16:21 回复
  • 2020-05-14 10:38:37 回复
  • 2020-05-14 10:53:11 回复
  • 2020-06-10 17:01:51 回复
  • 2020-06-10 17:02:01 回复
  • alias proxy="export ALL_PROXY=socks5://127.0.0.1:7891"
    alias unproxy="unset ALL_PROXY"
    alias ip="curl ip.sb"
    2020-06-11 09:12:03 回复
  • 2020-06-29 10:27:40 回复
  • setopt no_nomatch
    2020-07-13 16:34:23 回复
  • yum install mysql-devel gcc gcc-devel python-devel postgresql-devel
    2020-07-13 17:18:15 回复
  • git commit --amend --no-edit --date="Wed Aug 28 13:14:00 2019 +0800"
    2020-07-18 10:01:17 回复
  • 2020-07-21 18:11:26 回复
  • 2020-09-18 16:28:56 回复
评论请先登录

最近热帖

  1. PPS代理节点池 69619
  2. PPS代理节点池② 26688
  3. 订阅池记录 8008
  4. 基于 Harbor 搭建 Docker 私有镜像仓库 6442
  5. V2ray免费账号 2355
  6. PPS代理节点池③ 2191
  7. 全栈开发笔记 1665
  8. 百度的无刷新搜索之PJAX 1572
  9. css之rem布局(rem.js) 1491
  10. docker swarm 集群高可用 1308

近期热议

  1. GITHUB项目 55
  2. PPS代理节点池 50
  3. WEB代理地址 43
  4. 全栈开发笔记 42
  5. ROBOT机器人之路 31
  6. C++回归之路 19
  7. OCR识别探索 16
  8. PPS代理节点池② 14
  9. DB到ES同步之路 11
  10. 接码平台地址 9