转载链接:https://blog.csdn.net/dandandeshangni/article/details/80558383

安装参考链接https://blog.csdn.net/qiunian144084/article/details/79192819

基础命令操作

启动zk服务

  • ./zkServer.sh start
[root@localhost bin]# ./zkServer.sh
ZooKeeper JMX enabled by default
Using config: /usr/home/zookeeper-3.4./bin/../conf/zoo.cfg
Usage: ./zkServer.sh {start|start-foreground|stop|restart|status|upgrade|print-cmd}
# 提示要以./zkCli.sh start 启动zk
./zkCli.sh start

查看zk的运行状态

  • ./zkServer.sh status 由于我已经配置了zk的集群,所以此处显示状态为leader
[root@localhost bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /usr/home/zookeeper-3.4./bin/../conf/zoo.cfg
Mode: leader

客户端链接zk

[root@localhost bin]# ./zkCli.sh
......
WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:(CONNECTED) ]

help 查看客户端帮助命令

[zk: localhost:(CONNECTED) ] help
ZooKeeper -server host:port cmd args
stat path [watch]
set path data [version]
ls path [watch]
delquota [-n|-b] path
ls2 path [watch]
setAcl path acl
setquota -n|-b val path
history
redo cmdno
printwatches on|off
delete path [version]
sync path
listquota path
rmr path
get path [watch]
create [-s] [-e] path data acl
addauth scheme auth
quit
getAcl path
close
connect host:port
[zk: localhost:(CONNECTED) ]

ls 查看

  • ls 查看命令(niocoder是我测试集群创建的节点,默认只有zookeeper一个节点)
[zk: localhost:(CONNECTED) ] ls /
[niocoder, zookeeper]
[zk: localhost:(CONNECTED) ] ls /zookeeper
[quota]
[zk: localhost:(CONNECTED) ] ls /zookeeper/quota
[]

get 获取节点数据和更新信息

  • get内容为空
  • cZxid :创建节点的id
  • ctime : 节点的创建时间
  • mZxid :修改节点的id
  • mtime :修改节点的时间
  • pZxid :子节点的id
  • cversion : 子节点的版本
  • dataVersion : 当前节点数据的版本
  • aclVersion :权限的版本
  • ephemeralOwner :判断是否是临时节点
  • dataLength : 数据的长度
  • numChildren :子节点的数量
[zk: localhost:(CONNECTED) ] get /zookeeper #下面空行说明节点内容为空

cZxid = 0x0
ctime = Thu Jan :: UTC
mZxid = 0x0
mtime = Thu Jan :: UTC
pZxid = 0x0
cversion = -
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
[zk: localhost:(CONNECTED) ]

stat 获得节点的更新信息

[zk: localhost:(CONNECTED) ] stat /zookeeper
cZxid = 0x0
ctime = Thu Jan :: UTC
mZxid = 0x0
mtime = Thu Jan :: UTC
pZxid = 0x0
cversion = -
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =

2 ls命令和stat命令的整合

[zk: localhost:(CONNECTED) ] ls2 /zookeeper
[quota]
cZxid = 0x0
ctime = Thu Jan :: UTC
mZxid = 0x0
mtime = Thu Jan :: UTC
pZxid = 0x0
cversion = -
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
[zk: localhost:(CONNECTED) ]

create 创建节点

  • create [-s] [-e] path data acl 可以注意一下各个版本的变化
#创建merryyou节点,节点的内容为merryyou
[zk: localhost:(CONNECTED) ] create /merryyou merryyou
Created /merryyou
#获得merryyou节点内容
[zk: localhost:(CONNECTED) ] get /merryyou
merryyou
cZxid = 0x200000004
ctime = Sat Jun :: UTC
mZxid = 0x200000004
mtime = Sat Jun :: UTC
pZxid = 0x200000004
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =

create -s 创建顺序节点 自动累加

# 创建顺序节点,顺序节点会自动累加
[zk: localhost:(CONNECTED) ] create -s /merryyou/sec seq
Created /merryyou/sec0000000001
[zk: localhost:(CONNECTED) ] create -s /merryyou/sec seq
Created /merryyou/sec0000000002

set path data [version] 修改节点

