ACM题

举报
zxcasdqwe987 发表于 2023/12/16 00:05:48 2023/12/16
【摘要】 RocketChat# yum gcc-c++# yum groupinstall 'Development Tools'# tar -zxf  -C /tmp# cd /tmp/bundle/programs/server# npm install# mv /tmp/bundle /opt/Rocket.Chat# cd /opt/Rocket.Chat/# useradd -M rock...

RocketChat

# yum gcc-c++
# yum groupinstall 'Development Tools'
# tar -zxf  -C /tmp
# cd /tmp/bundle/programs/server
# npm install
# mv /tmp/bundle /opt/Rocket.Chat
# cd /opt/Rocket.Chat/
# useradd -M rocketchat
# usermod -L rocketchat
# chown -R rocketchat:rocketchat /opt/Rocket.Chat
# vi /lib/systemd/system/rocketchat.service
[Unit]
Description=The Rocket.Chat server running on Linux
After=network.target remote-fs.target nss-lookup.target nginx.service mongod.service
[Service]
ExecStart=/usr/local/nodejs/node-v12.16.1-linux-x64/bin/node /opt/Rocket.Chat/main.js
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=rocketchat
User=rocketchat
Environment=ROOT_URL=http://localhost:3000
Environment=PORT=3000
Environment=MONGO_URL=mongodb://172.16.2.76:27017/rocketchat?replicaSet=rs
Environment=MONGO_OPLOG_URL=mongodb://172.16.2.76:27017/local?replicaSet=rs
[Install]
WantedBy=multi-user.target

