filebeat按docker容器名创建不同的索引
直接看配置: processors: - add_cloud_metadata: ~ - add_docker_metadata: ~ - drop_event: when.or: - equals: container.name: "filebeat" - equals: container.name: "kibana" - equals: container.name: "es" - equals: container.name: "redis" - equals: container.name: "elastalert" - equals: container.name: "mysql" - equals: ...
traefik负载均衡/滚动升级
docker-compose.yml version : '3' services: reverse-proxy: # The official v2 Traefik docker image image: traefik:v2.10 # Enables the web UI and tells Traefik to listen to docker command: # insecure - --api.insecure=true - --providers.docker # Create an entrypoint "http" listening on port 80 - --entrypoints.http.address=:80 # Create an entrypoint "https" listening on port 443 - --entrypoints.https.add...
定时备份docker中的mysql
docker exec mysql /bin/bash -c 'mysqldump -uroot -pPASSWORD --databases confluence ' >/mnt/home/brucehe/confluence/backup/confluence_`date +%F`.sql; gzip /mnt/home/brucehe/confluence/backup/confluence_`date +%F`.sql; crontab表达试: sudo crontab -e 0 1 * * * backupmysql.sh #每天晚上1点执行 注意:一定要删除命令(docker exec -it)中的 -it, 因为-it会开启新的终端,而cron表达试及service等不支持交互试的命令执行。
使用traefik做为docker网关(负载均衡/滚动更新)
安装docker: yum install docker-ce 创建docker-compose.yml: version: '3' services: traefik: # The official v2 Traefik docker image image: traefik:v2.10 # Enables the web UI and tells Traefik to listen to docker command: --api.insecure=true --providers.docker ports: # The HTTP port - "80:80" # The Web UI (enabled by --api.insecure=true) - "8080:8080" volumes: # So that Traefik can listen to the Docker even...
部署docker+k3s+rancher2
一、先安装docker curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun 二、安装rancher2 docker run -d --privileged --restart=unless-stopped -p 8080:80 -p 8443:443 -v /var/lib/rancher:/var/lib/rancher rancher/rancher:latest 访问dashboar: https://ip:8443 忽略证书错误 二、安装k3s curl -sfL https://docs.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn INSTALL_K3S_EXEC="--docker" sh -
linux使用docker-compose安装和破解confluence 8.0.2
创建confluence部署目录confluence cd / mkdir -p /data/confluence /data/mysql 安装MySQL 8.0 confluence可以使用MySQL5.x、8.x,postgres等数据库,本次安装使用MySQL8.0. 编写MySQL的docker-compose 进入/data/mysql目录下,创建docker-compose-mysql.yml文件 vi /data/mysql/docker-compose-mysql.yml version: '3.2' services: mysql: container_name: mysql environment: MYSQL_ROOT_PASSWORD: "mysql" image: "mysql:latest" restart: al...
es+filebeat+elastalert2实现异常邮件提醒
以下安装都使用docker-compose,docker及K8s安装原理一样 ES安装: es: container_name: es image: docker.elastic.co/elasticsearch/elasticsearch:7.2.0 ports: - "9200:9200" environment: - node.name=es - http.host=0.0.0.0 - transport.host=127.0.0.1 - "ES_JAVA_OPTS=-Xms512m -Xmx512m" - bootstrap.memory_lock=true - discovery.type=single-node - xpack.security.enabled=true - xpack.security.http.ssl.enab...
docker安装neo4j
docker run -d --name neo4j \ -p 7474:7474 \ -v /mnt/home/sunyu/danone/neo4j-community-4.4.8/data:/data \ -v /mnt/home/sunyu/danone/neo4j-community-4.4.8/logs:/logs \ -v /mnt/home/sunyu/danone/neo4j-community-4.4.8/conf \ –env NEO4J_AUTH=neo4j/danone-neo4j \ neo4j:4.4.8-community
jenkinsfile
1 pipeline { agent any environment{ def build_env="dev" def mailFrom="xxxxx@163.com" def mailRecipients="xxxxx@xxx.com" } stages { stage('Pull Code') { steps { // checkout([$class: 'GitSCM',branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: '511c4c13-45bc-4c9f-ba38-3b37d05e4a9a', url: 'git@github.com:xxxx/CICD.git']]]) } ...
dial unix /var/run/docker.sock: connect: permission denied
今天刚遇到的一个问题,使用非root用户时操作docker提示无权限,在查阅了一些文章之后自己又摸索出了一些更方便的方法,顺手记录下来。 一、问题发现 二、使用root用户进行操作 1. 临时使用root权限 2. 切换至root用户 三、授予docker.sock操作权限 1. 单次授予,重启后失效 2. 永久授予 2.1. 将当前用户加入docker组 2.2. 授予普通用户权限 一、问题发现 根据报错信息dial unix /var/run/docker.sock: connect: permission denied,可以看出,是因为当前用户对docker使用的unix domain socket文件/var/run/docker...