跳至主要內容
常用的js代码片段
function getSelectedText() {
	if (window.getSelection) { // This technique is the most likely to be standardized.         
		// getSelection() returns a Selection object, which we do not document.        
		return window.getSelection()
			.toString();
	} else if (document.getSelection) {
		// This is an older, simpler technique that returns a string        
		return document.getSelection();
	} else if (document.selection) {
		// This is the IE-specific technique.         
		// We do not document the IE selection property or TextRange objects.         
		return document.selection.createRange()
			.text;
	}
}

爱喝水的木子...大约 2 分钟codejavascriptcode
hertzbeat
#监控
docker run -d -p 1157:1157 -p 1158:1158 -e LANG=zh_CN.UTF-8 -e TZ=Asia/Shanghai -v /root/hertzbeat//data:/opt/hertzbeat/data -v /root/hertzbeat/logs:/opt/hertzbeat/logs -v /r

oot/hertzbeat/application.yml:/opt/hertzbeat/config/application.yml -v /root/hertzbeat/sureness.yml:/opt/hertzbeat/config/sureness.yml --restart=always --name hertzbeat tancloud/hertzbeat

# 采集器
docker run -d -e IDENTITY=custom-collector-name -e MODE=public -e MANAGER_HOST=127.0.0.1 -e MANAGER_PORT=1158 --name hertzbeat-collector tancloud/hertzbeat-collector

爱喝水的木子...小于 1 分钟dockerdocker
docker安装es及kibana
os:ubuntu22.04-lts

安装docker

sudo apt install docker.io
# 配置docker加速
{
    "registry-mirrors": [
        "https://dockerproxy.com",
        "https://mirror.baidubce.com",
        "https://docker.m.daocloud.io",
        "https://docker.nju.edu.cn",
        "https://docker.mirrors.sjtug.sjtu.edu.cn",
        "https://registry.docker-cn.com",
        "https://mirror.ccs.tencentyun.com",
        "http://hub-mirror.c.163.com"
    ]
}

爱喝水的木子...大约 1 分钟codeelasticsearchkibana
docker-hadoop

docker-compose.yml

services:
  namenode:
    image: bde2020/hadoop-namenode:2.0.0-hadoop3.2.1-java8
    container_name: namenode
    ports:
      - 9870:9870
      - 9000:9000
    volumes:
      - ./hadoop/dfs/name:/hadoop/dfs/name
      - ./input:/input
    environment:
      - CLUSTER_NAME=test
    env_file:
      - ./hadoop.env

  datanode:
    image: bde2020/hadoop-datanode:2.0.0-hadoop3.2.1-java8
    container_name: datanode
    depends_on:
      - namenode
    volumes:
      - ./hadoop/dfs/data:/hadoop/dfs/data
    environment:
      SERVICE_PRECONDITION: "namenode:9870"
    env_file:
      - ./hadoop.env
  
  resourcemanager:
    image: bde2020/hadoop-resourcemanager:2.0.0-hadoop3.2.1-java8
    container_name: resourcemanager
    environment:
      SERVICE_PRECONDITION: "namenode:9000 namenode:9870 datanode:9864"
    env_file:
      - ./hadoop.env

  nodemanager1:
    image: bde2020/hadoop-nodemanager:2.0.0-hadoop3.2.1-java8
    container_name: nodemanager
    environment:
      SERVICE_PRECONDITION: "namenode:9000 namenode:9870 datanode:9864 resourcemanager:8088"
    env_file:
      - ./hadoop.env
  
  historyserver:
    image: bde2020/hadoop-historyserver:2.0.0-hadoop3.2.1-java8
    container_name: historyserver
    environment:
      SERVICE_PRECONDITION: "namenode:9000 namenode:9870 datanode:9864 resourcemanager:8088"
    volumes:
      - ./hadoop/yarn/timeline:/hadoop/yarn/timeline
    env_file:
      - ./hadoop.env

爱喝水的木子...小于 1 分钟devdockerhadoopdev
简单搭建mongodb环境

拉镜像

docker pull mongo:4.4-rc

启动

windows指定数据存放路径
docker run --rm --name mongo -d -p 27017:27017 -v D:\Mongodb\master\data:/data/db mongo:4.4-rc

爱喝水的木子...小于 1 分钟dockermongodbdocker
简单搭建neo4j环境

dockerfile.yaml

# docker-compose.yaml
version: "3"
services:
  neo4j:
    image: neo4j
    volumes:

      - ./db/neo4j/conf:/var/lib/neo4j/conf:rw
      - ./db/neo4j/mnt:/var/lib/neo4j/import:rw
      - ./db/neo4j/plugins:/plugins:rw
      - ./db/neo4j/data:/data:rw
      - ./db/neo4j/logs:/var/lib/neo4j/logs:rw

    restart: always
    ports:

      - 7474:7474
      - 7687:7687

    environment:

      - NEO4J_dbms_memory_heap_maxSize=4G
      - NEO4J_AUTH=neo4j/123456 #修改默认用户密码


爱喝水的木子...小于 1 分钟dockerneo4jdocker
docker配置加速
{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "registry-mirrors": [
    "https://registry.hub.docker.com",
    "https://docker.mirrors.ustc.edu.cn",
    "https://mirror.baidubce.com",
    "https://docker.mirrors.sjtug.sjtu.edu.cn",
    "https://docker.nju.edu.cn"
  ]
}

爱喝水的木子...小于 1 分钟dockerwindowsdockermongo环境