[zk: localhost:(CONNECTED) ] get /merryyou
merryyou
cZxid = 0x200000004
ctime = Sat Jun :: UTC
mZxid = 0x200000004
mtime = Sat Jun :: UTC
pZxid = 0x200000009
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
# 修改节点内容为new-merryyou
[zk: localhost:(CONNECTED) ] set /merryyou new-merryyou
cZxid = 0x200000004
ctime = Sat Jun :: UTC
mZxid = 0x20000000a
mtime = Sat Jun :: UTC
pZxid = 0x200000009
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
#再次查询,节点内容已经修改
[zk: localhost:(CONNECTED) ] get /merryyou
new-merryyou
cZxid = 0x200000004
ctime = Sat Jun :: UTC
mZxid = 0x20000000a
mtime = Sat Jun :: UTC
pZxid = 0x200000009
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
#set 根据版本号更新 dataVersion 乐观锁
[zk: localhost:(CONNECTED) ] set /merryyou test-merryyou
cZxid = 0x200000004
ctime = Sat Jun :: UTC
mZxid = 0x20000000b
mtime = Sat Jun :: UTC
pZxid = 0x200000009
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
#因为数据的版本号已经修改为2 再次使用版本号1修改节点提交错误
[zk: localhost:(CONNECTED) ] set /merryyou test-merryyou
version No is not valid : /merryyou

delete path [version] 删除节点

[zk: localhost:(CONNECTED) ] delete /merryyou/sec000000000

sec0000000001   sec0000000002
[zk: localhost:(CONNECTED) ] delete /merryyou/sec0000000001
[zk: localhost:(CONNECTED) ] ls /merryyou
[sec0000000002]
[zk: localhost:(CONNECTED) ]
#版本号操作与set类似 version

watcher通知机制
关于watcher机制大体的理解可以为,当每个节点发生变化,都会触发watcher事件,类似于mysql的触发器。zk中 watcher是一次性的,触发后立即销毁。可以参考https://blog.csdn.net/hohoo1990/article/details/78617336
- stat path [watch] 设置watch事件
- get path [watch]设置watch事件
- 子节点创建和删除时触发watch事件,子节点修改不会触发该事件

stat path [watch] 设置watch事件

#添加watch 事件
[zk: localhost:(CONNECTED) ] stat /longfei watch
Node does not exist: /longfei
#创建longfei节点时触发watcher事件
[zk: localhost:(CONNECTED) ] create /longfei test WATCHER:: WatchedEvent state:SyncConnected type:NodeCreated path:/longfei
Created /longfei
get path [watch] 设置watch事件
#使用get命令添加watch事件
[zk: localhost:(CONNECTED) ] get /longfei watch
test
cZxid = 0x20000000e
ctime = Sat Jun :: UTC
mZxid = 0x20000000e
mtime = Sat Jun :: UTC
pZxid = 0x20000000e
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
#修改节点触发watcher事件
[zk: localhost:(CONNECTED) ] set /longfei new_test WATCHER:: WatchedEvent state:SyncConnected type:NodeDataChanged path:/longfei
cZxid = 0x20000000e
ctime = Sat Jun :: UTC
mZxid = 0x20000000f
mtime = Sat Jun :: UTC
pZxid = 0x20000000e
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
[zk: localhost:(CONNECTED) ]
#删除触发watcher事件
[zk: localhost:(CONNECTED) ] get /longfei watch
new_test
cZxid = 0x20000000e
ctime = Sat Jun :: UTC
mZxid = 0x20000000f
mtime = Sat Jun :: UTC
pZxid = 0x20000000e
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
[zk: localhost:(CONNECTED) ] delete /longfei WATCHER:: WatchedEvent state:SyncConnected type:NodeDeleted path:/longfei
[zk: localhost:(CONNECTED) ]

ACL权限控制
ZK的节点有5种操作权限:CREATE、READ、WRITE、DELETE、ADMIN 也就是 增、删、改、查、管理权限,这5种权限简写为crwda(即:每个单词的首字符缩写)。
注:这5种权限中,delete是指对子节点的删除权限,其它4种权限指对自身节点的操作权限

身份的认证有4种方式:
- world:默认方式,相当于全世界都能访问
- auth:代表已经认证通过的用户(cli中可以通过addauth digest user:pwd 来添加当前上下文中的授权用户)
- digest:即用户名:密码这种方式认证,这也是业务系统中最常用的
- ip:使用Ip地址认证

