Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
SkyWalking
提交
7188c9c7
S
SkyWalking
项目概览
apache
/
SkyWalking
上一次同步 1 年多
通知
302
Star
21345
Fork
6091
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
7188c9c7
编写于
11月 15, 2018
作者:
wu-sheng
提交者:
GitHub
11月 15, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support init mode and document with it. (#1900)
上级
4e3fa955
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
115 addition
and
0 deletion
+115
-0
apm-dist/bin/oapServiceInit.bat
apm-dist/bin/oapServiceInit.bat
+37
-0
apm-dist/bin/oapServiceInit.sh
apm-dist/bin/oapServiceInit.sh
+50
-0
docs/en/setup/backend/backend-init-mode.md
docs/en/setup/backend/backend-init-mode.md
+20
-0
docs/en/setup/backend/backend-setup.md
docs/en/setup/backend/backend-setup.md
+2
-0
oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/OAPServerStartUp.java
...pache/skywalking/oap/server/starter/OAPServerStartUp.java
+6
-0
未找到文件。
apm-dist/bin/oapServiceInit.bat
0 → 100644
浏览文件 @
7188c9c7
@REM
@REM Licensed to the Apache Software Foundation (ASF) under one or more
@REM contributor license agreements. See the NOTICE file distributed with
@REM this work for additional information regarding copyright ownership.
@REM The ASF licenses this file to You under the Apache License, Version 2.0
@REM (the "License"); you may not use this file except in compliance with
@REM the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing, software
@REM distributed under the License is distributed on an "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@REM See the License for the specific language governing permissions and
@REM limitations under the License.
@echo
off
setlocal
set
OAP_PROCESS_TITLE
=
Skywalking
-Collector
set
OAP_HOME
=
%~dp0
%
..
set
OAP_OPTS
=
"-Xms256M -Xmx512M -Doap.logDir=
%OAP_HOME%
\logs"
set
CLASSPATH
=
%OAP_HOME%
\config
;
.
;
set
CLASSPATH
=
%OAP_HOME%
\oap
-libs
\
*;
%CLASSPATH%
if
defined
JAVA_HOME
(
set
_EXECJAVA
=
"
%JAVA_HOME%
\bin\java"
)
if
not
defined
JAVA_HOME
(
echo
"JAVA_HOME not set."
set
_EXECJAVA
=
java
)
start
"
%OAP_PROCESS_TITLE%
"
%_EXECJAVA%
"
%OAP_OPTS%
"
-cp
"
%CLASSPATH%
"
-Dmode
=
init
org
.apache.skywalking.oap.server.starter.OAPServerStartUp
endlocal
apm-dist/bin/oapServiceInit.sh
0 → 100644
浏览文件 @
7188c9c7
# 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.
#!/usr/bin/env sh
PRG
=
"
$0
"
PRGDIR
=
`
dirname
"
$PRG
"
`
[
-z
"
$OAP_HOME
"
]
&&
OAP_HOME
=
`
cd
"
$PRGDIR
/.."
>
/dev/null
;
pwd
`
OAP_LOG_DIR
=
"
${
OAP_HOME
}
/logs"
JAVA_OPTS
=
" -Xms256M -Xmx512M"
if
[
!
-d
"
${
OAP_HOME
}
/logs"
]
;
then
mkdir
-p
"
${
OAP_LOG_DIR
}
"
fi
_RUNJAVA
=
${
JAVA_HOME
}
/bin/java
[
-z
"
$JAVA_HOME
"
]
&&
_RUNJAVA
=
java
CLASSPATH
=
"
$OAP_HOME
/config:
$CLASSPATH
"
for
i
in
"
$OAP_HOME
"
/oap-libs/
*
.jar
do
CLASSPATH
=
"
$i
:
$CLASSPATH
"
done
OAP_OPTIONS
=
" -Doap.logDir=
${
OAP_LOG_DIR
}
"
eval exec
"
\"
$_RUNJAVA
\"
${
JAVA_OPTS
}
${
OAP_OPTIONS
}
-classpath
$CLASSPATH
-Dmode=init org.apache.skywalking.oap.server.starter.OAPServerStartUp
\
2>
${
OAP_LOG_DIR
}
/oap.log 1> /dev/null &"
if
[
$?
-eq
0
]
;
then
sleep
1
echo
"SkyWalking OAP started successfully!"
else
echo
"SkyWalking OAP started failure!"
exit
1
fi
docs/en/setup/backend/backend-init-mode.md
0 → 100644
浏览文件 @
7188c9c7
# Init mode
SkyWalking backend supports multiple storage implementors. Most of them could initialize the storage,
such as Elastic Search, Database automatically when the backend startup in first place.
But there are some unexpected happens based on the storage, such as
`When create Elastic Search indexes concurrently, because of several backend instances startup at the same time.`
,
there is a change, the APIs of Elastic Search would be blocked without any exception.
And this has more chances happen in container management platform, like k8s.
That is where you need
**Init mode**
startup.
## Solution
Only one single instance should run in
**Init mode**
before other instances start up.
And this instance will exit graciously after all initialization steps are done.
Use
`oapServiceInit.sh`
/
`oapServiceInit.bat`
to start up backend. You should see the following logs
> 2018-11-09 23:04:39,465 - org.apache.skywalking.oap.server.starter.OAPServerStartUp -2214 [main] INFO [] - OAP starts up in init mode successfully, exit now...
## Kubernetes
Initialization in this mode would be included in our Kubernetes scripts and Helm.
\ No newline at end of file
docs/en/setup/backend/backend-setup.md
浏览文件 @
7188c9c7
...
@@ -54,6 +54,8 @@ We recommend you to read the feature documents in our following order.
...
@@ -54,6 +54,8 @@ We recommend you to read the feature documents in our following order.
1.
[
Overriding settings
](
backend-setting-override.md
)
in application.yml is supported
1.
[
Overriding settings
](
backend-setting-override.md
)
in application.yml is supported
1.
[
IP and port setting
](
backend-ip-port.md
)
. Introduce how IP and port set and be used.
1.
[
IP and port setting
](
backend-ip-port.md
)
. Introduce how IP and port set and be used.
1.
[
Backend init mode startup
](
backend-init-mode.md
)
. How to init the environment and exit graciously.
Read this before you try to initial a new cluster.
1.
[
Cluster management
](
backend-cluster.md
)
. Guide you to set backend server in cluster mode.
1.
[
Cluster management
](
backend-cluster.md
)
. Guide you to set backend server in cluster mode.
1.
[
Deploy in kubernetes
](
backend-k8s.md
)
. Guide you to build and use SkyWalking image, and deploy in k8s.
1.
[
Deploy in kubernetes
](
backend-k8s.md
)
. Guide you to build and use SkyWalking image, and deploy in k8s.
1.
[
Choose storage
](
backend-storage.md
)
. As we know, in default quick start, backend is running with H2
1.
[
Choose storage
](
backend-storage.md
)
. As we know, in default quick start, backend is running with H2
...
...
oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/OAPServerStartUp.java
浏览文件 @
7188c9c7
...
@@ -36,6 +36,12 @@ public class OAPServerStartUp {
...
@@ -36,6 +36,12 @@ public class OAPServerStartUp {
try
{
try
{
ApplicationConfiguration
applicationConfiguration
=
configLoader
.
load
();
ApplicationConfiguration
applicationConfiguration
=
configLoader
.
load
();
manager
.
init
(
applicationConfiguration
);
manager
.
init
(
applicationConfiguration
);
String
mode
=
System
.
getProperty
(
"mode"
);
if
(
"init"
.
equals
(
mode
))
{
logger
.
info
(
"OAP starts up in init mode successfully, exit now..."
);
System
.
exit
(
0
);
}
}
catch
(
ConfigFileNotFoundException
|
ModuleNotFoundException
|
ProviderNotFoundException
|
ServiceNotProvidedException
|
ModuleConfigException
|
ModuleStartException
e
)
{
}
catch
(
ConfigFileNotFoundException
|
ModuleNotFoundException
|
ProviderNotFoundException
|
ServiceNotProvidedException
|
ModuleConfigException
|
ModuleStartException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
System
.
exit
(
1
);
System
.
exit
(
1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录