# systemctl enable rocketchat
# systemctl start rocketchat
# systemctl status rocketchat
● rocketchat.service - The Rocket.Chat server running on Linux
   Loaded: loaded (/usr/lib/systemd/system/rocketchat.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2022-09-08 15:14:40 CST; 6s ago
 Main PID: 9168 (node)
   CGroup: /system.slice/rocketchat.service
           └─9168 /usr/local/nodejs/node-v12.16.1-linux-x64/bin/node /opt/Rocket.Chat/main.js

Sep 08 15:14:40 chinaskill-node-1 systemd[1]: Started The Rocket.Chat server running on Linux.

# mongo
rs:PRIMARY> show dbs
admin       0.000GB
config      0.000GB
local       0.001GB
rocketchat  0.002GB
rs:PRIMARY> use rocketchat
switched to db rocketchat
rs:PRIMARY> show collections
……

# mongo
rs:SECONDARY> db.getMongo().setSlaveOk()
rs:SECONDARY> show dbs
admin       0.000GB
config      0.000GB
local       0.001GB
rocketchat  0.002GB
rs:SECONDARY> exit
bye

http://121.37.137.27:3000

ELK

echo "vm.max_map_count=262144" >> /etc/sysctl.conf
sysctl -p
docker load -i sebp_elk-7.16.3.tar
docker run -d --name elk --restart always -p 5601:5601 -p 9200:9200 -p 5044:5044 -e TZ=Asia/Shanghai sebp/elk:7.16.3
docker exec -it elk bash
/opt/logstash/bin/logstash --path.data /tmp/logstash/data -e 'input { stdin { } } output { elasticsearch { hosts => ["localhost"] } }'
this is a dummy entry
Ctrl+C
http://192.168.100.79:9200/_search?pretty&size=1000
http://192.168.100.79:5601

rpm -ivh filebeat-7.16.3-x86_64.rpm
mv /etc/filebeat/filebeat.yml /etc/filebeat/filebeat.yml.bak
rm -f /etc/filebeat/filebeat.yml
vi /etc/filebeat/filebeat.yml
output:
  logstash:
    enabled: true
    hosts:
      - 192.168.100.79:5044
    timeout: 15
    ssl:
      certificate_authorities:
          - /etc/pki/tls/certs/logstash-beats.crt

filebeat:
  inputs:
    -
      paths:
        - /var/log/messages
      document_type: syslog

vi /etc/pki/tls/certs/logstash-beats.crt

systemctl start filebeat

word上传

helm repo add chartmuseum http://10.106.178.78:8080
[root@master ~]# helm repo list
NAME            URL                      
chartmuseum     http://10.106.178.78:8080

[root@master ~]# curl --data-binary "@wordpress-13.0.23.tgz" http://10.106.178.78:8080/api/charts
{"saved":true}
[root@master ~]# curl http://10.106.178.78:8080/api/charts
{"wordpress":[{"name":"wordpress","home":"https://github.com/bitnami/charts/tree/master/bitnami/wordpress","sources":["https://github.com/bitnami/bitnami-docker-wordpress","https://wordpress.org/"],"version":"13.0.23","description":"WordPress is the world's most popular blogging and content management platform. Powerful yet simple, everyone from students to global corporations use it to build beautiful, functional websites.","keywords":["application","blog","cms","http","php","web","wordpress"],"maintainers":[{"name":"Bitnami","email":"containers@bitnami.com"}],"icon":"https://bitnami.com/assets/stacks/wordpress/img/wordpress-stack-220x234.png","apiVersion":"v2","appVersion":"5.9.2","annotations":{"category":"CMS"},"dependencies":[{"name":"memcached","version":"6.x.x","repository":"https://charts.bitnami.com/bitnami","condition":"memcached.enabled"},{"name":"mariadb","version":"10.x.x","repository":"https://charts.bitnami.com/bitnami","condition":"mariadb.enabled"},{"name":"common","version":"1.x.x","repository":"https://charts.bitnami.com/bitnami","tags":["bitnami-common"]}],"urls":["charts/wordpress-13.0.23.tgz"],"created":"2022-09-11T10:00:20.391057325Z","digest":"a4b42912909775eec74ec0cab4c021692bbf8234ead837f2cae3824f0762b228"}]}

helm repo update
helm install wordpress chartmuseum/wordpress

CH

mkdir -p /data/charts
chmod -R 777 /data/charts/

kubectl create ns chartmuseum
vi chartmuseum.yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: chartmuseum
  name: chartmuseum
  namespace: chartmuseum
spec:
  replicas: 1
  selector:
    matchLabels:
      app: chartmuseum
  template:
    metadata:
      labels:
        app: chartmuseum
    spec:
      containers:
      - image: chartmuseum/chartmuseum:latest
        imagePullPolicy: IfNotPresent
        name: chartmuseum
        ports:
        - containerPort: 8080
          protocol: TCP
        env:
        - name: DEBUG
          value: "1"
        - name: STORAGE
          value: local
        - name: STORAGE_LOCAL_ROOTDIR
          value: /charts
        volumeMounts:
        - mountPath: /charts
          name: charts-volume
      volumes:
      - name: charts-volume
        hostPath:
          path: /data/charts
          type: Directory
---
apiVersion: v1
kind: Service
metadata:
  name: chartmuseum
  namespace: chartmuseum
spec:
  ports:
  - port: 8080
    protocol: TCP
    targetPort: 8080
  selector:
    app: chartmuseum

kubectl apply -f chartmuseum.yaml

kubectl get svc -n chartmuseum
curl 10.106.178.78:8080

WODB

tar -zxf wordpress-13.0.23.tgz
cd wordpress
vi values.yaml
service:
  ## @param service.type WordPress service type
  ##
  type: NodePort

readinessProbe:
  enabled: false

  readinessProbe:
    enabled: false

查看persistence:配置

mariadb:
    persistence:
      enabled: false

docker load -i bitnami_wordpress-5.9.2-debian-10-r0.tar
docker load -i bitnami_mariadb-10.5.15-debian-10-r11.tar
mkdir /wp
chmod 777 /wp

vi pv.yaml
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-wp
  labels:
    name: pv-wp
spec:
  capacity:
    storage: 10Gi
  accessModes:
  - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  hostPath:
    path: /wp

kubectl apply -f pv.yaml

helm install wordpress .

Ymdb

kubectl create ns mariadb

mv mariadb mariadb10
tar -zxf mariadb-7.3.14.tgz
cd mariadb
vi values.yaml
service:
  ## Kubernetes service type, ClusterIP and NodePort are supported at present
  type: NodePort

db:
  ## MariaDB username and password
  ## ref: https://github.com/bitnami/bitnami-docker-mariadb#creating-a-database-user-on-first-run
  ##
  user: "chinaskillroot"
  password: "chinaskillpassword"
  ## Database to create
  ## ref: https://github.com/bitnami/bitnami-docker-mariadb#creating-a-database-on-first-run
  ##
  name: chinaskill

  persistence:
    ## If true, use a Persistent Volume Claim, If false, use emptyDir
    ##
    enabled: false

  persistence:
    ## If true, use a Persistent Volume Claim, If false, use emptyDir
    ##
    enabled: false

helm install -n mariadb mariadb .
helm list -A

BMDB

tar -zxf mariadb-7.3.14.tgz
cd mariadb
vi values.yaml
service:
  ## Kubernetes service type, ClusterIP and NodePort are supported at present
  type: NodePort

  nodePort:
    master: 32334

rootUser:
  ## MariaDB admin password
  ## ref: https://github.com/bitnami/bitnami-docker-mariadb#setting-the-root-password-on-first-run
  ##
  password: "chinaskill"

  persistence:
    ## If true, use a Persistent Volume Claim, If false, use emptyDir
    ##
    enabled: false

  persistence:
    ## If true, use a Persistent Volume Claim, If false, use emptyDir
    ##
    enabled: false

docker load -i bitnami_mariadb-10.3.22-debian-10-r27.tar

helm install mariadb .

WMYCHAT

tar -zxf mychart-0.1.0.tgz
cd mychart
vi values.yaml
service:
  type: NodePort

helm package .

helm install nginx mychart-0.1.0.tgz
helm list
helm uninstall nginx

K8S

下载kubectl配置文件
mkdir -p $HOME/.kube
将kubeconfig.json复制到node节点
mv -f kubeconfig.json $HOME/.kube/config
kubectl config use-context internal
kubectl cluster-info
kubectl get nodes

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。