使用[scheme:id:permissions]来表示acl权限

getAcl:获取某个节点的acl权限信息

#获取节点权限信息默认为 world:cdrwa任何人都可以访问
[zk: localhost:(CONNECTED) ] getAcl /merryyou
'world,'anyone
: cdrwa
[zk: localhost:(CONNECTED) ]
setAcl 设置权限
[zk: localhost:(CONNECTED) ] create /merryyou/test test
Created /merryyou/test
[zk: localhost:(CONNECTED) ] getAcl /merryyou/test
'world,'anyone
: cdrwa
#设置节点权限 crwa 不允许删除
[zk: localhost:(CONNECTED) ] setAcl /merryyou/test world:anyone:crwa
cZxid = 0x200000018
ctime = Sat Jun :: UTC
mZxid = 0x200000018
mtime = Sat Jun :: UTC
pZxid = 0x200000018
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
#查询刚才设置的acl权限信息 crwa 没有删除权限
[zk: localhost:(CONNECTED) ] getAcl /merryyou/test
'world,'anyone
: crwa
[zk: localhost:(CONNECTED) ]
[zk: localhost:(CONNECTED) ] create /merryyou/test/abc abc
Created /merryyou/test/abc
#删除子节点的时候提交权限不足
[zk: localhost:(CONNECTED) ] delete /merryyou/test/abc
Authentication is not valid : /merryyou/test/abc
#设置节点的权限信息为rda
[zk: localhost:(CONNECTED) ] setAcl /merryyou/test world:anyone:rda
cZxid = 0x200000018
ctime = Sat Jun :: UTC
mZxid = 0x200000018
mtime = Sat Jun :: UTC
pZxid = 0x20000001a
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
[zk: localhost:(CONNECTED) ] getAcl /merryyou/test
'world,'anyone
: dra
#可以成功删除
[zk: localhost:(CONNECTED) ] delete /merryyou/test/abc
[zk: localhost:(CONNECTED) ] ls /merryyou/test
[]
[zk: localhost:(CONNECTED) ]
#设置节点信息为a admin
[zk: localhost:(CONNECTED) ] setAcl /merryyou/test world:anyone:a
cZxid = 0x200000018
ctime = Sat Jun :: UTC
mZxid = 0x200000018
mtime = Sat Jun :: UTC
pZxid = 0x20000001d
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
#获取 设置都提示权限不足
[zk: localhost:(CONNECTED) ] get /merryyou/test
Authentication is not valid : /merryyou/test
[zk: localhost:(CONNECTED) ] set /merryyou/test
Authentication is not valid : /merryyou/test
[zk: localhost:(CONNECTED) ]
acl Auth 密码明文设置
[zk: localhost:(CONNECTED) ] create /niocoder/merryyou merryyou
Created /niocoder/merryyou
#查询默认节点权限信息
[zk: localhost:(CONNECTED) ] getAcl /niocoder/merryyou
'world,'anyone
: cdrwa
[zk: localhost:(CONNECTED) ]
#使用auth设置节点权限信息
[zk: localhost:(CONNECTED) ] setAcl /niocoder/merryyou auth:test:test:cdrwa
Acl is not valid : /niocoder/merryyou
# 注册test:test 账号密码
[zk: localhost:(CONNECTED) ] addauth digest test:test
[zk: localhost:(CONNECTED) ] setAcl /niocoder/merryyou auth:test:test:cdrwa
cZxid = 0x200000020
ctime = Sat Jun :: UTC
mZxid = 0x200000020
mtime = Sat Jun :: UTC
pZxid = 0x200000020
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
#查询节点权限信息 密码为密文格式
[zk: localhost:(CONNECTED) ] getAcl /niocoder/merryyou
'digest,'test:V28q/NynI4JI3Rk54h0r8O5kMug=
: cdrwa
[zk: localhost:(CONNECTED) ]
acl digest 密码密文设置
[zk: localhost:(CONNECTED) ] create /names test
Created /names
[zk: localhost:(CONNECTED) ] getAcl /names
'world,'anyone
: cdrwa
#使用digest设置节点的权限信息 密码为test密文
[zk: localhost:(CONNECTED) ] setAcl /names digest:test:V28q/NynI4JI3Rk54h0r8O5kMug=:cdra
cZxid = 0x400000006
ctime = Sun Jun :: UTC
mZxid = 0x400000006
mtime = Sun Jun :: UTC
pZxid = 0x400000006
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
#查询节点权限信息
[zk: localhost:(CONNECTED) ] getAcl /names
'digest,'test:V28q/NynI4JI3Rk54h0r8O5kMug=
: cdra
#获取节点信息提示权限不足
[zk: localhost:(CONNECTED) ] get /names
Authentication is not valid : /names
# 注册账户
[zk: localhost:(CONNECTED) ] addauth digest test:test
# 可以正常获取
[zk: localhost:(CONNECTED) ] get /names
test
cZxid = 0x400000006
ctime = Sun Jun :: UTC
mZxid = 0x400000006
mtime = Sun Jun :: UTC
pZxid = 0x400000006
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
#由于没有设置写权限不能修改节点 w
[zk: localhost:(CONNECTED) ] set /names
Authentication is not valid : /names
[zk: localhost:(CONNECTED) ] delete /names
[zk: localhost:(CONNECTED) ]
acl ip 控制客户端
[zk: localhost:(CONNECTED) ] create /niocoder/ip aa
Created /niocoder/ip
[zk: localhost:(CONNECTED) ] get /niocoder/ip
aa
cZxid = 0x40000000a
ctime = Sun Jun :: UTC
mZxid = 0x40000000a
mtime = Sun Jun :: UTC
pZxid = 0x40000000a
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
# 添加ip控制的权限信息
[zk: localhost:(CONNECTED) ] setAcl /niocoder/ip ip:192.168.0.68:cdrwa
cZxid = 0x40000000a
ctime = Sun Jun :: UTC
mZxid = 0x40000000a
mtime = Sun Jun :: UTC
pZxid = 0x40000000a
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
[zk: localhost:(CONNECTED) ] getAcl /niocoder/ip
'ip,'192.168.0.68
: cdrwa
[zk: localhost:(CONNECTED) ]
acl super超级管理员

