‘pplife’ Posts

 

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

mysql explain type 优先级

Read full article  | 评论关闭

 

 

system/const/eq_ref/ref/range/index/ALL

Read More

ubuntu nodejs 8

Read full article  | 评论关闭

 

 

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

sudo apt-get install -y nodejs

 

 

npm install pm2 -g

Read More

mongo explain

Read full article  | 评论关闭

 

db.test.explain("executionStats").find({"user":"1332200000"})

Read More

mongo add index

Read full article  | 评论关闭

 

db.user.ensureIndex({“name”:1,”age”:1})

 

db.COLLECTION_NAME.getIndexes()

db.sites.dropIndex("name_1_domain_-1")

Read More

mongo count distinct

Read full article  | 评论关闭

 

 

db.collection_name.distinct(‘types2′)

Read More

delete old data from elasticsearch

Read full article  | 评论关闭

 

get indices info

curl 'localhost:9200/_cat/indices?v'

delete old data:
curl -v -X DELETE http://localhost:9200/logstash-$day*

Read More

mongo collection name have -

Read full article  | 评论关闭

 

 

db['construction-places'].count()
42

Read More