学习笔记

162 阅读4分钟

sentinel

java -Dserver.port=8080 -Dcsp.sentinel.dashboard.server=localhost:8080 -Dproject.name=sentinel-dashboard -jar sentinel-dashboard.jar

用户名:sentinel 密码:sentinel

-Dcsp.sentinel.dashboard.server=consoleIp:port

nacos

startup.cmd -m standalone

skywalking

-javaagent:D:\demo\skywalking\skywalking-agent\skywalking-agent.jar SW_AGENT_NAME=demo-application-springmvc;SW_AGENT_COLLECTOR_BACKEND_SERVICES=127.0.0.1:11800

es集群

http://localhost:9201/_cat/nodes?pretty

http://localhost:9201/_cluster/health

阅读源码技巧

更进一步的,在学会使用之后,去阅读这些框架或软件的源码是必不可少的一步。阅读源码的一种比较好的步骤如下:

  1. 先阅读架构文档
  2. 根据架构,将源码文件以模块(或上下层级)分类
  3. 从最独立(依赖性最小)的模块代码读起
  4. 阅读该模块功能文档
  5. 阅读该模块源代码
  6. 一边阅读一边整理「调用关系表」
  7. goto 3

docker 部署 dubbo-admin

  1. 启动zookeeper

docker run --name zookeeper -p 2181:2181 -d zookeeper

  1. 启动dubbo-admin

docker run -p 8888:8080 -e admin.registry.address=zookeeper://192.168.10.7:2181 -e admin.config-center=zookeeper://192.168.10.7:2181 -e admin.metadata-report.address=zookeeper://192.168.10.7:2181 -d apache/dubbo-admin

  1. 登录 http://localhost:8888/ 用户名:root 密码:root

windows 端口占用查询

  1. 查看端口占用进程

netstat -ano |findstr 10911

  1. 查看进程

tasklist|findstr 15828

  1. 杀进程

taskkill /T /F /PID 9088

docker

docker网络信息

docker inspect 容器名

安装

1、安装hyper-v,保存为bat,以管理员身份运行

pushd "%~dp0"

dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt

for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"

del hyper-v.txt

Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL

2、安装 Docker Desktop for Windows,地址:docs.docker.com/desktop/win…
3、升级wsl

redis

cluster nodes

e219949275fc9ed72bd40a646b72f4f880fb372b 172.38.0.14:6379@16379 slave 70542e441c1697ff48e92c64be7538c30f2c61b6 1654908166392 1654908165174 3 connected
e7be78a9f4ee3bed390d9cf6b751e91b10f098a6 172.38.0.11:6379@16379 myself,master - 0 1654908165000 1 connected 0-5460
bc387932f0234cf09f16acfbbb5a3c53fce73969 172.38.0.15:6379@16379 slave e7be78a9f4ee3bed390d9cf6b751e91b10f098a6 0 1654908167301 1 connected
0cef212c0a27460bcf9a929eae8778f45faddc09 172.38.0.12:6379@16379 master - 0 1654908165389 2 connected 5461-10922
7aec61f4794d581da8d777f0d1024029eab40f2f 172.38.0.16:6379@16379 slave 0cef212c0a27460bcf9a929eae8778f45faddc09 0 1654908165389 2 connected
70542e441c1697ff48e92c64be7538c30f2c61b6 172.38.0.13:6379@16379 master - 0 1654908164749 3 connected 10923-16383
vars currentEpoch 6 lastVoteEpoch 0

cluster info

cluster_state:ok
cluster_slots_assigned:16384
cluster_slots_ok:16384
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:6
cluster_size:3
cluster_current_epoch:6
cluster_my_epoch:3
cluster_stats_messages_ping_sent:5774
cluster_stats_messages_pong_sent:5736
cluster_stats_messages_meet_sent:1
cluster_stats_messages_sent:11511
cluster_stats_messages_ping_received:5736
cluster_stats_messages_pong_received:5774
cluster_stats_messages_received:11510
total_cluster_links_buffer_limit_exceeded:0

redis命令

redis-cli.exe -p 6380
cluster nodes 节点信息
cluster meet 127.0.0.1 6381 加入集群
set hello redis 
cluster info 集群信息
redis-cli.exe -h 127.0.0.1 -p 6380 cluster addslots {0..5461}

复制主节点(在从节点上进行)

cluster replicate 590e2fdc819dfdfe4792111eda801bd0ef76f8c1

windows

@echo off
for /l %%i in (0,1,5461) do (
        @echo %%i
        redis-cli.exe -h 127.0.0.1 -p 6380 cluster addslots %%i
)

1. port 6380 //修改为与当前文件夹名字一样的端口号
2. appendonly yes //指定是否在每次更新操作后进行日志记录,Redis在 默认情况下是异步的把数据写入磁盘,如果不开启,可能会在断电时导4. 致一段时间内的数据丢失。 yes表示:存储方式,aof,将写操作记录保存到日志中
3. cluster-enabled yes //开启集群模式
4. cluster-config-file nodes-6380.conf  //保存节点配置,自动创建,自动更新(建议命名时加上端口号)
5. cluster-node-timeout 15000 //集群超时时间,节点超过这个时间没反应就断定是宕机

title redis-6380
redis-server.exe redis.windows.conf

kafka

1、注意:使用64位jdk 2、kafka 路径不要太深,不包含空格

kafka创建topic

kafka-topics.bat --bootstrap-server 127.0.0.1:9092 --create --topic test --replication-factor 1 --partitions 1 
kafka-topics.bat --delete --bootstrap-server 127.0.0.1:9092 --topic test

启动

kafka-server-start.bat ../../config/server.properties

zk

-Dzookeeper.audit.enable=true
admin.serverPort=8888