Skip to content

Commit

Permalink
docker
Browse files Browse the repository at this point in the history
  • Loading branch information
deipss committed Feb 15, 2024
1 parent 7d75283 commit 8a0200e
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 17 deletions.
3 changes: 1 addition & 2 deletions docs/Database/ElasticSearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ nav_order: 2
# 1. ES集群常用命令

```shell
#获取整个 cluster 的状态
#获取整个 cluster 的状态
GET _cluster/state
#集群健康状态 API
GET _cluster/health?pretty
Expand All @@ -22,7 +22,6 @@ GET _cat/master?pretty&v
GET _stats?pretty
#节点状态信息统计 API
GET _nodes/stats?pretty

```

# 2. 索引常用命令
Expand Down
2 changes: 1 addition & 1 deletion docs/Database/ElasticSearch实战手册阅读.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ nav_order: 6
- 默认情况下,Elasticsearch 文档每个字段都会被索引。如果某些字段不需要支持查询,可以在映射中配置 "index": false
,减少存储空间占用,并且提升写入速度。

# translog
# 3. translog

- https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-translog.html

Expand Down
2 changes: 1 addition & 1 deletion docs/Database/Redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ redis启动时会加载这个.aof文件重新构建数据。为避免.aof文件
## 3.1. redis中的key

- keys * :列出当前库中所有的key
- exists 为:判断key_name是滞存在
- exists 为:判断key_name是否存在
- expire key_name [s]:给key_name设置过期时间
- ttl key_name:查看还有多少秒过期 -1表示永不过期、-2表示已过期、0表示正在计时
- type key_name:查看key_name的类型
Expand Down
6 changes: 3 additions & 3 deletions docs/Java/Jvm垃圾回收.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ parent: Java
- 2 类的加载器被回收
- 3 Class对象没有被任何数据引用

每个jps文件都有一个唯一的类加载器。
每个jsp文件都有一个唯一的类加载器

# 2. 堆

Expand Down Expand Up @@ -119,7 +119,7 @@ From中剩下的数据,就是要被清除的
- 默认分为2048个区域


# jvm GC 配置
# 6. jvm GC 配置

> -server -Xmx13G -Xms13G -Xss4M -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:+UseStringDeduplication
-XX:+DisableExplicitGC -XX:+ScavengeBeforeFullGC -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCDetails
Expand Down Expand Up @@ -150,4 +150,4 @@ From中剩下的数据,就是要被清除的
- XX:-OmitStackTraceInFastThrow
- Dproject.name=good-test-man
- DappName=good-test-man
- agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
- agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
12 changes: 5 additions & 7 deletions docs/Java/SPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ parent: Java

---

# maven库
# 1. maven库

```xml
使用这个库,加上注解的类,编译后,在META-INFO目录下,生成配置文件

```xml
<dependency>
<groupId>org.kohsuke.metainf-services</groupId>
<artifactId>metainf-services</artifactId>
<version>${metainf-services.version}</version>
<scope>compile</scope>
</dependency>

```

> @MetaInfServices(InspectorPlugin.class)

# java加载SPI
# 2. java加载SPI

Java的SPI机制就是指:针对一个接口,我们需要加载外部对该接口的实现,
只要约定好将该实现配置在classPath路径下的META-INF/services文件夹的文件,使用方就可以自动加载文件里所定义的类。
Expand Down Expand Up @@ -80,6 +80,4 @@ private List<InspectorPlugin> loadInspectorPluginBySPI( ClassLoader classLoader)
}


```


```
7 changes: 5 additions & 2 deletions docs/Java/ThreadLocal.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public void set(T value) {
}
```

### 1.1.2. 内部维护一个static class ThreadLocalMap 这样一个静态内部类,而这个ThreadLocalMap类中,还有一个静态内部类
### 1.1.2. 原理

内部维护一个`static class ThreadLocalMap` 这样一个静态内部类,而这个ThreadLocalMap类中,还有一个静态内部类

```shell
static class Entry extends WeakReference<ThreadLocal<?>> {
Expand All @@ -40,7 +42,8 @@ static class Entry extends WeakReference<ThreadLocal<?>> {
private Entry[] table;
```

### 1.1.3. ThreadLocalMap中的set()方法,在出现key为null的情况下,会调用replaceStaleEntry()方法,将这个对象替换掉
### 1.1.3. set
ThreadLocalMap中的set()方法,在出现key为null的情况下,会调用replaceStaleEntry()方法,将这个对象替换掉

```shell
private void set(ThreadLocal<?> key, Object value) {
Expand Down
2 changes: 1 addition & 1 deletion docs/Java/ThreadPool.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ import java.util.Objects;
import java.util.concurrent.*;

/**
* @author :xuelin.hxl
* @description :ThreadLocalDemo
* @data :2021/7/23 下午7:38
*/
Expand Down Expand Up @@ -226,6 +225,7 @@ Integer.SIZE - 3) | 0 = -536870912`,是一个很小的负数。<br />之所以


# 4. Java线程

线程库就是为开发人员提供创建和管理线程的一套 API。不同操作系统是有不同的线程库
- 1)POSIX Pthreads:可以作为用户或内核库提供,作为 POSIX 标准的扩展
- 2)Win32 线程:用于 Window 操作系统的内核级线程库
Expand Down
18 changes: 18 additions & 0 deletions docs/command/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,24 @@ docker pull bitnami/zookeeper:latest
docker run --name=main-zk --restart=always -e ALLOW_ANONYMOUS_LOGIN=yes -p 2181:2181 bitnami/zookeeper:latest
```
## dubbo admin
- git文档地址 https://github.com/apache/dubbo-admin?tab=readme-ov-file#12-run-with-docker
```shell
# 创建目录和文件
mkdir /docker/dubbo-admin/
vim application.properties
# 在文件中添加配置文件
admin.registry.address=zookeeper://127.0.0.1:2181
admin.config-center=zookeeper://127.0.0.1:2181
admin.root.user.name=root
admin.root.user.password=root
admin.check.signSecret=86295dd0c4ef69a1036b0b0c15158d77
# 启动容器
docker run -itd --net=host --name dubbo-admin -v /docker/dubbo-admin/:/config apache/dubbo-admin --restart=always
```
# 3. Docker file
Docker 构建的早期需要 DockerFile,就是 Docker 构建了一个命令文件。Docker基于这个文件构建镜像并且打包镜像。
Expand Down

0 comments on commit 8a0200e

Please sign in to comment.