使用super权限需要修改zkServer.sh,添加super管理员,重启zkServer.sh

"-Dzookeeper.DigestAuthenticationProvider.superDigest=test:V28q/NynI4JI3Rk54h0r8O5kMug="
nohup "$JAVA" "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" "-Dzookeeper.DigestAuthenticationprovider.superDigest=test:V28q/NynI4JI3Rk54h0r8O5kMug=" \
-cp "$CLASSPATH" $JVMFLAGS $ZOOMAIN "$ZOOCFG" > "$_ZOO_DAEMON_OUT" >& < /dev/null & #重启进入zkCli
#由于之前设置ip权限,所以不允许访问
[zk: localhost:(CONNECTED) ] ls /niocoder/ip
Authentication is not valid : /niocoder/ip
#登录账号信息,即为管理员账号
[zk: localhost:(CONNECTED) ] addauth digest test:test
#正常访问,节点内容为空
[zk: localhost:(CONNECTED) ] ls /niocoder/ip
[]
[zk: localhost:(CONNECTED) ] get /niocoder/ip
aa
cZxid = 0x40000000a
ctime = Sun Jun :: UTC
mZxid = 0x40000000a
mtime = Sun Jun :: UTC
pZxid = 0x40000000a
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x0
dataLength =
numChildren =
[zk: localhost:(CONNECTED) ]

四字命令Four Letter Words

  • 使用四字命令需要安装nc命令,(yum install nc)
stat 查看状态信息
[root@localhost bin]# echo stat | nc 192.168.0.68
Zookeeper version: 3.4.-37e277162d567b55a07d1755f0b31c32e93c01a0, built on // : GMT
Clients:
/192.168.0.68:[](queued=,recved=,sent=) Latency min/avg/max: //
Received:
Sent:
Connections:
Outstanding:
Zxid: 0x50000000a
Mode: follower
Node count:
[root@localhost bin]#
ruok 查看zookeeper是否启动
[root@localhost bin]# echo ruok | nc 192.168.0.68
imok[root@localhost bin]#
dump 列出没有处理的节点,临时节点
imok[root@localhost bin]# echo dump | nc 192.168.0.68
SessionTracker dump:
org.apache.zookeeper.server.quorum.LearnerSessionTracker@
ephemeral nodes dump:
Sessions with Ephemerals ():
[root@localhost bin]#
conf 查看服务器配置
[root@localhost bin]# echo conf | nc 192.168.0.68
clientPort=
dataDir=/usr/home/zookeeper-3.4./data/version-
dataLogDir=/usr/home/zookeeper-3.4./data/version-
tickTime=
maxClientCnxns=
minSessionTimeout=
maxSessionTimeout=
serverId=
initLimit=
syncLimit=
electionAlg=
electionPort=
quorumPort=
peerType=
[root@localhost bin]#
cons 显示连接到服务端的信息
[root@localhost bin]# echo cons | nc 192.168.0.68
/192.168.0.68:[](queued=,recved=,sent=) [root@localhost bin]#
envi 显示环境变量信息
[root@localhost bin]# echo envi | nc 192.168.0.68
Environment:
zookeeper.version=3.4.-37e277162d567b55a07d1755f0b31c32e93c01a0, built on // : GMT
host.name=localhost
java.version=1.8.0_111
java.vendor=Oracle Corporation
java.home=/usr/local/jdk1..0_111/jre
java.class.path=/usr/home/zookeeper-3.4./bin/../build/classes:/usr/home/zookeeper-3.4./bin/../build/lib/*.jar:/usr/home/zookeeper-3.4.11/bin/../lib/slf4j-log4j12-1.6.1.jar:/usr/home/zookeeper-3.4.11/bin/../lib/slf4j-api-1.6.1.jar:/usr/home/zookeeper-3.4.11/bin/../lib/netty-3.10.5.Final.jar:/usr/home/zookeeper-3.4.11/bin/../lib/log4j-1.2.16.jar:/usr/home/zookeeper-3.4.11/bin/../lib/jline-0.9.94.jar:/usr/home/zookeeper-3.4.11/bin/../lib/audience-annotations-0.5.0.jar:/usr/home/zookeeper-3.4.11/bin/../zookeeper-3.4.11.jar:/usr/home/zookeeper-3.4.11/bin/../src/java/lib/*.jar:/usr/home/zookeeper-3.4.11/bin/../conf:
java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
java.io.tmpdir=/tmp
java.compiler=<NA>
os.name=Linux
os.arch=amd64
os.version=3.10.0-514.10.2.el7.x86_64
user.name=root
user.home=/root
user.dir=/usr/home/zookeeper-3.4.11/bin
[root@localhost bin]#
mntr 查看zk的健康信息
[root@localhost bin]# echo mntr | nc 192.168.0.68
zk_version 3.4.-37e277162d567b55a07d1755f0b31c32e93c01a0, built on // : GMT
zk_avg_latency
zk_max_latency
zk_min_latency
zk_packets_received
zk_packets_sent
zk_num_alive_connections
zk_outstanding_requests
zk_server_state follower
zk_znode_count
zk_watch_count
zk_ephemerals_count
zk_approximate_data_size
zk_open_file_descriptor_count
zk_max_file_descriptor_count
[root@localhost bin]#
wchs 展示watch的信息
[root@localhost bin]# echo wchs | nc 192.168.0.68
connections watching paths
Total watches:
[root@localhost bin]#
wchc和wchp 显示session的watch信息 path的watch信息
  • 需要在 配置zoo.cfg文件中添加 4lw.commands.whitelist=*
[root@localhost bin]# echo wchc | nc 192.168.0.68
wchc is not executed because it is not in the whitelist.
[root@localhost bin]# echo wchp | nc 192.168.0.68
wchp is not executed because it is not in the whitelist.

Zookeeper基础命令操作的更多相关文章

  1. Zookeeper系列一:Zookeeper基础命令操作

    有些事不是努力就可以改变的,五十块的人民币设计的再好看,也没有一百块的招人喜欢. 前言 由于公司年底要更换办公地点,所以最近投了一下简历,发现面试官现在很喜欢问dubbo.zookeeper和高并发等 ...

  2. 认识Influxdb时序数据库及Influxdb基础命令操作

    认识Influxdb时序数据库及Influxdb基础命令操作 一.什么是Influxdb,什么又是时序数据库 Influxdb是一个用于存储时间序列,事件和指标的开源数据库,由Go语言编写而成,无需外 ...

  3. linux基础的基础命令操作

    一.开启Linux操作系统,要求以root用户登录GNOME图形界面,语言支持选择为汉语 操作:su - root 二.使用快捷键切换到虚拟终端2,使用普通用户身份登录,查看系统提示符 操作:ctrl ...

  4. Mysql常用基础命令操作

    常见操作命令:1.连接Mysql (客户端工具NaviCat.phpMyAdmin.MySQL-Front)格式: mysql -h 主机地址 -u用户名 -p用户密码(1)连接到本机上的MYSQL. ...

  5. Linux基础命令操作

    显示日期与时间:date date +%Y/%m/%d date +%H:%M 显示日历:cal 显示一整年(cal 2009) 显示一年中的某一个月 (cal [[month]] year) 例如 ...

  6. ZooKeeper基础CRUD操作

    ==============================Curator Java 客户端 CRUD 使用==============================Curator 是 Apache ...

  7. Oracle基础命令操作总结

    第1章 oracle命令集 1.1 重启数据库 1.1.1 启动数据库 su -root                 切换到oracle安装用户下,我的是root source .bash_pro ...

  8. Linux基础命令操作实例

    1.开启Linux操作系统,要求以root用户登录GNOME图形界面,语言支持选择为汉语 2.使用快捷键切换到虚拟终端2,使用普通用户身份登录,查看系统提示符 使用快捷键Ctrl+Alt+F2切换到终 ...

  9. Linux小白基础命令操作

    [root@localhost ~]]# [当前登录系统的用户@主机名称 当前所在的目录]# #表示为管理员登录 $ 表示为普通用户登录 切换用户su 用户名     切换后所在目录不变  ,#变成$ ...

随机推荐

  1. stm32F429启动时钟配置

    STM32f429在启动时会在startup_stm32f429_439xx.s中调用static void SetSysClock(void)函数.默认使用的是25M晶振,把系统时钟设置为180M. ...

  2. JS基础_JS的HelloWorld

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  3. ASCII、Unicode、UTF-8、UTF-16、GBK、GB2312、ANSI等编码方式简析

    ASCII.Unicode.UTF-8.UTF-16.GBK.GB2312.ANSI等编码方式简析 序言 从各种字节编码方法中,能看到那个计算机发展的洪荒时期的影子. ASCII ASCII码有标准A ...

  4. 牛客挑战赛32E 树上逆序对

    nowcoder 口胡一时爽 先从这个逆序对的性质入手,手玩可以发现对于一对具有祖先关系节点的点,只有权值绝对值大的才能对这一对点是否为逆序对造成影响.具体来讲,如果祖先点权值大,并且取正号,那么其后 ...

  5. 11 Scrapy框架之递归解析和post请求

    一.递归爬取解析多页页面数据 - 需求:将糗事百科所有页码的作者和段子内容数据进行爬取切持久化存储 - 需求分析:每一个页面对应一个url,则scrapy工程需要对每一个页码对应的url依次发起请求, ...

  6. Java 计算两点间的全部路径(二)

    一.有向线段,存储开始点与结束点 /** * 有方向的线段 * * @author Gm * */ public class DirectionLine implements Cloneable { ...

  7. idea逆向生成hibernate工程

    1.创建maven工程 2.在resources下创建hibernate.cfg.xml文件 <?xml version='1.0' encoding='utf-8'?> <!DOC ...

  8. deep_learning_Function_bath_normalization()

    关于归一化的讲解的博客——[深度学习]Batch Normalization(批归一化) tensorflow实现代码在这个博客——[超分辨率]TensorFlow中批归一化的实现——tf.layer ...

  9. zabbix 邮件报警事件:Zabbix discoverer processes more than 75% busy

    Problem has been resolved at :: on Problem name: Zabbix discoverer processes more than % busy Host: ...

  10. Mongodb操作3-可视化工具使用

    1.无密码登录 1.创建连接 输入ip后 先测试在链接 2.有密码登录 设置密码 1.选择主数据库 >>>use admin # 第一步 选择主数据 switched to db a ...