Commit 2308b077 authored by 胡凯旋's avatar 胡凯旋

init

parents
Mac下搭建本地k8s,并进行开发、调试和部署
## 安装Docker/k8s
1. 安装 [Docker for Mac](https://docs.docker.com/docker-for-mac/install/),Version>=18.06,低版本可能不自带Kubernetes
2. 设置 `Docker` 中国官方镜像加速 [registry mirror](https://www.docker-cn.com/registry-mirror) ```https://registry.docker-cn.com```
![mirror](./image/mirror.jpg)
3. 预先从阿里云`Docker`镜像下载 `Kubernetes` 所需要的镜像, 可以通过修改 [./images](./images) 文件定制你自己需要的镜像
```bash
$ ./load_images.sh
```
4.`Docker for Mac` 设置中启用 `Kubernetes` 选项, 并等待一会儿,直到 `Kubernetes` 开始运行。
![k8s](./image/k8s.jpg)
5. 可选的步骤: 切换`Kubernetes`运行上下文至 `docker-for-desktop`
```bash
# 一般只有在之前用其他方式运行过Kubernetes才需要
$ kubectl config use-context docker-for-desktop
```
6. 验证 `Kubernetes` 集群状态
```bash
$ kubectl cluster-info
$ kubectl get nodes
```
7. 部署 `Kubernetes dashboard`
```bash
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
# 开启本机访问代理
$ kubectl proxy
```
通过下面的连接访问 `Dashboard`:
[`http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/`](
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/)
获取 `Dashboard` `admin` 权限:
[`https://github.com/kubernetes/dashboard/wiki/Access-control#admin-privileges`](https://github.com/kubernetes/dashboard/wiki/Access-control#admin-privileges)
## 服务初次部署
1. docker login harbor.test.gengmei
```
docker login harbor.test.gengmei
username: gmuser
password: Gengmei123!
```
2. 创建项目目录,日志目录到指定位置
```
sudo mkdir -p /data/log/backend/app /data/log/gaia/app /data/log/mimas/app /data/log/doris/app # ...
sudo mkdir -p /srv/apps
cd /srv/apps
git clone git@git.wanmeizhensuo.com:backend/backend.git
git clone git@git.wanmeizhensuo.com:backend/gaia.git
git clone git@git.wanmeizhensuo.com:backend/Mimas.git
git clone git@git.wanmeizhensuo.com:rank/doris.git
```
3. 每个项目checkout到paas分支,build镜像
```
cd 项目目录
git checkout paas
docker build --no-cache -t 项目名:latest .
```
4. 复制 settings_local 到项目目录下
```
cp ./settings_local/backend/settings_local.py /srv/apps/backend/gengmei
cp ./settings_local/gaia/settings_local.py /srv/apps/gaia/gaia
cp ./settings_local/mimas/settings_local.py /srv/apps/mimas/settings/settings_local.py
cp ./settings_local/doris/devel.py /srv/apps/doris/doris/devel.py
```
5. docker-for-mac上添加File Sharing配置 /srv/apps、/data/log,添加后点击Apply & Restart,若报错,可不必添加。
6. 备份之前的路由表,用当前目录下的路由表替换之前的路由表
```
mv /etc/gm-config/storage/static.dir/helios.dir/static_route_table.json /etc/gm-config/storage/static.dir/helios.dir/static_route_table.json.old
cp ./static_route_table.json /etc/gm-config/storage/static.dir/helios.dir/static_route_table.json
```
7. 设置configmap
```
kubectl create configmap static-route-table --from-file=/etc/gm-config/storage/static.dir/helios.dir/static_route_table.json
kubectl create configmap backend-settings --from-file=/srv/apps/backend/gengmei/settings_local.py
kubectl create configmap gaia-settings --from-file=/srv/apps/gaia/gaia/settings_local.py
kubectl create configmap mimas-settings --from-file=/srv/apps/mimas/settings/settings_local.py
kubectl create configmap doris-settings --from-file=/srv/apps/doris/doris/devel.py
```
8. 部署Pod和Service
```
# Pod
kubectl create -f deploy/backend-deploy.yml
kubectl create -f deploy/gaia-deploy.yml
kubectl create -f deploy/mimas-deploy.yml
kubectl create -f deploy/doris-deploy.yml
# Service
kubectl create -f service/backend-service.yml
kubectl create -f service/gaia-service.yml
kubectl create -f service/mimas-service.yml
kubectl create -f service/doris-service.yml
```
9. 测试服务是否正常启动
## 服务调试
1. 更改代码
2. 更新服务
```
kubectl replace --force -f deploy/backend-service.yml # ...
```
3. 测试
apiVersion: apps/v1
kind: Deployment
metadata:
name: apollo-deploy-test
labels:
app: apollo
spec:
replicas: 1
selector:
matchLabels:
app: apollo
template:
metadata:
labels:
app: apollo
spec:
containers:
- name: apollo
image: harbor.test.gengmei/backend/apollo:v1.0
ports:
- containerPort: 8000
volumeMounts:
- name: static-route-table
mountPath: /etc/gm-config/storage/static.dir/helios.dir/
- name: resource-json
mountPath: /etc/gm-config/storage/static.dir/dev_env.dir/
- name: gm-logging-dir
mountPath: /etc/gm-config/storage/static.dir/gm_logging.dir/
- name: apollo-settings
mountPath: /srv/apps/apollo/apollo/settings_local.py
subPath: settings_local.py
- name: data-dir
mountPath: /data/log/apollo/app
volumes:
- name: static-route-table
configMap:
name: static-route-table
- name: resource-json
configMap:
name: resource-json
- name: gm-logging-dir
configMap:
name: gm-logging-dir
items:
- key: global_important_sentry.json
path: global_important_sentry.json
- key: kafka.json
path: kafka.json
- name: apollo-settings
configMap:
name: apollo-settings
items:
- key: settings_local.py
path: settings_local.py
# hostPath挂载
- name: data-dir
hostPath:
path: /data/log/apollo/app
# 私有仓库镜像下载认证
imagePullSecrets:
- name: harbor-secret
apiVersion: apps/v1
kind: Deployment
metadata:
name: artemis-deploy-test
labels:
app: artemis
spec:
replicas: 1
selector:
matchLabels:
app: artemis
template:
metadata:
labels:
app: artemis
spec:
containers:
- name: artemis
image: harbor.test.gengmei/backend/artemis:v1.0
ports:
- containerPort: 8000
volumeMounts:
- name: static-route-table
mountPath: /etc/gm-config/storage/static.dir/helios.dir/
- name: resource-json
mountPath: /etc/gm-config/storage/static.dir/dev_env.dir/
- name: gm-logging-dir
mountPath: /etc/gm-config/storage/static.dir/gm_logging.dir/
- name: artemis-settings
mountPath: /srv/apps/artemis/artemis/settings_local.py
subPath: settings_local.py
volumes:
- name: static-route-table
configMap:
name: static-route-table
- name: resource-json
configMap:
name: resource-json
- name: gm-logging-dir
configMap:
name: gm-logging-dir
items:
- key: global_important_sentry.json
path: global_important_sentry.json
- key: kafka.json
path: kafka.json
- name: artemis-settings
configMap:
name: artemis-settings
items:
- key: settings_local.py
path: settings_local.py
# 私有仓库镜像下载认证
imagePullSecrets:
- name: harbor-secret
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend-deploy-test
labels:
app: backend
spec:
replicas: 1
selector:
matchLabels:
app: backend
template:
metadata:
labels:
app: backend
spec:
containers:
- name: backend
image: backend:local.latest
ports:
- containerPort: 8000
volumeMounts:
- name: static-route-table
mountPath: /etc/gm-config/storage/static.dir/helios.dir/
- name: backend-settings
mountPath: /srv/apps/backend/gengmei/settings_local.py
subPath: settings_local.py
- name: data-dir
mountPath: /data/log/backend/app
- name: work-dir
mountPath: /srv/apps/backend
volumes:
- name: static-route-table
configMap:
name: static-route-table
- name: backend-settings
configMap:
name: backend-settings
items:
- key: settings_local.py
path: settings_local.py
# hostPath挂载
- name: data-dir
hostPath:
path: /data/log/backend/app
- name: work-dir
hostPath:
path: /srv/apps/backend
# 私有仓库镜像下载认证
imagePullSecrets:
- name: harbor-secret
apiVersion: apps/v1
kind: Deployment
metadata:
name: doris-deploy-test
labels:
app: doris
spec:
replicas: 1
selector:
matchLabels:
app: doris
template:
metadata:
labels:
app: doris
spec:
containers:
- name: doris
image: doris:local.latest
ports:
- containerPort: 8000
volumeMounts:
- name: static-route-table
mountPath: /etc/gm-config/storage/static.dir/helios.dir/
# - name: resource-json
# mountPath: /etc/gm-config/storage/static.dir/dev_env.dir/
# - name: gm-logging-dir
# mountPath: /etc/gm-config/storage/static.dir/gm_logging.dir/
- name: doris-settings
mountPath: /srv/apps/doris/doris/devel.py
subPath: devel.py
# - name: doris-settings
# mountPath: /srv/apps/doris/doris/base.py
# subPath: base.py
- name: data-dir
mountPath: /data/log/doris/app
- name: work-dir
mountPath: /srv/apps/doris
volumes:
- name: static-route-table
configMap:
name: static-route-table
# - name: resource-json
# configMap:
# name: resource-json
# - name: gm-logging-dir
# configMap:
# name: gm-logging-dir
# items:
# - key: global_important_sentry.json
# path: global_important_sentry.json
# - key: kafka.json
# path: kafka.json
- name: doris-settings
configMap:
name: doris-settings
items:
- key: devel.py
path: devel.py
# - key: base.py
# path: base.py
# hostPath挂载
- name: data-dir
hostPath:
path: /data/log/doris/app
- name: work-dir
hostPath:
path: /srv/apps/doris
# 私有仓库镜像下载认证
imagePullSecrets:
- name: harbor-secret
apiVersion: apps/v1
kind: Deployment
metadata:
name: gaia-deploy-test
labels:
app: gaia
spec:
replicas: 1
selector:
matchLabels:
app: gaia
template:
metadata:
labels:
app: gaia
spec:
containers:
- name: gaia
image: gaia:local.latest
ports:
- containerPort: 8000
volumeMounts:
- name: static-route-table
mountPath: /etc/gm-config/storage/static.dir/helios.dir/
# - name: resource-json
# mountPath: /etc/gm-config/storage/static.dir/dev_env.dir/
# - name: gm-logging-dir
# mountPath: /etc/gm-config/storage/static.dir/gm_logging.dir/
- name: gaia-settings
mountPath: /srv/apps/gaia/gaia/settings_local.py
subPath: settings_local.py
- name: data-dir
mountPath: /data/log/gaia/app
- name: work-dir
mountPath: /srv/apps/gaia
volumes:
- name: static-route-table
configMap:
name: static-route-table
# - name: resource-json
# configMap:
# name: resource-json
# - name: gm-logging-dir
# configMap:
# name: gm-logging-dir
# items:
# - key: global_important_sentry.json
# path: global_important_sentry.json
# - key: kafka.json
# path: kafka.json
- name: gaia-settings
configMap:
name: gaia-settings
items:
- key: settings_local.py
path: settings_local.py
- name: data-dir
hostPath:
path: /data/log/gaia/app
- name: work-dir
hostPath:
path: /srv/apps/gaia
# 私有仓库镜像下载认证
imagePullSecrets:
- name: harbor-secret
apiVersion: apps/v1
kind: Deployment
metadata:
name: gm-face-deploy-test
labels:
app: gm-face
spec:
replicas: 1
selector:
matchLabels:
app: gm-face
template:
metadata:
labels:
app: gm-face
spec:
containers:
- name: gm-face
image: harbor.test.gengmei/backend/gm-face:v1.0
ports:
- containerPort: 8000
volumeMounts:
- name: static-route-table
mountPath: /etc/gm-config/storage/static.dir/helios.dir/
- name: resource-json
mountPath: /etc/gm-config/storage/static.dir/dev_env.dir/
- name: gm-logging-dir
mountPath: /etc/gm-config/storage/static.dir/gm_logging.dir/
- name: gm-face-settings
mountPath: /srv/apps/gm-face/gm-face/settings_local.py
subPath: settings_local.py
- name: data-dir
mountPath: /data/log/gm-face/app
volumes:
- name: static-route-table
configMap:
name: static-route-table
- name: resource-json
configMap:
name: resource-json
- name: gm-logging-dir
configMap:
name: gm-logging-dir
items:
- key: global_important_sentry.json
path: global_important_sentry.json
- key: kafka.json
path: kafka.json
- name: gm-face-settings
configMap:
name: gm-face-settings
items:
- key: settings_local.py
path: settings_local.py
- name: data-dir
hostPath:
path: /data/log/gm-face/app
# 私有仓库镜像下载认证
imagePullSecrets:
- name: harbor-secret
apiVersion: apps/v1
kind: Deployment
metadata:
name: mimas-deploy-test
labels:
app: mimas
spec:
replicas: 1
selector:
matchLabels:
app: mimas
template:
metadata:
labels:
app: mimas
spec:
containers:
- name: mimas
image: mimas:local.latest
ports:
- containerPort: 8000
volumeMounts:
- name: static-route-table
mountPath: /etc/gm-config/storage/static.dir/helios.dir/
# - name: resource-json
# mountPath: /etc/gm-config/storage/static.dir/dev_env.dir/
# - name: gm-logging-dir
# mountPath: /etc/gm-config/storage/static.dir/gm_logging.dir/
# - name: mimas-settings
# mountPath: /srv/apps/mimas/settings/base.py
# subPath: base.py
- name: mimas-settings
mountPath: /srv/apps/mimas/settings/settings_local.py
subPath: settings_local.py
- name: data-dir
mountPath: /data/log/mimas/app
- name: work-dir
mountPath: /srv/apps/mimas
volumes:
- name: static-route-table
configMap:
name: static-route-table
# - name: resource-json
# configMap:
# name: resource-json
# - name: gm-logging-dir
# configMap:
# name: gm-logging-dir
# items:
# - key: global_important_sentry.json
# path: global_important_sentry.json
# - key: kafka.json
# path: kafka.json
- name: mimas-settings
configMap:
name: mimas-settings
items:
# - key: base.py
# path: base.py
- key: settings_local.py
path: settings_local.py
- name: data-dir
hostPath:
path: /data/log/mimas/app
- name: work-dir
hostPath:
path: /srv/apps/mimas
# 私有仓库镜像下载认证
imagePullSecrets:
- name: harbor-secret
apiVersion: apps/v1
kind: Deployment
metadata:
name: passport-deploy-test
labels:
app: passport
spec:
replicas: 1
selector:
matchLabels:
app: passport
template:
metadata:
labels:
app: passport
spec:
containers:
- name: passport
image: harbor.test.gengmei/backend/passport:v1.0
ports:
- containerPort: 8000
volumeMounts:
- name: static-route-table
mountPath: /etc/gm-config/storage/static.dir/helios.dir/
- name: resource-json
mountPath: /etc/gm-config/storage/static.dir/dev_env.dir/
- name: gm-logging-dir
mountPath: /etc/gm-config/storage/static.dir/gm_logging.dir/
- name: passport-settings
mountPath: /srv/apps/passport/passport/settings_gaia_local.py
subPath: settings_gaia_local.py
- name: passport-settings
mountPath: /srv/apps/passport/passport/settings_redis.py
subPath: settings_redis.py
- name: data-dir
mountPath: /data/log/passport/app
volumes:
- name: static-route-table
configMap:
name: static-route-table
- name: resource-json
configMap:
name: resource-json
- name: gm-logging-dir
configMap:
name: gm-logging-dir
items:
- key: global_important_sentry.json
path: global_important_sentry.json
- key: kafka.json
path: kafka.json
- name: passport-settings
configMap:
name: passport-settings
items:
- key: settings_gaia_local.py
path: settings_gaia_local.py
- key: settings_redis.py
path: settings_redis.py
- name: data-dir
hostPath:
path: /data/log/passport/app
# 私有仓库镜像下载认证
imagePullSecrets:
- name: harbor-secret
apiVersion: apps/v1
kind: Deployment
metadata:
name: plutus-deploy-test
labels:
app: plutus
spec:
replicas: 1
selector:
matchLabels:
app: plutus
template:
metadata:
labels:
app: plutus
spec:
containers:
- name: plutus
image: harbor.test.gengmei/backend/plutus:v1.0
ports:
- containerPort: 8000
volumeMounts:
- name: static-route-table
mountPath: /etc/gm-config/storage/static.dir/helios.dir/
- name: resource-json
mountPath: /etc/gm-config/storage/static.dir/dev_env.dir/
- name: gm-logging-dir
mountPath: /etc/gm-config/storage/static.dir/gm_logging.dir/
- name: plutus-settings
mountPath: /srv/apps/plutus/plutus/settings_local.py
subPath: settings_local.py
- name: data-dir
mountPath: /data/log/plutus/app
# plutus secret config
- name: plutus-secret
mountPath: /srv/secret/msxf_gm.private
subPath: msxf_gm.private
- name: plutus-secret
mountPath: /srv/secret/msxf_key.public
subPath: msxf_key.public
- name: plutus-secret
mountPath: /srv/secret/zhongan_private.pem
subPath: zhongan_private.pem
- name: plutus-secret
mountPath: /srv/secret/zhongan_public.pem
subPath: zhongan_public.pem
volumes:
- name: static-route-table
configMap:
name: static-route-table
- name: resource-json
configMap:
name: resource-json
- name: gm-logging-dir
configMap:
name: gm-logging-dir
items:
- key: global_important_sentry.json
path: global_important_sentry.json
- key: kafka.json
path: kafka.json
- name: plutus-settings
configMap:
name: plutus-settings
items:
- key: settings_local.py
path: settings_local.py
- name: data-dir
hostPath:
path: /data/log/plutus/app
- name: plutus-secret
configMap:
name: plutus-secret
items:
- key: msxf_gm.private
path: msxf_gm.private
- key: msxf_key.public
path: msxf_key.public
- key: zhongan_private.pem
path: zhongan_private.pem
- key: zhongan_public.pem
path: zhongan_public.pem
# 私有仓库镜像下载认证
imagePullSecrets:
- name: harbor-secret
apiVersion: apps/v1
kind: Deployment
metadata:
name: push2-deploy-test
labels:
app: push2
spec:
replicas: 1
selector:
matchLabels:
app: push2
template:
metadata:
labels:
app: push2
spec:
containers:
- name: push2
image: harbor.test.gengmei/backend/push2:v1.0
ports:
- containerPort: 8000
volumeMounts:
- name: static-route-table
mountPath: /etc/gm-config/storage/static.dir/helios.dir/
- name: resource-json
mountPath: /etc/gm-config/storage/static.dir/dev_env.dir/
- name: gm-logging-dir
mountPath: /etc/gm-config/storage/static.dir/gm_logging.dir/
- name: push2-settings
mountPath: /srv/apps/push2/conf/settings_local.py
subPath: settings_local.py
- name: push2-settings
mountPath: /srv/apps/push2/conf/settings_jpush.py
subPath: settings_jpush.py
- name: push2-settings
mountPath: /srv/apps/push2/conf/settings_db.py
subPath: settings_db.py
- name: data-dir
mountPath: /data/log/push2/app
volumes:
- name: static-route-table
configMap:
name: static-route-table
- name: resource-json
configMap:
name: resource-json
- name: gm-logging-dir
configMap:
name: gm-logging-dir
items:
- key: global_important_sentry.json
path: global_important_sentry.json
- key: kafka.json
path: kafka.json
- name: push2-settings
configMap:
name: push2-settings
items:
- key: settings_local.py
path: settings_local.py
- key: settings_jpush.py
path: settings_jpush.py
- key: settings_db.py
path: settings_db.py
- name: data-dir
hostPath:
path: /data/log/push2/app
# 私有仓库镜像下载认证
imagePullSecrets:
- name: harbor-secret
apiVersion: apps/v1
kind: Deployment
metadata:
name: ship-deploy-test
labels:
app: ship
spec:
replicas: 1
selector:
matchLabels:
app: ship
template:
metadata:
labels:
app: ship
spec:
containers:
- name: ship
image: harbor.test.gengmei/backend/ship:v1.0
ports:
- containerPort: 8000
volumeMounts:
- name: static-route-table
mountPath: /etc/gm-config/storage/static.dir/helios.dir/
- name: resource-json
mountPath: /etc/gm-config/storage/static.dir/dev_env.dir/
- name: gm-logging-dir
mountPath: /etc/gm-config/storage/static.dir/gm_logging.dir/
- name: ship-settings
mountPath: /srv/apps/ship/ship/settings_local.py
subPath: settings_local.py
- name: ship-settings
mountPath: /srv/apps/ship/ship/settings_base.py
subPath: settings_base.py
- name: data-dir
mountPath: /data/log/ship/app
volumes:
- name: static-route-table
configMap:
name: static-route-table
- name: resource-json
configMap:
name: resource-json
- name: gm-logging-dir
configMap:
name: gm-logging-dir
items:
- key: global_important_sentry.json
path: global_important_sentry.json
- key: kafka.json
path: kafka.json
- name: ship-settings
configMap:
name: ship-settings
items:
- key: settings_local.py
path: settings_local.py
- key: settings_base.py
path: settings_base.py
# hostPath挂载
- name: data-dir
hostPath:
path: /data/log/ship/app
# 私有仓库镜像下载认证
imagePullSecrets:
- name: harbor-secret
apiVersion: apps/v1
kind: Deployment
metadata:
name: uc-sms-deploy-test
labels:
app: uc-sms
spec:
replicas: 1
selector:
matchLabels:
app: uc-sms
template:
metadata:
labels:
app: uc-sms
spec:
containers:
- name: uc-sms
image: harbor.test.gengmei/backend/uc-sms:v1.0
ports:
- containerPort: 8000
volumeMounts:
- name: static-route-table
mountPath: /etc/gm-config/storage/static.dir/helios.dir/
- name: resource-json
mountPath: /etc/gm-config/storage/static.dir/dev_env.dir/
- name: gm-logging-dir
mountPath: /etc/gm-config/storage/static.dir/gm_logging.dir/
- name: data-dir
mountPath: /data/log/uc_sms/app
volumes:
- name: static-route-table
configMap:
name: static-route-table
- name: resource-json
configMap:
name: resource-json
- name: gm-logging-dir
configMap:
name: gm-logging-dir
items:
- key: global_important_sentry.json
path: global_important_sentry.json
- key: kafka.json
path: kafka.json
- name: data-dir
hostPath:
path: /data/log/uc_sms/app
# 私有仓库镜像下载认证
imagePullSecrets:
- name: harbor-secret
apiVersion: apps/v1
kind: Deployment
metadata:
name: zeus-deploy-test
labels:
app: zeus
spec:
replicas: 1
selector:
matchLabels:
app: zeus
template:
metadata:
labels:
app: zeus
spec:
containers:
- name: zeus
image: harbor.test.gengmei/backend/zeus:v1.0
ports:
- containerPort: 8000
volumeMounts:
- name: static-route-table
mountPath: /etc/gm-config/storage/static.dir/helios.dir/
- name: resource-json
mountPath: /etc/gm-config/storage/static.dir/dev_env.dir/
- name: gm-logging-dir
mountPath: /etc/gm-config/storage/static.dir/gm_logging.dir/
- name: zeus-settings
mountPath: /srv/apps/zeus/zeus/settings_local.py
subPath: settings_local.py
- name: data-dir
mountPath: /data/log/zeus/app
volumes:
- name: static-route-table
configMap:
name: static-route-table
- name: resource-json
configMap:
name: resource-json
- name: gm-logging-dir
configMap:
name: gm-logging-dir
items:
- key: global_important_sentry.json
path: global_important_sentry.json
- key: kafka.json
path: kafka.json
- name: zeus-settings
configMap:
name: zeus-settings
items:
- key: settings_local.py
path: settings_local.py
# hostPath挂载
- name: data-dir
hostPath:
path: /data/log/zeus/app
# 私有仓库镜像下载认证
imagePullSecrets:
- name: harbor-secret
k8s.gcr.io/kube-proxy-amd64:v1.10.3=registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy-amd64:v1.10.3
k8s.gcr.io/kube-controller-manager-amd64:v1.10.3=registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager-amd64:v1.10.3
k8s.gcr.io/kube-scheduler-amd64:v1.10.3=registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler-amd64:v1.10.3
k8s.gcr.io/kube-apiserver-amd64:v1.10.3=registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver-amd64:v1.10.3
k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64:1.14.8=registry.cn-hangzhou.aliyuncs.com/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.8
k8s.gcr.io/k8s-dns-sidecar-amd64:1.14.8=registry.cn-hangzhou.aliyuncs.com/google_containers/k8s-dns-sidecar-amd64:1.14.8
k8s.gcr.io/k8s-dns-kube-dns-amd64:1.14.8=registry.cn-hangzhou.aliyuncs.com/google_containers/k8s-dns-kube-dns-amd64:1.14.8
k8s.gcr.io/pause-amd64:3.1=registry.cn-hangzhou.aliyuncs.com/google_containers/pause-amd64:3.1
k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.0=registry.cn-hangzhou.aliyuncs.com/google_containers/kubernetes-dashboard-amd64:v1.10.0
k8s.gcr.io/etcd-amd64:3.1.12=registry.cn-hangzhou.aliyuncs.com/google_containers/etcd-amd64:3.1.12
gcr.io/kubernetes-helm/tiller:v2.10.0=registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.10.0
\ No newline at end of file
sudo mkdir -p /srv/apps
sudo chown -R gmei /srv/apps
cd /srv/apps
git clone git@git.wanmeizhensuo.com:backend/backend.git
git clone git@git.wanmeizhensuo.com:backend/gaia.git
git clone git@git.wanmeizhensuo.com:backend/Mimas.git
git clone git@git.wanmeizhensuo.com:rank/doris.git
#/bin/bash
file="images"
if [ -f "$file" ]
then
echo "$file found."
while IFS='=' read -r key value
do
#echo "${key}=${value}"
docker pull ${value}
docker tag ${value} ${key}
docker rmi ${value}
done < "$file"
else
echo "$file not found."
fi
\ No newline at end of file
kind: Service
apiVersion: v1
metadata:
name: backend-service
spec:
selector:
app: backend
ports:
- protocol: TCP
port: 80
targetPort: 80
type: NodePort
\ No newline at end of file
kind: Service
apiVersion: v1
metadata:
name: doris-service
spec:
selector:
app: doris
ports:
- protocol: TCP
port: 80
targetPort: 80
\ No newline at end of file
kind: Service
apiVersion: v1
metadata:
name: gaia-service
spec:
selector:
app: gaia
ports:
- protocol: TCP
port: 80
targetPort: 80
\ No newline at end of file
kind: Service
apiVersion: v1
metadata:
name: mimas-service
spec:
selector:
app: mimas
ports:
- protocol: TCP
port: 80
targetPort: 80
\ No newline at end of file
# 运营审核所需要的时间,以天为单位
AUDIT_DURATION = 0
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # 设置为mysql数据库
'NAME': 'antispam',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3307',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4", # 为了支持emoji表情
},
},
}
DEBUG = False
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://192.168.168.142/5",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
}
}
}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # 设置为mysql�~U��~M��~S
'NAME': 'apollo',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3307',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4", # 为�~F�~T��~L~Aemoji表�~C~E
},
},
}
EMAIL_USER = 'doctor@wanmeizhensuo.com'
EMAIL_PSWD = 'xl60QkFtwJq6ziswn2a4r4pkFNozI13g'
AES_KEY = 'keycasefornonprd' # 16个�~W�~J~B�~Z~D�~F�~R�
AES_IV = 'iv_casefornonprd' # 16个�~W�~J~B�~Z~D�~H~]�~K�~P~Q�~G~O
QINIU_ACCESS_KEY = "UPCOYIJkZOMcdd9FDzpBqYjzWUh55fBpVi3AhWpL"
QINIU_SECRET_KEY = "z5YvpDDSam_JE345Z8J_f3TufzelOW2VOGNoBl9e"
BROKER_URL = 'redis://192.168.168.142/6'
ERROR_RESPONSE_TO = ['dingyingcai@gmei.com', 'zhongchengyang@gmei.com', 'xuepengfei@gmei.com']
# -*- coding:utf-8 -*-
# artemis local settings template
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://192.168.168.142:3',
'TIMEOUT': 86400, # 3600 x 24
},
}
BROKER_URL = 'redis://192.168.168.142/8'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # 设置为mysql数据库
'NAME': 'artemis_hotfix2', # zhengxing_test zhengxing_dev4hera zhengxing_dev
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3306',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4", # 为了支持emoji表情
},
},
}
DEBUG = True
SENTRY_CELERY_ENDPOINT = ''
from .base_settings import *
STATIC_ROOT = '/srv/static/ascle/'
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
DEBUG = True
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://192.168.168.142:6379/6',
'KEY_PREFIX': 'ascle',
'TIMEOUT': 86400, # one day
},
}
REDIS = {'host': '192.168.168.142', 'port': 6379, 'db': 6}
BROKER_URL = 'redis://192.168.168.142:6379/8'
QINIU_ACCESS_KEY = "UPCOYIJkZOMcdd9FDzpBqYjzWUh55fBpVi3AhWpL"
QINIU_SECRET_KEY = "z5YvpDDSam_JE345Z8J_f3TufzelOW2VOGNoBl9e"
CACHE_PAGE_STATUS = False # 页面缓存的开关
STATEMENT_VISIBLE = True # 对账单显示开关
MAIDAN_VISIBLE = True # 买单开关
# 总开关, True则全部人能看见
DOCTOR_CAN_SEE_TRAFFIC = True
# 白名单, use Doctor.id, 只要配置了一定能看见
DOCTOR_TRAFFIC_WHITE_LIST = [
'wangyang', 'aojianfei', 'chenxiaofang',
]
# 前后端分离了,添加fe 中的index.html 和 static
# ====!!!!!!dev/test/release无须配置, remove three lines settings !!!!!!!!
from .base_settings import TEMPLATES, STATICFILES_DIRS, BASE_DIR
TEMPLATES[0]['DIRS'].append(os.path.join(BASE_DIR, 'fe', 'dist'))
STATICFILES_DIRS.append(os.path.join(BASE_DIR, 'fe', 'dist', 'static'))
REDIS = {
'host': '192.168.168.142',
'port': 6379,
'db': 0,
}
REDIS_SENTINEL = [('192.168.168.142', 26379 ), ('192.168.168.142', 26379), ('192.168.168.142', 26379)]
This diff is collapsed.
#coding:utf8
import pyssdb
import os
import raven
DEBUG = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # 设置为mysql数据库
'NAME': 'bran_prod',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3307',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4", # 为了支持emoji表情
},
},
'gaia':{
'ENGINE': 'django.db.backends.mysql', # 设置为mysql数据库
'NAME': 'zhengxing',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3306',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4", # 为了支持emoji表情
},
},
}
CELERY_BROKER_URL = 'redis://192.168.168.142/0'
REDIS_URL = 'redis://192.168.168.142/2'
REDIS = {
'default': {'host': '192.168.168.142', 'port': 11032, 'db': 0,}
}
PUSH_EVENT_LIMIT = {'sum': 5, 'service': 1}
TIME_FRAGMENT = {'5h': '5h', '1d': '1d', '5d': '5d', '7d': '7d'}
ACTION_TRIGGER_INTERVAL = 5 # 事件触发时间间隔 hours
DAILY_EVENT_HANDLE_TIME = [9, 13, 21]
SSDB_CLIENT = pyssdb.Client(host='127.0.0.1', port=8888)
RAVEN_CONFIG = {
'dsn': 'http://9f8992868f0348efaca2f4375e8db1df:11764cbbdb1440c38142c9e1a1e663ac@sentry.igengmei.com/131',
}
This diff is collapsed.
[redis]
hostAndPort="192.168.168.142"
db=23
[server]
httpHostAndPort = 0.0.0.0:8109
[delay]
delay=2
[like_rate]
low_speed = 1
high_speed = 11
like_loop_time = 120
[debug]
is_debug=0
# coding=utf-8
from doris.base import *
from .log_settings import *
from celery import *
from celery.schedules import crontab
import pyssdb
CELERY_BROKER_URL = 'redis://192.168.168.142/0'
REDIS_URL = 'redis://192.168.168.142/1'
ES_V2_HOSTS = [
{'host': '192.168.168.142', 'port': 9200},
]
ES_INDEX_PREFIX = 'gm_test'
COUNT_LIMIT = 50
REDIS = {
'doctor': {'host': '192.168.168.142', 'port': 6379, 'db': 1,},
}
RAVEN_CONFIG = {
'dsn': 'http://29e77782db3c4429857cb1b6d69d9463:d55eafe28ae64f6e8c4a82fa3bc50fdd@sentry.gengmei.cc/80',
}
CELERYBEAT_SCHEDULE = {
'doris_ trans2es': {
'task': 'rank.tasks.doctor_statdata_2_cache',
# 'schedule': timedelta(seconds=1),
'schedule': crontab(hour=2, minute=0),
},
'doris_cal_device_interest': {
'task': 'recommend.tasks.cal_userinterest_rank',
# 'schedule': timedelta(seconds=1),
'schedule': crontab(hour=2, minute=0),
},
'doris_cal_servicehot_rank': {
'task': 'recommend.tasks.cal_servicehot_rank',
# 'schedule': timedelta(seconds=1),
'schedule': crontab(hour=2, minute=0),
}
}
SSDB_CLIENT = pyssdb.Client(host='192.168.168.143', port=8888)
# coding:utf8
import pyssdb
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # 设置为mysql数据库
'NAME': 'feed_prod',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3407',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4", # 为了支持emoji表情
},
},
'gaia': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'zhengxing',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3306',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4",
},
},
'mimas': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mimas_prod',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3308',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4",
},
}
}
SSDB_CLIENT = pyssdb.Client(host='192.168.168.143', port=8888)
CELERY_BROKER_URL = 'redis://192.168.168.142/0'
CELERY_BEAT_SCHEDULE = {}
# coding:utf8
import pyssdb
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # 设置为mysql数据库
'NAME': 'feed_prod',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3407',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4", # 为了支持emoji表情
},
},
'gaia': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'zhengxing',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3306',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4",
},
},
'mimas': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mimas_prod',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3308',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4",
},
}
}
SSDB_CLIENT = pyssdb.Client(host='192.168.168.143', port=8888)
CELERY_BROKER_URL = 'redis://192.168.168.142/0'
CELERY_BEAT_SCHEDULE = {}
# coding=utf8
"""
Django settings for flag_ship project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
import helios
import helios.rpc
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'zng=%a*!bokrd#=%%rawhyp0)1qr15i#x7m@hetqd%z_+kv599'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = (
'django.contrib.contenttypes',
'django.contrib.staticfiles',
'django_jinja',
'helios',
'viewbase',
'app',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
)
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
ROOT_URLCONF = 'flag_ship.urls'
WSGI_APPLICATION = 'flag_ship.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'Asia/Shanghai'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = (
('', os.path.join(BASE_DIR, '..', 'frontend', 'static')),
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
TEMPLATE_LOADERS = (
'django_jinja.loaders.FileSystemLoader',
'django_jinja.loaders.AppLoader',
)
TEMPLATE_DIRS = (
os.path.join(BASE_DIR, '..', 'frontend', 'templates'),
)
DEFAULT_JINJA2_TEMPLATE_EXTENSION = ''
RPC_URL = 'http://rpc.test.gengmei.cc/api/'
# RPC_URL = 'http://127.0.0.1:8001/api/'
RPC_SECRET = ''
RPC_INVOKER = helios.rpc.create_default_invoker(debug=DEBUG)
APP_CONFIG = {
'url_base': 'http://localhost:8000',
'app_download_page': '/app/download',
'mobile_index_page': 'http://m.gengmei.cc/',
'qiniu_host': 'http://pic.gengmei.cc/',
'default_paging_size': 20,
}
# 顶部导航Tabs
TAB_INDEX = '/'
TAB_TAGS = '/diary_list'
TAB_PROMOTION = '/promotion_list'
TAB_WIKI = '/wiki_list'
TAB_EXPERT = '/expert_list'
TAB_POST = '/post_list'
TAB_HOSPITAL = '/hospital_list'
TABS = [{'name': u'首页', 'url': TAB_INDEX},
{'name': u'项目', 'url': TAB_TAGS},
{'name': u'美购', 'url': TAB_PROMOTION},
{'name': u'百科', 'url': TAB_WIKI},
{'name': u'专家', 'url': TAB_EXPERT},
{'name': u'医院', 'url': TAB_HOSPITAL},
{'name': u'健康资讯', 'url': TAB_POST},
]
# 首页默认显示的Tag
FRONT_DEFAULT_TAGS = [{'id': 1, 'color': '#ffd34e', 'position': 1, 'icon': 'http://pic.gengmei.cc/2014/12/24/b3076876ff'},
{'id': 2, 'color': '#ffae5e', 'position': 2, 'icon': 'http://pic.gengmei.cc/2014/12/24/2624935b91'},
{'id': 3, 'color': '#ff6c8f', 'position': 4, 'icon': 'http://pic.gengmei.cc/2014/12/24/e7f379e88f'},
{'id': 7, 'color': '#9290f6', 'position': 5, 'icon': 'http://pic.gengmei.cc/2014/12/24/0ef5dafde4'},
{'id': 4, 'color': '#5e9bff', 'position': 6, 'icon': 'http://pic.gengmei.cc/2014/12/24/1eea8df935'},
{'id': 5, 'color': '#5dcdfc', 'position': 7, 'icon': 'http://pic.gengmei.cc/2014/12/24/85df448756'}]
# 医生默认头像
DEFAULT_EXPERT_PORTRAIT = 'http://pic.gengmei.cc/2015/03/13/fbde86be25-web'
# TDK
TDK = {
'title': u'更美APP官网—整形整容微整形社区与特卖平台',
'keywords': u'更美,更美APP,更美APP官网,更美网,整形,整容,微整形',
'description': u'更美APP如今是中国最大的医学美容与消费医疗服务平台,提供生活消费类医疗服务,品类包括整形、齿科、眼科、抗衰老、营养、心理(计划中)等。'
}
# Redis配置
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://192.168.168.142/1",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
}
}
}
# 百度阿拉丁KEY
ALADING_KEY = 't7bu89c9ys4ix5u7o6t7v8kuxbtos1qy'
# coding: utf-8
import os
import helios.rpc
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOST = ['*']
# RPC_URL = 'http://rpc.hotfix2.gmei.com/api/'
RPC_URL = 'http://rpc.test.gmei.com/api/'
# RPC_URL = 'http://rpc.dev.gmei.com/api/'
#RPC_URL = 'http://127.0.0.1:8001/api/'
RPC_SECRET = ''
RPC_CLIENT = helios.rpc.RPCFactory(
RPC_URL,
RPC_SECRET,
debug=DEBUG,
debug_dump_curl=True,
).create_invoker()
# RPC_CLIENT = helios.rpc.create_default_invoker(debug=DEBUG)
APP_CONFIG = {
'url_base': 'http://127.0.0.1:9000',
'app_download_page': '/app/download',
'mobile_index_page': 'http://ship-service.default/',
'qiniu_host': 'http://pic.gmei.com/',
'default_paging_size': 20,
'qiniu_prefix': 'http://pic.gmei.com',
'all_category_icon_url': 'http://hera.s.gmei.com/img/quanbufenlei.png',
'session_cookie_name': 'shipsessionid',
'cross_domain': '.gmei.com',
}
class APP_CONFIG_CLASS(object):
qiniu_prefix = 'http://pic.gmei.com'
all_category_icon_url = 'http://hera.s.gmei.com/img/quanbufenlei.png'
session_cookie_name = 'shipsessionid'
# cross_domain = '.gmei.com'
cross_domain = 'http://127.0.0.1:9000'
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://192.168.168.142/1",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
}
}
}
# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
# NOTE:django
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
APPEND_SLASH = False
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
TEMPLATE_DIRS = (
os.path.join(BASE_DIR, '..', 'frontend', 'templates'),
)
TEMPLATES = [
{
'BACKEND': 'django.template.backends.jinja2.Jinja2',
'DIRS': (
TEMPLATE_DIRS
),
'APP_DIRS': True,
'OPTIONS': {
'environment': 'app.utils.environment',
},
}
]
STATICFILES_DIRS = (
os.path.join(BASE_DIR, '..', 'frontend', 'static'),
)
STATIC_URL = '/static/'
STATIC_ROOT = ''
# STATIC_ROOT = os.path.join(BASE_DIR, '..', 'frontend', 'static')
# STATIC_ROOT = '/srv/apps/flag-ship/frontend/static'
This diff is collapsed.
# -*- coding:utf-8 -*-
DEBUG = False
DATABASES = { # 设置为线上的数据库地址,用户名,密码
'default': {
'ENGINE': 'django.db.backends.mysql', # 设置为mysql数据库
'NAME': 'gm_face',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3307',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4", # 为了支持emoji表情
},
},
}
FACEPP_API_KEY = 'VFZ80NNdS-zIqnlFJClzlM8iq4ZVHqa3'
FACEPP_API_SECRET = 'BxIeNVw26xas1KbcWGzL8zlF1kMy0gdj'
BROKER_URL = ['redis://192.168.168.142:6379/18', 'redis://192.168.168.142:6379/22'] # 线上redis
REDIS = {'host': '192.168.168.142', 'port': 6379, 'db': 23, } # 线上redis
# coding:utf8
import os
from .base_settings import *
import helios.rpc
DEBUG = True
STATIC_ROOT = '/srv/static/hera'
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://192.168.168.142:6379/5',
# 'LOCATION': 'redis://127.0.0.1:6379/5',
'TIMEOUT': 86400, # 3600 x 24
},
}
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
RPC_URL = 'http://rpc.test.gengmei.cc/api/'
RPC_KEY = 'basic:6o9sVEB6+H5U61rfZpVMioWcRRoU32uazNE3h18kwcAqOMPVdjmvQ72XxZVNLNl6RSACrgLeD7xrKYsxL1iZ6A=='
BACKEND = 'http://backend-service.default'
QINIU_ACCESS_KEY = "UPCOYIJkZOMcdd9FDzpBqYjzWUh55fBpVi3AhWpL"
QINIU_SECRET_KEY = "z5YvpDDSam_JE345Z8J_f3TufzelOW2VOGNoBl9e"
QINIU_HOST = "http://wanmeizhensuo.qiniudn.com/"
QINIU_SCOPE = 'wanmeizhensuo'
DOCTOR_URL = 'http://doctor.test.gengmei.cc'
ASCLE = 'http://doctor.test.gengmei.cc'
ES_HOSTS = [{'host': '192.168.168.142', 'port': 19200}] # [{'host':'','port': }]
ES_INDEX = 'gm_hades_test_write' # es index
ES_TYPE = 'doctor' # es type
ES_SEARCH_TIMEOUT = 60
CELERY_RESULT_BACKEND = ''
DOCTOR_BUSINESS_CHANNAL_ID = 51
EMAIL_USER = 'doctor@wanmeizhensuo.com'
EMAIL_PSWD = 'xl60QkFtwJq6ziswn2a4r4pkFNozI13g'
BROKER_URL = 'redis://192.168.168.142:6379'
# BROKER_URL = 'redis://127.0.0.1:6379'
EXPORT_LOG = {'host': '192.168.168.142', 'port': 6379, 'db': 7}
SELF_SUPPORT_WHITELIST_HOSPITAL = [
('bjrlsylmrzs', '北京瑞丽舍医疗美容诊所'),
('chqxnzhx', '重庆西南医院'),
]
USE_VERIFY_CODE = False
PUSH_COUPON_CHANNAL_ID = 93
RAVEN_CONFIG = {
'dsn': ''
}
# -*- coding:utf-8 -*-
"""
Django settings for gengmei project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
import logging
import helios.rpc
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
_URL_PREFIX = ""
DATETIME_FORMAT = 'Y-m-d H:i:s'
DATE_FORMAT = 'Y-m-d'
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'r@ym7!c!y9&me*u873hq)t+sov)@f1l0+3u!4^rf)$3t5#d1&u'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'api',
'fileserver',
'raven.contrib.django.raven_compat',
'django_jinja',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.static",
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.request",
"django.core.context_processors.media",
"django.contrib.messages.context_processors.messages",
)
STATICFILES_DIRS = (
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
TEMPLATE_LOADERS = (
'django_jinja.loaders.FileSystemLoader',
'django_jinja.loaders.AppLoader',
)
TEMPLATE_DIRS = (
BASE_DIR + '/templates',
)
ROOT_URLCONF = 'gengmei.urls'
WSGI_APPLICATION = 'gengmei.wsgi.application'
LANGUAGE_CODE = 'zh-cn'
TIME_ZONE = 'Asia/Shanghai'
USE_I18N = True
USE_L10N = True
# USE_TZ = True
SITE_ID = 1
# 邮件发送参数配置
EMAIL_HOST='smtp.exmail.qq.com'
EMAIL_HOST_USER='doctor@wanmeizhensuo.com'
EMAIL_HOST_PASSWORD='1812bar'
DEFAULT_FROM_EMAIL = 'doctor@wanmeizhensuo.com'
BrokenLinkEmailsMiddleware = True
SERVER_EMAIL = 'doctor@wanmeizhensuo.com'
EMAIL_PORT = 25
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
MEDIA_ROOT = BASE_DIR + '/media/'
MEDIA_URL = _URL_PREFIX + '/medical/media/'
STATIC_ROOT = BASE_DIR + '/static/'
STATIC_URL = _URL_PREFIX + '/static/'
FILE_UPLOAD_MAX_MEMORY_SIZE = 0
# 300天才过期,认为用户只要登录就不会退出
SESSION_COOKIE_AGE = 60 * 60 * 24 * 300 # Age of cookie, in seconds (default: 300 weeks).
QINIU_ACCESS_KEY = "UPCOYIJkZOMcdd9FDzpBqYjzWUh55fBpVi3AhWpL"
QINIU_SECRET_KEY = "z5YvpDDSam_JE345Z8J_f3TufzelOW2VOGNoBl9e"
API_HOST = "http://www.wanmeizhensuo.com"
BEAUTIFUL_ACCESS_KEY = ''
BEAUTIFUL_SECRET_KEY = ''
_API_URL_PREFIX = API_HOST
_WEB_URL_PREFIX = API_HOST
RAVEN_CONFIG = {
'dsn': 'http://9f8992868f0348efaca2f4375e8db1df:11764cbbdb1440c38142c9e1a1e663ac@sentry.igengmei.com/131',
}
LOG_DIR = '/data/log/hermes/app/'
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s %(levelname)s %(module)s.%(funcName)s Line:%(lineno)d %(message)s',
filename=os.path.join(LOG_DIR, 'filelog.log'),
)
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(asctime)s %(levelname)s %(module)s.%(funcName)s Line:%(lineno)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'null': {
'level': 'DEBUG',
'class': 'django.utils.log.NullHandler',
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple'
},
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler'
},
# 默认的服务器Log(保存到log/filelog.log中, 通过linux的logrotate来处理日志的分割
'default': {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(LOG_DIR, 'filelog.log'),
'formatter': 'verbose',
},
# 默认的服务器ERROR log
'default_err': {
'level': 'ERROR',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(LOG_DIR, 'error_logger.log'),
'formatter': 'verbose',
},
'exception_logger': {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(LOG_DIR, 'exception_logger.log'),
'formatter': 'verbose',
},
'ticker_logger': {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(LOG_DIR, 'ticker_logger.log'),
'formatter': 'verbose',
},
'push_logger': {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(LOG_DIR, 'push_logger.log'),
'formatter': 'verbose',
},
'elapsed_logger': {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(LOG_DIR, 'elapsed_logger.log'),
'formatter': 'verbose',
},
'info_logger': {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(LOG_DIR, 'info_logger.log'),
'formatter': 'verbose',
},
'auth_logger': {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(LOG_DIR, 'auth_logger.log'),
'formatter': 'verbose',
},
'webproblem_logger': {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(LOG_DIR, 'webproblem_logger.log'),
'formatter': 'verbose',
},
'sql_logger': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(LOG_DIR, 'sql.log'),
'formatter': 'verbose',
},
},
'loggers': {
# 默认都交给django了
'django': {
'handlers': ['default'],
'propagate': True,
'level': 'INFO',
},
'django.request': {
'handlers': ['default_err'],
'level': 'ERROR',
'propagate': False,
},
'exception_logger': {
'handlers': ['exception_logger'],
'level': 'INFO',
'propagate': False,
},
'ticker_logger': {
'handlers': ['ticker_logger'],
'level': 'INFO',
'propagate': False,
},
'push_logger': {
'handlers': ['push_logger'],
'level': 'INFO',
'propagate': False,
},
'elapsed_logger': {
'handlers': ['elapsed_logger'],
'level': 'INFO',
'propagate': False,
},
'info_logger': {
'handlers': ['info_logger'],
'level': 'INFO',
'propagate': False,
},
'auth_logger': {
'handlers': ['auth_logger'],
'level': 'INFO',
'propagate': False,
},
'err_logger': {
"handlers": ['default_err'],
'level': "ERROR",
"propagate": False,
},
}
}
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
DEFAULT_JINJA2_TEMPLATE_EXTENSION = '.jinja.html'
RPC_URL = 'http://10.129.148.20/api/'
RPC_SECRET = 'basic:XYLxLlkTFe89EnzR2e0bF90PqT29NkK5R9kaY50LhgIVIhzCZDiPT4C5AIO894lFHA0y+29ziq589m+LnCn2Iw=='
RPC_INVOKER = helios.rpc.RPCFactory(RPC_URL, RPC_SECRET, debug=DEBUG).create_invoker()
# 广点通
APPID_GDT = '639234809'
ADID_GDT = '55108'
ENCRYPT_KEY_GDT = '65772fc7658ffef4' # 加密密钥
SIGN_KEY_GDT = '41a8b982321e80a9' # 签名密钥
CONV_TYPE_GDT = 'MOBILEAPP_ACTIVATE'
URL_GDT = 'http://t.gdt.qq.com/conv/app/'
###2016-4-19 add by WangChengLiang
GDT_URL = 'http://t.gdt.qq.com/conv/app/'
GDT_SIGN_KEY = 'bec031e37babd08f'
GDT_ENCRYPT_KEY = 'BAAAAAAAAAAAFzsH'
GDT_CONV_TYPE = 'MOBILEAPP_ACTIVITE'
GDT_ADVER_ID = '1522439'
###end###
# -*- coding:utf-8 -*-
DEBUG = False
RAVEN_CONFIG = {
'dsn': 'http://9f8992868f0348efaca2f4375e8db1df:11764cbbdb1440c38142c9e1a1e663ac@sentry.igengmei.com/131',
}
STATIC_ROOT = '/srv/static/kefu'
QINIU_ACCESS_KEY = "UPCOYIJkZOMcdd9FDzpBqYjzWUh55fBpVi3AhWpL"
QINIU_SECRET_KEY = "z5YvpDDSam_JE345Z8J_f3TufzelOW2VOGNoBl9e"
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://192.168.168.142:6379/80',
'KEY_PREFIX': 'kefu',
'TIMEOUT': 86400, #one day
},
}
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
# -*- coding: UTF-8 -*-
from __future__ import unicode_literals
from .base_settings import *
from .celery_task_settings import *
import pymysql
pymysql.install_as_MySQLdb()
SECRET_KEY = '79!ro64h@pcse-1z=$v&_sh)+d))9rifii79of0gb8uyb86=8m'
DEBUG = False
ALLOWED_HOSTS = ['*']
STATIC_ROOT = '/srv/static/mars'
RAVEN_CONFIG = {
'dsn': 'http://9f8992868f0348efaca2f4375e8db1df:11764cbbdb1440c38142c9e1a1e663ac@sentry.igengmei.com/131',
}
# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
DATABASES = {
'default': { # mysql
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mars',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3506',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4",
},
},
'gaia': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'zhengxing',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3306',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4",
},
},
'mars-master': { # mysql
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mars',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3506',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4",
},
},
'gaia-master': { # mysql
'ENGINE': 'django.db.backends.mysql',
'NAME': 'zhengxing',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3306',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4",
},
},
'zeus': {
'ENGINE': 'django.db.backends.mysql', # 设置为mysql数据库
'NAME': 'zeus',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3506',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4", # 为了支持emoji表情
},
},
}
DATABASE_ROUTERS = ["tool.routers.GaiaRouter"]
RPC_URL = 'http://10.25.194.175/api/'
RPC_KEY = 'basic:6o9sVEB6+H5U61rfZpVMioWcRRoU32uazNE3h18kwcAqOMPVdjmvQ72XxZVNLNl6RSACrgLeD7xrKYsxL1iZ6A=='
BACKEND = 'http://wanmeizhensuo.com'
USER_COOKIE_NAME = 'session_key'
USER_COOKIE_TIME = 864000 # 10 days
BROKER_URL = 'redis://192.168.168.142:6379/13'
# ===========================================
ES_HOSTS = [{
'host': '192.168.168.142',
'port': 9200,
}, {
'host': '192.168.168.142',
'port': 9200,
}, {
'host': '192.168.168.142',
'port': 9200,
}]
# ===========================================
# ===========================================
EMAIL_HOST = 'smtp.exmail.qq.com'
EMAIL_HOST_USER = 'doctor@wanmeizhensuo.com'
EMAIL_HOST_PASSWORD = 'gengmei098'
STATIS_EMAIL_USER = 'youjiantongji@wanmeizhensuo.com'
STATIS_EMAIL_PSWD = 'mq37tgk8nGi6eg1Hgq388oro3itvdmPl'
DEFAULT_FROM_EMAIL = 'doctor@wanmeizhensuo.com'
BrokenLinkEmailsMiddleware = True
SERVER_EMAIL = 'doctor@wanmeizhensuo.com'
EMAIL_PORT = 25
# ===========================================
# ===================================
# 邮件统计收件人
WATCHER = ['wangchengliang@gmei.com', 'linhuazhu@mei.com'] # 数据组自己统计
QUDAOZU = ['qudaozutongji@wanmeizhensuo.com'] # 今日分渠道设备,用户统计
CITY_SERVICE = ['skutongji@wanmeizhensuo.com'] # 今日各城市在售美购统计
SIXINZU = ['sixintongji@wanmeizhensuo.com'] # 本周医生未回复私信统计
DOCTOR_WATCHER = ['hexinyishengtongji@wanmeizhensuo.com'] # 今日医生美购浏览量统计
JIAOYIZU = ['jiaoyizutongji@wanmeizhensuo.com'] # 今日交易组统计邮件
SHEQUZU = ['shequzutongji@wanmeizhensuo.com'] # 今日社区组统计邮件
QUDAOZU2 = ['qudaozutongji@wanmeizhensuo.com'] # 今日渠道组活跃统计邮件
YONGHUZU = ['yonghutongji@wanmeizhensuo.com'] # 今日日记本缺失美购统计
DINGDAN = ['dingdantongji@wanmeizhensuo.com'] # 美购退款统计
YUYUE = ['yuyuetongji@wanmeizhensuo.com'] # 美购预约统计
AISI = ['qudaozutongji_common_aisi@wanmeizhensuo.com'] # 爱思助手推广
WATCHER_TWO = [
'wangchengliang@gmei.com',
'zhuyaoyao@gmei.com',
'dengwenyue@gmei.com',
'linhuazhu@gmei.com'
]
###2016-08-10###
BIHUAN = ['bh@gmei.com']
###end####
# ===================================
# ===========================================
ZHIDA_SK = 'vOom6KmcFBSVnWOy22qPmX7IGMpdsBUv'
ZHIDA_URL = 'http://m.baidu.com/lightapp/pay/order/offline/add'
ZHIDA_SP_NO = 93836
# ===========================================
CACHE = {
'default':
{ 'BACKEND': 'redis_cache.cache.RedisCache',
'LOCATION': 'redis://192.168.168.142:6379/15',
'TIMEOUT': 86400,
},
}
### 2016-05-30 Add by LinHuaZhu
AUTHORIZATION_ID = 'gmauth_key'
AUTHORIZATION_KEY = 'ecaeb940a2c615f654265183b3f8e76f'
###end####
###2016-06-02 Add by LinHuaZhu
SENTRY_CELERY_ENDPOINT = 'http://f549010eff314c97abd1c345796be3dc:accf8f78f693405fba4de405457111e9@sentry.gengmei.cc/33'
###end####
###2016-08-04 Add by WangChengYang
AES_KEY = '7vgc5dIbnkV5FM4C'
AES_IV = 'W2juIMi4urH9SiL0'
###end####
This diff is collapsed.
DATABASES = {
'default': { # mysql
'ENGINE': 'django.db.backends.mysql',
# 'NAME': 'mimas_dev',
'NAME': 'mimas_test',
'USER': 'work',
'PASSWORD': 'Gengmei1',
# 'HOST': '127.0.0.1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3306',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4",
},
},
'slave': { # mysql
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mimas_dev',
'USER': 'work',
'PASSWORD': 'Gengmei1',
# 'HOST': '127.0.0.1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3306',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4",
},
},
}
CELERY_TIMEZONE = 'Asia/Shanghai'
BROKER_URL = 'redis://192.168.168.142:6379/0'
CELERY_BROKER_URL = 'redis://192.168.168.142:6379/0'
CELERY_TASK_SERIALIZER = "json"
SENTRY_CELERY_ENDPOINT = ''
BACKEND_API_HOST = 'http://backend-service.default'
# 初始化数据
INIT_DATA = True
# qa hack num
ANSWER_HACK_STRT = '-'
QINIU_CDN_HOST = u'http://pic.igengmei.com/'
MULTI_TOPIC_TAG_ID = 5089
GM_SERIALIZER = {
'redis': {
'host': '192.168.168.142', 'port': 6379, 'db': 1,
}
}
TEST_RUNNER = 'gm_test.runner.GmTestRunner'
REDIS = {
'default': {'host': '192.168.168.142', 'port': 6379, 'db': 0, },
'view': {'host': '192.168.168.142', 'port': 6379, 'db': 1, },
'answer_sort_cache': {'host': '192.168.168.142', 'port': 6379, 'db': 4, },
'high_quality_question_cache': {'host': '192.168.168.142', 'port': 6379, 'db': 5, },
'vote_cache': {'host': '192.168.168.142', 'port': 6379, 'db': 6, },
'page_cache': {'host': '192.168.168.142', 'port': 6379, 'db': 10, },
'social_cache': {'host': '192.168.168.142', 'port': 6379, 'db': 11, },
'user_cache': {'host': '192.168.168.142', 'port': 6379, 'db': 12, },
}
DATABASE_ROUTERS = ['utils.router.ThreadLocalRouter',]
LIVE_REDIS = {'host': '192.168.168.142', 'port': 6379, 'db': 7, }
DEFAULT_REDIS = {'host': '192.168.168.142', 'port': 6379, 'db': 8, }
TALOS_RPC_CACHE = {'host': '192.168.168.142', 'port': 6379, 'db': 9, }
# gaia local settings template
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # 设置为mysql数据库
'NAME': 'zhengxing_test',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4", # 为了支持emoji表情
},
},
}
SECRET_KEY = 'fl-lv3j^czg(dupo@hbs(+_+djby9zelwt&rh71@b1x*ptmj4#(^' #dev
DEBUG = True
REDIS = {
'host':'192.168.168.142',
'port':6379,
'db':0,
}
REDIS_SENTINEL = [('192.168.2.6', 26379)]
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAvjaGLGkT8VDeMbIz/Fsx9q3UQ8yZL6FNf/lfpAwsA9IWsGRb
FniSudG0cJrND1swb8Vd2IOLnVyhWb1AWdmic1L5guQKrGDiTx6GqEG1NBhntDoF
ysdil39L/f6f81mneUsccdmA4PfwITkvetgzsUdKyx6XSzHVdjCDrxWiO4Rz4hq5
Sp3tPnZCMl+CGE/5GIUftWnlOZGkifgtcok9Ja9CguBl1Jqc8lv34Wc+xHkKLRbA
UBzX8kdNMwCoLTcKbuvf5vWB+5xg7D/mw3kQI6p/8bCKOqMYlqceq2qmgyBSbqtm
k6+h/mSFiuUuG4S3CoQdVqFXFg24hAbWBV4mqQIDAQABAoIBACnqhgK/XR+ufGhj
JsWTqxz7DW2rZo5yc0uiPos+C20EHO/eDZyUEXFVXvf5hPq/U5st2RJfWqLgyMWn
yMiEByJ2xHktm5SE/RoGVhI5+J50SlYS+zfGXFmaObrNI55SwW8fODN2hMoOmSIZ
IfdmMW39kePU5+4wGyQiaMJqeAe5NG7GFUCm7UtI96ENj2afWMWEjRtV1HSGL+Tu
VMbGUhgsXm6Of6oTxU0ARITHAFyogdj7D/vyE7Gzt9/Yam9uwWfKdidSaj2bbVgr
HGVBAyFs0s1569AM5+fhAU4qA1qQmiWpbgX3m8n94KwH/7JCTWX5DCimfnGajkk2
fjbICgECgYEA+nTeXczI9a1Fv+Fs8W35a4jlVIoJRcLW1C04CidWEG3JHRzT06Gb
i4u8F+eoJD9s0KqZoJbOAADcg1skxz3balwJ01ExmQe+tt/VFuFKYaqtBYMbJ7JK
+zoMC6KLdP16dfiWWGzSVC+yVU21mkEiPPX8uSMmO6DqcUff9Y5YmYkCgYEAwmxO
DCwKZPf/AGtNhvvUUAAyYJEbx05Ed5sSSSMVhXJDRKapcWVQH2QLTa50Yr3lyRma
7A1dLC5nv0Awf3rOOiyxzL1R3j7jdidaURmj2BXwCbBVnnuRlVp2ZVV16LqCAaVY
86TwWJeJ1QWw+5Tc70e2wM623DWN65hiclP0fCECgYBkCMnILUMW3V4+hYs94u78
RHFUks2hT3D+zhDT/WIirbbmKd1xadr2oZk+8wf1cl/D+F/kBFfDKJTq4jyOV+aL
VLeX75YfyTgjUsOJn/JVkBYLXZI7CLtqHIUzIHkTASsoc2GZb92SQnq4F5GxStKi
Bp4qVB+xMVRyaoLJUVGSAQKBgCkxAxQnHIip1jgDg+huYFwWvpWhCM6gMXdZvnUK
XtvoCoJ4APxKZ8BO1Oo/ZN8qto11xFHwvuXGayqk8eGAZkMDBySGk9rPXifBTKxU
D1ePxkx3NJygN4b6JI1xnsqRAUxR+NeeAWHzsTsVupqCvpBflEOjSDC9k/TvUyQ/
z1OhAoGAMk6jJDd2c9Sx6JRWbIsYD42T/3HSTRzGq5NHBzmc3zFFFmcJIaI4qXMh
9WgQRxWR01sRK+083j8iVesVo6pyQ1qZowBj9unHcOOjB1y3Xc8uzqQWX4aDP7Wh
MhCum+nlPmhJx8Ex3l3rhR0rE02zXMa2WVJgvcJGHnubQGLSnR8=
-----END RSA PRIVATE KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiMQbWLf9YDH1HZs3bMwPO_qxwkbd0JKGqxN37NVFZBKPmvsSkZKkzCq2XXLCQYNwF5Wf9V5nAyvdxgH4rNmIK4hSxTz-afSuWpmETWGecj2fM3psJ7YQG1VE39pDuiGf-bnUhOqdu8Qwpr3F7PKYthHnAIinehDrfQhba6SoeNA5UL8eiXeQCz0vy9Kd2NT2cdsU6uTNRn7SUrI46GpMW9RqVlaHKEqL6EeC_y-vAKzWpmhKD_RkgHRDyg3NjplGBMLy72V8yTI8foh-8rIIKhtQiHd-KgwnHiJT32TCRTm73MuVPwUUDNS2Bhd5beSppNeQ-uZvcea6bKQUNFz6qQIDAQAB
\ No newline at end of file
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQDyPlAcvt4804ZPPezoQ1+wo5D4h21z3chv3ofZvyhspWKpoWSB
IUdGtaPdv09ywpJljqpryVAFCcmdOsQ7AyvHvVbh/AGhOEgV33nzSb9aDhJNGnhA
chpp/BZIv3jAZDyq2kHgvmWpxe52YS4R6TdQMexj5o8EN7WQNVHiQTtIVwIDAQAB
AoGAE4QxsB8wiHYCPCAhFhVXgEOtSlie2Nblbx3elAxylU49xKzcDAtCUtAPg64G
GJjUcpor4MM3TzCarbAuXxLCVA0sUSd7FAuIqQzSsv2f7RTfvhrbvhjylwRbZzko
TQT+nUMdf2v75eKWq6YLzvh8ZZvdN+WaIw3OCHrgsOoflQECQQD7PorUlRGXpWL9
ocoC6JxZDjheBKOgO58JuIv0AdoMbZyp3YQA43WoAKUpg5BzLfoITqyZhqhmrasH
aLJtbTY7AkEA9tQnpg4is2nYoOMH50d7iPOlSfATSIciRUE/rTukiOSqzuaRCDVQ
HhiRw7dzSgr6/5aNRfPE7zuQ9ynHWfyolQJAMagt1lBUNs24X/rPK34AENXvrB1s
nanLCCfSeXq4NwafFS+z/Fz4jyj5e9gF/83RgjzSflGQDSM8D23Q/jG8qwJBAKo5
I+LcSsgqzhAeolu5K5QGW86C9/mD4HmchxqkUFNsR/QKhKkBg3BOB3DPen3s1q8f
l+xPMli+XrpmIKqJmYUCQGy9x6SJfinASfRGBeinLUuRcThE5oF5lP3OYtRCKF7M
atcdf7wARxDNr9zy/yzXV1stv+HoqG7laJxt8ERYcwQ=
-----END RSA PRIVATE KEY-----
\ No newline at end of file
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDFNndmLlsi8NYQpvZNK/b6kSjN99lwWnWbAHxfBcBYQHx5mZBR8XkkIajSiYo29f7zmM0eAI8OSo6FY16bSt23RzThd+MvDBQC6axDCgGag5992AVGItU8LtWPBrM6XRbtN3+rjIteKhNDOUbEvp60S9/8uoEfnqekd/nEG9I4mQIDAQAB
-----END PUBLIC KEY-----
\ No newline at end of file
# gaia local settings template
DEBUG = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # 设置为mysql数据库
'NAME': 'plutus',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3306',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4", # 为了支持emoji表情
},
},
}
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://192.168.168.142:6379/113",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
}
}
}
RM_SERVER="https://api.puhuifinance.com"
RM_AUTH_SERVER="https://api.puhuifinance.com"
RM_TOKEN="AYLDASuPfbpsEQB6"
RM_CLIENT_ID="gengmei"
RM_SECRET="M6RBx4SkJcjgzQij"
ZA_APP_KEY = '63da669f3333fe09024d50dd04fee65c'
ZA_URL = 'http://opengw.daily.zhongan.com/Gateway.do'
ZA_PUB_KEY = '/srv/secret/zhongan_public.pem'
ZA_PRI_KEY = '/srv/secret/zhongan_private.pem'
AES_KEY = '6O58bOnKftwvbUM6' # 16个字节的密钥,需要重新生成
AES_IV = '7tIFgpydqrfer3l3' # 16个字节的初始向量,需要重新生成
YINUO_SECRECT = 'kwR58f2BNLWemSmOEDsi9mJReWpHfGo8'
YINUO_USER_ID = 'KOQ6CNWM'
YINUO_HOST = 'https://api-sandbox.yinuobaoxian.com'
YINUO_PREMIUM = 5
YINUO_PRODUCT_ID = '8YMWI5QZ'
YINUO_PLAN = 'A'
YINUO_SUM_INSURED = 50000
YINUO_EXPIRATION_DAYS = 210
###Add by Yingcai###
#YRD_SERVER = 'http://pay.yirendai.com'
#YRD_KEY = 'Tn0Kvprwj53xn83z78IsCw=='
USER_SHUNT = (0.01, 0.01, 0.99)
### add by yunyu###
BROKER_URL = 'redis://192.168.168.142:6379/114'
SENTRY_CELERY_ENDPOINT = 'http://9f8992868f0348efaca2f4375e8db1df:11764cbbdb1440c38142c9e1a1e663ac@sentry.igengmei.com/131'
ZHONGAN_FAIL_MAILS = ['dingyingcai@gmei.com', 'zhengdixun@gmei.com', 'yuqiaolin@gmei.com']
# django database settings
DATABASES = {
'default': {},
'gaia': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'push',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3406', # zhengxing库rds端口
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4",
},
},
}
from gm_types.push.enum import SEGMENT_TYPE
USER_JPUSH_SETTINGS = {
'key':'9e779399e200529a63722da7',
'secret':'38a0a35dc8bc96b509fc61e1',
}
DOCTOR_JPUSH_SETTINGS = { # 医生版极光key
'key':'5c450e73f736580543d0bd4e',
'secret':'688b209acae48381ece1f3f8',
}
BIG_PUSH_DURATION = 10 # 平滑推送窗口时间(分钟)
PUSH_STAT_DELAY = 60 # 统计延时(秒)
SEGMENT_MAP = {
SEGMENT_TYPE.ACTIVE_7_DAYS: '2f162d3395',
SEGMENT_TYPE.NO_ACTIVE_7_DAYS: 'cf8477eef4',
}
\ No newline at end of file
# basic config
DEBUG = False
TIME_ZONE = 'Asia/Shanghai'
MAX_USER_COUNT = 128 # 批量推送一次最多允许推送的用户数(无需修改)
CELERY_BROKER_URL = 'redis://192.168.168.142/0' # redis地址
This diff is collapsed.
This diff is collapsed.
{
"mysql": {
"prod": {
"host": "rdsmaqevmuzj6jy.mysql.rds.aliyuncs.com",
"db": "zhengxing_test"
},
"slave": {
"host": "rdsmaqevmuzj6jy.mysql.rds.aliyuncs.com",
"db": "zhengxing_test"
},
"hera":{
"host": "rdsmaqevmuzj6jy.mysql.rds.aliyuncs.com",
"db": "hera_test"
},
"doris":{
"host": "rdsmaqevmuzj6jy.mysql.rds.aliyuncs.com",
"db": "doris_test"
}
},
"elasticsearch": {
"index": "gm_test"
}
}
{
"dsn": "http://76cf5d6006ad4688a9060d7de3a80396:e652d6a0c45547008943056ec51731c6@sentry.igengmei.com/55"
}
{
"kafka": {
"hosts": [{
"host": "192.168.168.143",
"port": 9092,
"_comment": "zk-kafka.paas"
}],
"default_topic": "gm-logging-paas",
"topics": {
"py_logging": "gm-logging-paas.py-logging",
"inspect": "gm-logging-paas.inspect",
"app": "gm-logging-paas.app"
}
}
}
{
"broker_url": "pyamqp://work:workwork@10.25.251.33:5672/"
}
\ No newline at end of file
{
"redis": {
"host": "redis.test.gengmei",
"port": 6379,
"db": 0
},
"expire": 60,
"dsn": ""
}
{
"redis": {
"host": "r-2ze0670c3c1bb194.redis.rds.aliyuncs.com",
"pass": "Gengmei1!",
"port": 6379,
"db": 15
},
"expire": 60,
"dsn": ""
}
# gaia local settings template
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://192.168.168.142/4",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
}
}
}
# -*- coding:utf-8 -*-
DEBUG = False
RAVEN_CONFIG = {
'dsn': 'http://9f8992868f0348efaca2f4375e8db1df:11764cbbdb1440c38142c9e1a1e663ac@sentry.igengmei.com/131',
}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # 设置为mysql数据库
'NAME': 'zeus',
'USER': 'work',
'PASSWORD': 'Gengmei1',
'HOST': 'rm-2ze0v6uua2hl9he8e.mysql.rds.aliyuncs.com',
'PORT': '3506',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4", # 为了支持emoji表情
},
},
}
DEFAULT_REDIS = {'host': '192.168.168.142', 'port': 6379, 'db': 90, }
BROKER_URL = 'redis://192.168.168.142/91'
CELERY_IMPORTS = ("kefu.tasks",)
CELERY_GMLOGGING_DIR = '/data/log/zeus-celery/celery/'
CAN_NOT_DELETE_ENTRIES = ['455979578157409fab1ca83f4f824e87']
{
"mysql": {
"prod": {
"host": "rdsmaqevmuzj6jy.mysql.rds.aliyuncs.com",
"db": "zhengxing_test"
},
"slave": {
"host": "rdsmaqevmuzj6jy.mysql.rds.aliyuncs.com",
"db": "zhengxing_test"
},
"hera":{
"host": "rdsmaqevmuzj6jy.mysql.rds.aliyuncs.com",
"db": "hera_test"
},
"doris":{
"host": "rdsmaqevmuzj6jy.mysql.rds.aliyuncs.com",
"db": "doris_test"
}
},
"elasticsearch": {
"index": "gm_test"
}
}
{"dsn": "http://c5b4ede52bc6452182565b529735a090:0324e8fff118445a9b38576213b8e759@sentry.igengmei.com/120"}
{
"kafka": {
"hosts": [{
"host": "kafka.dev.gengmei",
"port": 9092
}],
"default_topic": "gm-logging-test",
"topics": {
"inspect": "gm-logging-test.inspect",
"app": "doris"
}
}
}
This diff is collapsed.
{
"broker_url": "pyamqp://localhost//"
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment