tellxp的博客

  • 首页

  • 归档

部署MySQL InnoDB Cluster

发表于 2019-02-28 | 更新于 2019-04-03 | 分类于 mysql , ha

准备安装环境

  1. 准备3台Windows Server, 设置hostname分别为

    • ic-node-01: 主节点
    • ic-node-02: 从节点
    • ic-node-03: 从节点
    • mysql-em-01: 监控节点
  2. 配置IP和并分发hosts文件


阅读全文 »

在Kubernetes中部署MongoDB Shard Cluster

发表于 2019-02-21 | 更新于 2019-04-03 | 分类于 kubernetes , mongodb

1. 安装MongoDB Enterprise Kubernetes Operator

  1. 拉取官方的模板

    1
    git clone https://github.com/mongodb/mongodb-enterprise-kubernetes.git
  2. 使用helm生成yaml文件并执行

    1
    2
    helm template public/helm_chart > operator.yaml
    kubectl apply -f operator.yaml
  3. 生成于mongodb ops manager连接需要的配置并应用

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    ---
    apiVersion: v1
    kind: ConfigMap
    metadata:
    name: ops-kubernetes-conf
    namespace: mongodb
    data:
    projectName: kubernetes
    orgId: 5c6a76e9c6079d3b30de9099
    baseUrl: http://mongodb-ops.dizall.com
  4. 生成连接需要的凭证

    • 需要首先在Ops Manager上生成Public API Key
      1
      2
      3
      4
      5
      kubectl -n mongodb  delete secret ops-cred

      kubectl -n mongodb create secret generic ops-cred \
      --from-literal="user=mongodb-ops@dizall.com" \
      --from-literal="publicApiKey=05fdfb7a-5430-4f90-a66b-b55b202d5cf4"

阅读全文 »

CAT62的全数据译码

发表于 2018-10-31 | 更新于 2019-04-03 | 分类于 cat , eurocontrol

CAT

1
(byte)0b00111110, //0
  • CAT = 00111110 = 62

LEN

1
2
(byte)0b00000001  //1
(byte)0b10101001 //2
  • LEN = 00000001 10101001 = 425

阅读全文 »

关于飞行对象(Flight Object)模型

发表于 2018-10-26 | 更新于 2019-04-03 | 分类于 飞行数据处理

常用语句片段

发表于 2018-09-30 | 更新于 2018-12-20 | 分类于 scratch

镜像配置

python

1
2
3
4
5
6
7
8
9
10
11
12
13
配置方法

在文件

~/.pip/pip.conf

中添加或修改:

[global]
index-url = https://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com

tensorflow

SET PATH=C:\Develop\cuda\bin;%PATH%
SET PATH=C:\Develop\cuda\extras\CUPTI\libx64;%PATH%
SET PATH=C:\Develop\cuDNN\bin;%PATH%

npm

  • 1.通过config命令

    1
    2
    npm config set registry https://registry.npm.taobao.org 
    npm info underscore (如果上面配置正确这个命令会有字符串response)
  • 2.命令行指定

    1
    npm --registry https://registry.npm.taobao.org info underscore
  • 3.编辑 ~/.npmrc 加入下面内容
    registry = https://registry.npm.taobao.org

  • 切换回原来的源
    如果你要在npm 发布组件,要记得切换回原来的源,不然用户登录报错
    npm config set registry https://registry.npmjs.org/

node-sass 安装失败的原因
npm 安装 node-sass 依赖时,会从 github.com 上下载 .node 文件。由于国内网络环境的问题,这个下载时间可能会很长,甚至导致超时失败。
这是使用 sass 的同学可能都会遇到的郁闷的问题。
解决方案就是使用其他源,或者使用工具下载,然后将安装源指定到本地。
解决方法一:使用淘宝镜像源
设置变量 sass_binary_site,指向淘宝镜像地址。示例:
npm i node-sass –sass_binary_site=https://npm.taobao.org/mirrors/node-sass/

// 也可以设置系统环境变量的方式。示例
// linux、mac 下
SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ npm install node-sass

// window 下
set SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ && npm install node-sass

