下載檔案 將charts目錄放置path
如/opt/yaml/finebi-dev/ 之中
- 注意namespace
- nodeport設定
一、測試區安裝
mysql
path: /opt/yaml/finebi-dev/charts/mysql
先建pvc
kubectl apply -f mysql_pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data-mysql-0
namespace: finebi-dev
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
storageClassName: nfs-client
helm install mysql -n finebi-dev -f myvalues.yaml . (建立)
helm upgrade mysql -n finebi-dev -f myvalues.yaml . (更新)
helm delete mysql -n finebi-dev (刪除)
global:
imagePullSecrets: []
storageClass: "openebs-hostpath"
image:
registry: "harbor.flexium.com.tw/flexium-bi"
repository: mysql
tag: v20.2.4-5.7.42
auth:
rootPassword: mysql
database: finedb
primary:
resources:
requests:
cpu: "1000m"
memory: "2Gi"
limits:
cpu: "1000m"
memory: "3Gi"
redis
path: /opt/yaml/finebi-dev/charts/redis
先建pvc
kubectl apply -f redis_pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data-mysql-0
namespace: finebi-dev
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
storageClassName: nfs-client
helm install redis -n finebi-dev -f myvalues.yaml . (建立)
helm upgrade redis -n finebi-dev -f myvalues.yaml . (更新)
helm delete redis -n finebi-dev (刪除)
global:
imagePullSecrets: []
storageClass: "nfs-client"
redis:
password: redis
image:
registry: "harbor.flexium.com.tw/flexium-bi"
repository: redis
tag: v20.1.2-6.2.11
master:
resources:
requests:
cpu: "1000m"
memory: "2Gi"
limits:
cpu: "1000m"
memory: "3Gi"
elasticSearch
注意 使用 apply -f 安裝時候必須加上-n namespace (使用helm安裝可以忽略此點)
path: /opt/yaml/finebi-dev/charts/elasticSearch
先建pvc
kubectl apply -f elasticSearch_pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: elasticsearch-master-elasticsearch-master-0
namespace: finebi-dev
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 200Gi
storageClassName: nfs-client
helm install elasticsearch -n finebi-dev -f myvalues.yaml . (建立)
helm upgrade elasticsearch -n finebi-dev -f myvalues.yaml . (更新)
helm delete elasticsearch -n finebi-dev (刪除)
image: harbor.flexium.com.tw/flexium-bi/elasticsearch
imageTag: v20.1.4-8.4.1
imagePullSecrets: []
secret:
password: "elastic"
volumeClaimTemplate:
storageClassName: "nfs-client"
resources:
requests:
storage: 200Gi
resources:
requests:
cpu: "1000m"
memory: "2Gi"
limits:
cpu: "1000m"
memory: "3Gi"
- frbi (BI)
path: /opt/yaml/finebi-dev/charts/frbi
先建pvc
kubectl apply -f frbi_pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: bi-pvc
namespace: finebi-dev
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 200Gi #注意需求
storageClassName: nfs-client
helm install bi -n finebi-dev -f myvalues.yaml . (建立)
helm upgrade bi -n finebi-dev -f myvalues.yaml . (更新)
helm delete bi -n finebi-dev (刪除)
image: "harbor.flexium.com.tw/flexium-bi/biengine"
imageTag: "3.0final"
imagePullSecrets: []
nameOverride: ""
fullnameOverride: "bi"
# fr/bi
appType: bi
ingress:
enabled: false
className: ""
jvmOpts:
xmx: 8g
extraEnvs:
- name: BI_CLUSTER_CONTAINER
value: bi
persistence:
#
logs:
filebeat:
sidecar: false
image: harbor.flexium.com.tw/flexium-bi/filebeat
imageTag: v20.0.6-8.3.3
elasticSearch:
host: elasticsearch-master-headless
port: 9200
username: elastic
password: elastic
protocol: http
data:
volumeClaimTemplates:
enabled: false
volumeClaim:
# apply if volumeClaimTemplates.enabled is false
enabled: true
claimName: bi-pvc
shared:
enabled: true
claimName: bi-pvc
resources:
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
- bi-engine
path: /opt/yaml/finebi-dev/charts/bi-engine
先建pvc
kubectl apply -f bi-engine_pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: polars-pvc
namespace: finebi-dev
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 200Gi #注意需求
storageClassName: nfs-client
helm install bi-engine -n finebi-dev -f myvalues.yaml . (建立)
helm upgrade bi-engine -n finebi-dev -f myvalues.yaml . (更新)
helm delete bi-engine -n finebi-dev (刪除)
image: harbor.flexium.com.tw/flexium-bi/biengine
imageTag: 3.0final
imagePullPolicy: "IfNotPresent"
imagePullSecrets: []
logs:
filebeat:
sidecar: true
image: harbor.flexium.com.tw/flexium-bi/filebeat
imageTag: v20.0.6-8.3.3
resources:
limits:
cpu: '1'
memory: 200Mi
requests:
cpu: 100m
memory: 100Mi
elasticSearch:
host: elasticsearch-master-headless
port: 9200
username: elastic
password: elastic
protocol: http
persistence:
data:
volumeClaimTemplates:
enabled: true
storageClass: "nfs-client"
storage: 30Gi
volumeClaim:
enabled: false
claimName: polars-pvc
share:
enabled: true
claimName: polars-pvc
opsUrl: "http://ops-headless:8080/ops/decision"
master:
env:
MASTER_EXTRA_VM_OPTIONS: ''
resources:
limits:
cpu: '8'
memory: 16Gi
requests:
cpu: '8'
memory: 16Gi
worker:
env:
WORKER_EXTRA_VM_OPTIONS: '-Xmx11g -XX:MaxDirectMemorySize=3g -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m'
resources:
limits:
cpu: '8'
memory: 16Gi
requests:
cpu: '8'
memory: 16Gi
- ops
path: /opt/yaml/finebi-dev/charts/ops
先建pvc
kubectl apply -f ops_pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ops-data-ops-0
namespace: finebi-dev
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
storageClassName: nfs-client
helm install ops -n finebi-dev -f myvalues.yaml . (建立)
helm upgrade ops -n finebi-dev -f myvalues.yaml . (更新)
helm delete ops -n finebi-dev (刪除)
image: harbor.flexium.com.tw/flexium-bi/ops
imageTag: v1.13.0.25-102580
imagePullSecrets: []
persistence:
storageClass: "nfs-client"
size: 100Gi
elasticSearch:
enabled: true
host: elasticsearch-master-headless
port: 9200
username: elastic
password: elastic
ingress:
enabled: false
className: "nginx"
resources:
limits:
cpu: 2000m
memory: 4Gi
requests:
cpu: 2000m
memory: 3Gi
- 建立bi nodeport (frbi (BI))
path: /opt/yaml/finebi-dev/charts/frbi/
kubectl apply -f bi_nodeport.yaml (此檔案注意nodeport)
apiVersion: v1
kind: Service
metadata:
namespace: finebi-dev
name: bi-service-nodeport
spec:
type: NodePort
ports:
- port: 8080
targetPort: 8080
protocol: TCP
name: port1
nodePort: 32081
selector:
app.kubernetes.io/instance: bi
app.kubernetes.io/name: fr
redis 連接
redis-master.finebi-dev.svc.cluster.local (服務名稱).(namespace).svc.cluster.local
port: 6379 password: redis
mysql連接
mysql.finebi-dev.svc.cluster.local
資料庫名稱:finedb 帳號:root 密碼:mysql
- 檔案伺服器設定
- 設定下面
共享外部目錄
/data/webroot/WEB-INF
- 設定bi ConfigMap
進入fr容器
kubectl exec -it bi-0 -c fr -n=finebi-dev -- /bin/bash
顯示db.properties
cat /usr/local/tomcat/webapps/webroot/WEB-INF/config/db.properties
root@bi-0:/# cat /usr/local/tomcat/webapps/webroot/WEB-INF/config/db.properties
#Hibernate configure properties
#Fri Dec 29 12:14:30 CST 2023
hibernate.connection.password=AYksTpWVrGatDWJ4co1Jj2HvL1+BakgDH6HZv1Pya8N67ohG5oolTMsjogpUsQlKVMx7zUybxkEJ\nnIsejESoQX+GWgcTx2tjhZwKgHtZZ8NK+UKyClhXXfq8+SClhsp+Oa19uKINPqzSTfPpjfWpYxUO\nGshNvVO/b28hrcxjx1+CVqEjd6wzupEv6fvvW1Ee2eqF63Dz8eX3SHc86ZlWdQ3CyTzwuPGW6kGW\nU/LAUgypkAEAGdDql20pqWziTkDYZ3bXWUHkLCjuoi/6/wFj91Tc5+o4Yd8D4VRn8l3b3rDJl0gE\nrne/OEvecTHY4oP1OeNV8JknFjIdrHpGVC35JA\=\=
hibernate.maxWait=500000
hibernate.minEvictableIdleTimeMillis=1800000
hibernate.hbm2ddl.auto=update
hibernate.initialSize=0
hibernate.default_schema=
hibernate.validationQuery=
hibernate.testWhileIdle=false
hibernate.connection.username=root
hibernate.connection.isolation=4
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.timeBetweenEvictionRunsMillis=60000
hibernate.connection.provider_class=com.fr.config.FineDBDruidConnectionProvider
hibernate.testOnBorrow=true
hibernate.testOnReturn=false
hibernate.dialect=com.fr.third.org.hibernate.dialect.MySQL5Dialect
hibernate.numTestsPerEvictionRun=3
hibernate.connection.url=jdbc\:mysql\://mysql.finebi-dev.svc.cluster.local\:3306/finedb?useUnicode\=true&characterEncoding\=UTF-8
hibernate.maxActive=50
hibernate.minIdle=0
之後上面顯示的加入bi的configmap
kubectl edit configmap bi -n=finebi-dev (新增橘色跟紅色,紅色跟上面紅色一樣)
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
data:
db.properties: |
hibernate.connection.password=AYksTpWVrGatDWJ4co1Jj2HvL1+BakgDH6HZv1Pya8N67ohG5oolTMsjogpUsQlKVMx7zUybxkEJ\nnIsejESoQX+GWgcTx2tjhZwKgHtZZ8NK+UKyClhXXfq8+SClhsp+Oa19uKINPqzSTfPpjfWpYxUO\nGshNvVO/b28hrcxjx1+CVqEjd6wzupEv6fvvW1Ee2eqF63Dz8eX3SHc86ZlWdQ3CyTzwuPGW6kGW\nU/LAUgypkAEAGdDql20pqWziTkDYZ3bXWUHkLCjuoi/6/wFj91Tc5+o4Yd8D4VRn8l3b3rDJl0gE\nrne/OEvecTHY4oP1OeNV8JknFjIdrHpGVC35JA\=\=
hibernate.maxWait=500000
hibernate.minEvictableIdleTimeMillis=1800000
hibernate.hbm2ddl.auto=update
hibernate.initialSize=0
hibernate.default_schema=
hibernate.validationQuery=
hibernate.testWhileIdle=false
hibernate.connection.username=root
hibernate.connection.isolation=4
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.timeBetweenEvictionRunsMillis=60000
hibernate.connection.provider_class=com.fr.config.FineDBDruidConnectionProvider
hibernate.testOnBorrow=true
hibernate.testOnReturn=false
hibernate.dialect=com.fr.third.org.hibernate.dialect.MySQL5Dialect
hibernate.numTestsPerEvictionRun=3
hibernate.connection.url=jdbc\:mysql\://mysql.finebi-dev.svc.cluster.local\:3306/finedb?useUnicode\=true&characterEncoding\=UTF-8
hibernate.maxActive=50
hibernate.minIdle=0
修改configmap后,1.先在BI网页点击开启集群
2.刪除bi-0讓configmap的設定可以重新套用
kubectl delete pod bi-0 -n=finebi-dev (重要)
3. BI web页面打开有此集群信息就是正常的
- OPS接入(健康巡檢)
API密鑰隨意輸入:Flex6269
- OPS接入(維運平台)
設定nodeport
kubectl apply -f opsservice.yaml (此檔案注意nodeport)
# service.yaml nodeport
apiVersion: v1
kind: Service
metadata:
name: ops
namespace: "finebi-dev"
labels:
helm.sh/chart: ops-1
app.kubernetes.io/name: ops
app.kubernetes.io/instance: ops
app.kubernetes.io/version: "1.6.0"
app.kubernetes.io/managed-by: Helm
spec:
type: NodePort
ports:
- port: 8080
targetPort: 8080
nodePort: 32082 # 可以为 NodePort 指定 30080
protocol: TCP
name: http
selector:
app.kubernetes.io/name: ops
app.kubernetes.io/instance: ops
登入 http://10.1.6.224:32082/ops/decision/
設定帳密: admin Flex@6269
設定接入專案
專案伺服器地址 http://10.1.6.224:32081/webroot/decision
維運API鍵 Flex6269
标签:hibernate,yaml,BI,dev,bi,finebi,mysql,迁移,K8S From: https://blog.51cto.com/u_13963804/9139720