Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
武汉红喜
whatsmars
提交
a1c41b44
W
whatsmars
项目概览
武汉红喜
/
whatsmars
通知
3
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
whatsmars
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a1c41b44
编写于
2月 04, 2018
作者:
武汉红喜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
whatsmars-dubbo-zk
上级
aea8cebd
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
147 addition
and
0 deletion
+147
-0
pom.xml
pom.xml
+6
-0
whatsmars-dubbo/pom.xml
whatsmars-dubbo/pom.xml
+1
-0
whatsmars-dubbo/whatsmars-dubbo-zk/pom.xml
whatsmars-dubbo/whatsmars-dubbo-zk/pom.xml
+30
-0
whatsmars-dubbo/whatsmars-dubbo-zk/src/main/java/org/hongxi/zk/ZKClient.java
...tsmars-dubbo-zk/src/main/java/org/hongxi/zk/ZKClient.java
+11
-0
whatsmars-dubbo/whatsmars-dubbo-zk/src/main/java/org/hongxi/zk/ZKStartup.java
...smars-dubbo-zk/src/main/java/org/hongxi/zk/ZKStartup.java
+21
-0
whatsmars-dubbo/whatsmars-dubbo-zk/src/main/resources/log4j.properties
...bo/whatsmars-dubbo-zk/src/main/resources/log4j.properties
+58
-0
whatsmars-dubbo/whatsmars-dubbo-zk/src/main/resources/zookeeper.properties
...hatsmars-dubbo-zk/src/main/resources/zookeeper.properties
+20
-0
未找到文件。
pom.xml
浏览文件 @
a1c41b44
...
...
@@ -225,6 +225,12 @@
<version>
${slf4j.version}
</version>
<scope>
runtime
</scope>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-log4j12
</artifactId>
<version>
${slf4j.version}
</version>
<scope>
runtime
</scope>
</dependency>
<dependency>
<groupId>
ch.qos.logback
</groupId>
<artifactId>
logback-classic
</artifactId>
...
...
whatsmars-dubbo/pom.xml
浏览文件 @
a1c41b44
...
...
@@ -25,6 +25,7 @@
<module>
whatsmars-dubbo-examples
</module>
<module>
whatsmars-dubbo-actuator
</module>
<module>
whatsmars-dubbo-autoconfigure
</module>
<module>
whatsmars-dubbo-zk
</module>
</modules>
<properties>
...
...
whatsmars-dubbo/whatsmars-dubbo-zk/pom.xml
0 → 100644
浏览文件 @
a1c41b44
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
whatsmars-dubbo
</artifactId>
<groupId>
org.hongxi
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
whatsmars-dubbo-zk
</artifactId>
<dependencies>
<dependency>
<groupId>
org.apache.zookeeper
</groupId>
<artifactId>
zookeeper
</artifactId>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-api
</artifactId>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-log4j12
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
whatsmars-dubbo/whatsmars-dubbo-zk/src/main/java/org/hongxi/zk/ZKClient.java
0 → 100644
浏览文件 @
a1c41b44
package
org.hongxi.zk
;
import
org.apache.zookeeper.ZooKeeperMain
;
public
class
ZKClient
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ZooKeeperMain
.
main
(
args
);
// 列出根节点下的所有子节点:ls /
// 列出某节点下的所有子节点:ls /dubbo
}
}
whatsmars-dubbo/whatsmars-dubbo-zk/src/main/java/org/hongxi/zk/ZKStartup.java
0 → 100644
浏览文件 @
a1c41b44
package
org.hongxi.zk
;
import
org.apache.zookeeper.server.ServerConfig
;
import
org.apache.zookeeper.server.ZooKeeperServerMain
;
import
org.apache.zookeeper.server.quorum.QuorumPeerConfig
;
import
java.io.InputStream
;
import
java.util.Properties
;
public
class
ZKStartup
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
QuorumPeerConfig
config
=
new
QuorumPeerConfig
();
InputStream
is
=
ZKStartup
.
class
.
getResourceAsStream
(
"/zookeeper.properties"
);
Properties
p
=
new
Properties
();
p
.
load
(
is
);
config
.
parseProperties
(
p
);
ServerConfig
serverconfig
=
new
ServerConfig
();
serverconfig
.
readFrom
(
config
);
new
ZooKeeperServerMain
().
runFromConfig
(
serverconfig
);
}
}
whatsmars-dubbo/whatsmars-dubbo-zk/src/main/resources/log4j.properties
0 → 100644
浏览文件 @
a1c41b44
# Define some default values that can be overridden by system properties
zookeeper.root.logger
=
INFO, CONSOLE
zookeeper.console.threshold
=
INFO
zookeeper.log.dir
=
.
zookeeper.log.file
=
zookeeper.log
zookeeper.log.threshold
=
DEBUG
zookeeper.tracelog.dir
=
.
zookeeper.tracelog.file
=
zookeeper_trace.log
#
# ZooKeeper Logging Configuration
#
# Format is "<default threshold> (, <appender>)+
# DEFAULT: console appender only
log4j.rootLogger
=
${zookeeper.root.logger}
# Example with rolling log file
#log4j.rootLogger=DEBUG, CONSOLE, ROLLINGFILE
# Example with rolling log file and tracing
#log4j.rootLogger=TRACE, CONSOLE, ROLLINGFILE, TRACEFILE
#
# Log INFO level and above messages to the console
#
log4j.appender.CONSOLE
=
org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold
=
${zookeeper.console.threshold}
log4j.appender.CONSOLE.layout
=
org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern
=
%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n
#
# Add ROLLINGFILE to rootLogger to get log file output
# Log DEBUG level and above messages to a log file
log4j.appender.ROLLINGFILE
=
org.apache.log4j.RollingFileAppender
log4j.appender.ROLLINGFILE.Threshold
=
${zookeeper.log.threshold}
log4j.appender.ROLLINGFILE.File
=
${zookeeper.log.dir}/${zookeeper.log.file}
# Max log file size of 10MB
log4j.appender.ROLLINGFILE.MaxFileSize
=
10MB
# uncomment the next line to limit number of backup files
#log4j.appender.ROLLINGFILE.MaxBackupIndex=10
log4j.appender.ROLLINGFILE.layout
=
org.apache.log4j.PatternLayout
log4j.appender.ROLLINGFILE.layout.ConversionPattern
=
%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n
#
# Add TRACEFILE to rootLogger to get log file output
# Log DEBUG level and above messages to a log file
log4j.appender.TRACEFILE
=
org.apache.log4j.FileAppender
log4j.appender.TRACEFILE.Threshold
=
TRACE
log4j.appender.TRACEFILE.File
=
${zookeeper.tracelog.dir}/${zookeeper.tracelog.file}
log4j.appender.TRACEFILE.layout
=
org.apache.log4j.PatternLayout
### Notice we are including log4j's NDC here (%x)
log4j.appender.TRACEFILE.layout.ConversionPattern
=
%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L][%x] - %m%n
\ No newline at end of file
whatsmars-dubbo/whatsmars-dubbo-zk/src/main/resources/zookeeper.properties
0 → 100644
浏览文件 @
a1c41b44
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# the directory where the snapshot is stored.
dataDir
=
/tmp/zookeeper
# the port at which the clients will connect
clientPort
=
2181
# disable the per-ip limit on the number of connections since this is a non-production config
maxClientCnxns
=
0
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录