zabbix server

Read full article  | 评论关闭

./configure –sysconfdir=/opt/etc/zabbix/ –localstatedir=/opt/var/zabbix/ –enable-server –enable-agent –with-mysql=/usr/local/mysql/bin/mysql_config –prefix=/opt/apps/zabbix-4.4.7 –with-libcurl –with-openssl

Read More

mongo 用户权限管理

Read full article  | 评论关闭

添加用户,并赋予角色
db.createUser(
{
user: “username”,
pwd: “password”,
roles: [
{ role: "clusterMonitor", db: "admin" }
]
}
);

赋予用户更多角色
db.grantRolesToUser(
“usernme”,
[
{ role: "read", db:"admin"}
]
);

移除用户角色
db.revokeRolesFromUser(
“username”,
[
{ role: "read", db:"admin"}
]
);

Read More

Read full article  | 评论关闭

安装前需要的环境: yarn、 node 和 git,推荐配置cnpm

sudo npm install -g cnpm –registry=https://registry.npm.taobao.org

安装大概有三种方法(本地运行):
1、 git clone(稳定,速度偏慢)
直接在github下clone下来

git clone https://github.com/ant-design/ant-design-pro.git
cd ant-design-pro
npm install
npm start

2、ant-design-pro-cli(推荐)

npm install ant-design-pro-cli -g
mkdir pro-demo && cd pro-demo
pro new

3、官网的方法(强烈推荐,又快又稳)
①新建个文件夹,在文件夹里执行

yarn create umi

或者是

npm create umi

②选择 ant-design-pro:

Select the boilerplate type (Use arrow keys)
❯ ant-design-pro – Create project with an layout-only ant-design-pro boilerplate, use together with umi block.
app – Create project with a simple boilerplate, support typescript.
block – Create a umi block.
library – Create a library with umi.
plugin – Create a umi plugin.

③再选择typeScript

? Which language do you want to use? (Use arrow keys)
❯ TypeScript
JavaScript

④执行

npm install
npm start

无论以上哪种方法,都是需要通过打开浏览器访问 http://localhost:8000才能看到如下效果:

Read More

npm 查看修改源

Read full article  | 评论关闭

//查看源,可以看到设置过的所有的源
npm config get registry

//设置淘宝源
npm config set registry https://registry.npm.taobao.org

Read More

mongo 唯一 稀疏 索引

Read full article  | 评论关闭

db.test.ensureIndex({“test”:1},{unique = true, sparse = true})

Read More

更改npm镜像地址下载包步骤

Read full article  | 评论关闭

1.  查看当前计算机的下载地址

npm get registry

2.  修改为淘宝npm镜像

npm config set registry http://registry.npm.taobao.org/

3.  修改为cnpmjs镜像

npm config set registry http://r.cnpmjs.org/

4.  修改为原始地址

npm config set registry http://registry.npmjs.org/

Read More

Read full article  | 评论关闭

查看indices
curl ‘localhost:9200/_cat/indices?v’

删除indices
curl -XDELETE http://localhost:9200/acc-apply-*

Read More

docker container with supervisor

Read full article  | 评论关闭

supervisor
sudo nano /etc/supervisor/conf.d/nginx.conf

[program:nginx]
command=/usr/sbin/nginx -g “daemon off;”
autostart=true
autorestart=true
startretries=5
numprocs=1
startsecs=0
process_name=%(program_name)s_%(process_num)02d
stderr_logfile=/var/log/supervisor/%(program_name)s_stderr.log
stderr_logfile_maxbytes=10MB
stdout_logfile=/var/log/supervisor/%(program_name)s_stdout.log
stdout_logfile_maxbytes=10MB

create docker image with below CMD

CMD ["/usr/bin/supervisord", "-n"]

Read More

Read full article  | 评论关闭

create deployment:


apiVersion: apps/v1
kind: Deployment
metadata:
name: echo-deployment
spec:
replicas: 3
selector:
matchLabels:
app: echo-pod
template:
metadata:
labels:
app: echo-pod
spec:
containers:
- name: echoheaders
image: k8s.gcr.io/echoserver:1.10
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080

create service:

apiVersion: v1
kind: Service
metadata:
name: echo-service
annotations:
# Note that the backend talks over HTTP.
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
# TODO: Fill in with the ARN of your certificate.
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:usxxxxxxx
# Only run SSL on the port named "https" below.
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "https"
spec:
selector:
app: echo-pod
ports:
- name: http
port: 80
targetPort: 8080
- name: https
port: 443
targetPort: 8080
type: LoadBalancer

Read More

aws rds dump

Read full article  | 评论关闭

 

log_bin_trust_function_creators   = 1

 

mysqldump with –set-gtid-purged=OFF

Read More