或者设置全局镜像源:
1 npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/
之后再涉及到 node-sass 的安装时就会从淘宝镜像下载。
解决方法二:使用 cnpm
另外,使用 cnpm 安装 node-sass 会默认从淘宝镜像源下载,也是一个办法:
1 cnpm install node-sass
解决方法三:下载 .node 到本地
到这里去根据版本号、系统环境,选择下载 .node 文件:
https://github.com/sass/node-sass/releases
然后安装时,指定变量 sass_binary_path,如:
1 npm i node-sass –sass_binary_path=/Users/lzwme/Downloads/darwin-x64-48_binding.node
安装失败后重新安装问题
最后,有同学问,之前安装失败,再安装就不去下载了,怎么办呢?那就先卸载再安装:
1 npm uninstall node-sass && npm i node-sass –sass_binary_site=https://npm.taobao.org/mirrors/node-sass/

gradle

原创 2017年09月22日 14:27:35
• 标签:
• gradle

  • 修改gradle初始化脚本

gradle 生命周期中有一个叫 初始化( Initialization )的过程,这个过程运行在 build script 之前,我们可以在这个地方做一点系统全局的设置,就比如配置仓库地址
你可以在这些地方使用你的初始化脚本:
1、命令行 (这个我就不说了
2、放一个init.gradle 文件到USER_HOME/.gradle/目录下
3、放一个后缀是.gradle的文件到 USER_HOME/.gradle/init.d/ 目录下
4、放一个后缀是.gradle的文件到 GRADLE_HOME/init.d/ 目录下.

本人使用的是第4种方法, 和gradle-4.1
init.gradle文件内容:
[html] view plain copy

1. allprojects {  
2.     repositories {  
3.          maven {  
4.              name "aliyunmaven"  
5.              url "http://maven.aliyun.com/nexus/content/groups/public/"  
6.          }  
7.     }  
8. }  

CentOS

CentOS是Redhat的克隆版本,CentOS团队已经被Reahat收购。
默认Redhat使用自身的收费yum源,一般使用更改为国内镜像CentOS的源。

默认Redhat7.1不带三方源

1. 获取repo列表
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
2. 将CentOS-7.repo内的$releasever替换为7;
3. yum make clean && yum make cache&&yum update

MSSQL Server防火墙配置

需要允许这些端口80, 135, 443, 445, 1433, 1434, 1688, 2383, 3389, 5022,5985

安装.NET Framework 3.5

Dism /online /enable-feature /featurename:NetFX3 /All /Source:E:\sources\sxs /LimitAccess

时钟源配置

  • Windows Time Service Tools and Settings
    • https://docs.microsoft.com/en-us/windows-server/networking/windows-time-service/windows-time-service-tools-and-settings

Visual Studio 重置

方法:
1.开始->Microsoft Visual Studio 2013->Visual Studio Tools->VS2013 x64 兼容工具命令提示
2.cd C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE 然后输入:devenv.exe /setup /resetuserdata /resetsettings
重启vs2012 就可以了。

chrome在windows10下乱码问题

需要在windows10的可选功能中添加繁体中文字符集;

常用网站

  • Intellij破解 http://idea.lanyus.com

相关的操作

蓝灯VPN相关

1
lantern.exe --addr 10.100.1.141:11111

Kubernetes相关

  • 安装
  • Ceph安装和集成
  • mongodb分片安装和集成
    1
    2
    3
    4
    5
    # 删除一个Label,只需在命令行最后指定Label的key名并与一个减号相连即可:
    $ kubectl label nodes 1.1.1.1 role-

    # 修改一个Label的值,需要加上--overwrite参数:
    $ kubectl label nodes 1.1.1.1 role=apache --overwrite
阅读全文 »

在Kubernetes中使用helm

发表于 2018-09-30 | 更新于 2019-04-03 | 分类于 kubernetes

1. 下载helm

  1. 在Helm Release上下载Linux amd64版本的helm包

  2. 解压并移动到bin目录

    1
    2
    tar -zxvf helm-v2.0.0-linux-amd64.tgz
    mv linux-amd64/helm /usr/local/bin/helm

2. 拉取tiller镜像

1
2
3
docker pull tellxp/tiller:v2.11.0
docker tag tellxp/tiller:v2.11.0 gcr.io/kubernetes-helm/tiller:v2.11.0
docker rmi tellxp/tiller:v2.11.0

3. 创建tiller服务账户

1
2
3
4
5
6
kubectl create serviceaccount --namespace kube-system tiller

# 将服务账户绑定到cluster-admin
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller

kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'

4. 初始化

1
2
3
4
5
helm init --upgrade --stable-repo-url (repo-url)
#可选的国内repo
#https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts 已过期
#https://aliacs-app-catalog.oss-cn-hangzhou.aliyuncs.com/charts/ charts较少
#https://aliacs-app-catalog.oss-cn-hangzhou.aliyuncs.com/charts-incubator/ charts较少

5. 使用

1
helm install .....

6. 其他一些有用的命令

1
2
# 仅客户端运行
helm init --client-only --stable-repo-url

安装Ceph并与Kubernetes集成

发表于 2018-09-30 | 更新于 2019-04-03 | 分类于 ceph

1. 系统环境配置

1.1 前提条件

- 有至少4台Linux操作系统作为Ceph的部署环境,这里是Ubuntu 18.04

1.2 配置主机名

  1. 4台Ceph主机在一个子网,分别为ceph-master-01, ceph-node-01, ceph-node-02, ceph-node-03

  2. 为每个主机配置hosts文件,加入主机名的IP地址

    1
    2
    3
    4
    5
    # /etc/hosts
    ceph-master-01 10.100.1.51
    ceph-node-01 10.100.1.52
    ceph-node-02 10.100.1.53
    ceph-node-03 10.100.1.54
阅读全文 »

安装Kubernetes 1.11.3

发表于 2018-09-23 | 更新于 2019-04-03 | 分类于 docker , kubernetes

0. 前置条件

  1. 操作系统:ubuntu 18.04
  2. 网络连接

1. 基础环境和配置

1.1 配置操作系统环境

该操作针对所有的节点

  1. 启用root用户和root用户的ssh远程访问

    1
    2
    3
    4
    sudo passwd root
    su root
    vi /etc/ssh/sshd_config
    # 设置 PermitRootLogin yes

重新使用root连接(根据各自需要,root要方便很多)

阅读全文 »

一次CAT62的译码过程

发表于 2018-08-29 | 更新于 2019-04-18 | 分类于 cat , eurocontrol

1. CAT

0 = 0b00111110

V=62,十进制


2. LEN

1 = 0b00000000
2 = 0b01011010

V=90,十进制


阅读全文 »

当inline-block遇上overflow

发表于 2017-06-05 | 更新于 2019-04-03 | 分类于 前端开发

1. inline-block的现象

在使用inline-block的时候,会发现有的时候inline-block元素会出现不能对齐的现象。

比如当使用如下结构的html时:

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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>block</title>
<style>
.container {
display: block;
position: relative;
top:32px;
left:32px;
width: 600px;
height: 600px;
background-color: transparent;
padding: 0;
line-height: 2;

/*text-size-adjust: 100%;*/
}
.item {
padding: 1rem;
display: inline-block;
position: relative;
font-family: "Microsoft YaHei UI", "Helvetica Neue", sans-serif;
font-size: 16px;
line-height: 1;
overflow: hidden;
background-color: blue;
}
.item2 {
padding: 1rem;
display: inline-block;
position: relative;
font-family: "Microsoft YaHei UI", "Helvetica Neue", sans-serif;
font-size: 16px;
line-height: 1;
background-color: blue;
}
</style>
</head>
<body>
<div class="container" tabindex="-1">
<div class="item">111111</div>
<div class="item">111111</div>
<div class="item2">111111</div>
<div class="item2">111111</div>
</div>
<script>
</script>
</body>
</html>
阅读全文 »
12

tellxp

13 日志
13 分类
13 标签
© 2019 tellxp
由 Hexo 强力驱动 v3.8.0
|
主题 – NexT.Muse v7.0.0