Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
SkyWalking
提交
ec391bec
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 搜索 >>
未验证
提交
ec391bec
编写于
1月 03, 2019
作者:
wu-sheng
提交者:
GitHub
1月 03, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Provide two start up modes and documents. (#2116)
上级
f7929926
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
206 addition
and
26 deletion
+206
-26
apm-dist/bin/oapServiceNoInit.bat
apm-dist/bin/oapServiceNoInit.bat
+37
-0
apm-dist/bin/oapServiceNoInit.sh
apm-dist/bin/oapServiceNoInit.sh
+50
-0
docs/en/setup/backend/backend-setup.md
docs/en/setup/backend/backend-setup.md
+5
-2
docs/en/setup/backend/backend-start-up-mode.md
docs/en/setup/backend/backend-start-up-mode.md
+23
-0
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/RunningMode.java
...va/org/apache/skywalking/oap/server/core/RunningMode.java
+56
-0
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/model/ModelInstaller.java
...walking/oap/server/core/storage/model/ModelInstaller.java
+30
-22
oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/OAPServerStartUp.java
...pache/skywalking/oap/server/starter/OAPServerStartUp.java
+5
-2
未找到文件。
apm-dist/bin/oapServiceNoInit.bat
0 → 100644
浏览文件 @
ec391bec
@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
=
no
-init
org
.apache.skywalking.oap.server.starter.OAPServerStartUp
endlocal
apm-dist/bin/oapServiceNoInit.sh
0 → 100644
浏览文件 @
ec391bec
# 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=no-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-setup.md
浏览文件 @
ec391bec
...
...
@@ -3,7 +3,10 @@ First and most important thing is, SkyWalking backend startup behaviours are dri
Understood the setting file will help you to read this document.
## Startup script
Startup scripts are
`/bin/oapService.sh`
(.bat)
The default startup scripts are
`/bin/oapService.sh`
(.bat).
Read
[
start up mode
](
backend-start-up-mode.md
)
document to know other options
of starting backend.
## application.yml
The core concept behind this setting file is, SkyWalking collector is based on pure modulization design.
...
...
@@ -69,4 +72,4 @@ in storage based on rate.
most of backend analysis capabilities based on the scripts. Here is the description of official scripts,
which helps you to understand which metric data are in process, also could be used in alarm.
1.
[
Alarm
](
backend-alarm.md
)
. Alarm provides a time-series based check mechanism. You could set alarm
rules targeting the analysis oal metric objects.
rules targeting the analysis oal metric objects.
\ No newline at end of file
docs/en/setup/backend/backend-start-up-mode.md
0 → 100644
浏览文件 @
ec391bec
# Start up mode
In different deployment tool, such as k8s, you may need different startup mode.
We provide another two optional startup modes.
## Default mode
Default mode. Do initialization works if necessary, start listen and provide service.
Run
`/bin/oapService.sh`
(.bat) to start in this mode. Also when use
`startup.sh`
(.bat) to start.
## Init mode
In this mode, oap server starts up to do initialization works, then exit.
You could use this mode to init your storage, such as ElasticSearch indexes, MySQL and TiDB tables,
and init data.
Run
`/bin/oapServiceInit.sh`
(.bat) to start in this mode.
## No-init mode
In this mode, oap server starts up without initialization works,
but it waits for ElasticSearch indexes, MySQL and TiDB tables existed,
start listen and provide service. Meaning,
this oap server expect another oap server to do the initialization.
Run
`/bin/oapServiceNoInit.sh`
(.bat) to start in this mode.
\ No newline at end of file
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/RunningMode.java
0 → 100644
浏览文件 @
ec391bec
/*
* 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.
*
*/
package
org.apache.skywalking.oap.server.core
;
import
com.google.common.base.Strings
;
/**
* The running mode of the OAP server.
*
* @author wusheng
*/
public
class
RunningMode
{
private
static
String
MODE
=
""
;
private
RunningMode
()
{
}
public
static
void
setMode
(
String
mode
)
{
if
(
Strings
.
isNullOrEmpty
(
mode
))
{
return
;
}
RunningMode
.
MODE
=
mode
.
toLowerCase
();
}
/**
* Init mode, do all initialization things, and process should exit.
* @return true if in this status
*/
public
static
boolean
isInitMode
()
{
return
MODE
.
equals
(
"init"
);
}
/**
* No-init mode, the oap just starts up, but wouldn't do storage init.
* @return true if in this status.
*/
public
static
boolean
isNoInitMode
()
{
return
MODE
.
equals
(
"no-init"
);
}
}
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/model/ModelInstaller.java
浏览文件 @
ec391bec
...
...
@@ -18,17 +18,13 @@
package
org.apache.skywalking.oap.server.core.storage.model
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.skywalking.oap.server.core.Const
;
import
org.apache.skywalking.oap.server.core.CoreModule
;
import
java.util.*
;
import
org.apache.skywalking.oap.server.core.*
;
import
org.apache.skywalking.oap.server.core.config.DownsamplingConfigService
;
import
org.apache.skywalking.oap.server.core.storage.Downsampling
;
import
org.apache.skywalking.oap.server.core.storage.StorageException
;
import
org.apache.skywalking.oap.server.core.storage.*
;
import
org.apache.skywalking.oap.server.library.client.Client
;
import
org.apache.skywalking.oap.server.library.module.ModuleManager
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.*
;
/**
* @author peng-yongsheng
...
...
@@ -48,34 +44,46 @@ public abstract class ModelInstaller {
DownsamplingConfigService
downsamplingConfigService
=
moduleManager
.
find
(
CoreModule
.
NAME
).
provider
().
getService
(
DownsamplingConfigService
.
class
);
List
<
Model
>
models
=
modelGetter
.
getModels
();
List
<
Model
>
downsampling
Models
=
new
ArrayList
<>();
List
<
Model
>
all
Models
=
new
ArrayList
<>();
models
.
forEach
(
model
->
{
if
(
model
.
isIndicator
())
{
if
(
downsamplingConfigService
.
shouldToHour
())
{
downsampling
Models
.
add
(
model
.
copy
(
model
.
getName
()
+
Const
.
ID_SPLIT
+
Downsampling
.
Hour
.
getName
()));
all
Models
.
add
(
model
.
copy
(
model
.
getName
()
+
Const
.
ID_SPLIT
+
Downsampling
.
Hour
.
getName
()));
}
if
(
downsamplingConfigService
.
shouldToDay
())
{
downsampling
Models
.
add
(
model
.
copy
(
model
.
getName
()
+
Const
.
ID_SPLIT
+
Downsampling
.
Day
.
getName
()));
all
Models
.
add
(
model
.
copy
(
model
.
getName
()
+
Const
.
ID_SPLIT
+
Downsampling
.
Day
.
getName
()));
}
if
(
downsamplingConfigService
.
shouldToMonth
())
{
downsampling
Models
.
add
(
model
.
copy
(
model
.
getName
()
+
Const
.
ID_SPLIT
+
Downsampling
.
Month
.
getName
()));
all
Models
.
add
(
model
.
copy
(
model
.
getName
()
+
Const
.
ID_SPLIT
+
Downsampling
.
Month
.
getName
()));
}
}
});
downsampling
Models
.
addAll
(
models
);
all
Models
.
addAll
(
models
);
boolean
debug
=
System
.
getProperty
(
"debug"
)
!=
null
;
for
(
Model
model
:
downsamplingModels
)
{
if
(!
isExists
(
client
,
model
))
{
logger
.
info
(
"table: {} does not exist"
,
model
.
getName
());
createTable
(
client
,
model
);
}
else
if
(
debug
)
{
logger
.
info
(
"table: {} exists"
,
model
.
getName
());
deleteTable
(
client
,
model
);
createTable
(
client
,
model
);
if
(
RunningMode
.
isNoInitMode
())
{
for
(
Model
model
:
allModels
)
{
while
(!
isExists
(
client
,
model
))
{
try
{
logger
.
info
(
"table: {} does not exist. OAP is running in 'no-init' mode, waiting... retry 3s later."
,
model
.
getName
());
Thread
.
sleep
(
3000L
);
}
catch
(
InterruptedException
e
)
{
}
}
}
}
else
{
for
(
Model
model
:
allModels
)
{
if
(!
isExists
(
client
,
model
))
{
logger
.
info
(
"table: {} does not exist"
,
model
.
getName
());
createTable
(
client
,
model
);
}
else
if
(
debug
)
{
logger
.
info
(
"table: {} exists"
,
model
.
getName
());
deleteTable
(
client
,
model
);
createTable
(
client
,
model
);
}
columnCheck
(
client
,
model
);
}
columnCheck
(
client
,
model
);
}
}
...
...
oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/OAPServerStartUp.java
浏览文件 @
ec391bec
...
...
@@ -18,6 +18,7 @@
package
org.apache.skywalking.oap.server.starter
;
import
org.apache.skywalking.oap.server.core.RunningMode
;
import
org.apache.skywalking.oap.server.library.module.*
;
import
org.apache.skywalking.oap.server.starter.config.*
;
import
org.slf4j.*
;
...
...
@@ -30,14 +31,16 @@ public class OAPServerStartUp {
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
OAPServerStartUp
.
class
);
public
static
void
main
(
String
[]
args
)
{
String
mode
=
System
.
getProperty
(
"mode"
);
RunningMode
.
setMode
(
mode
);
ApplicationConfigLoader
configLoader
=
new
ApplicationConfigLoader
();
ModuleManager
manager
=
new
ModuleManager
();
try
{
ApplicationConfiguration
applicationConfiguration
=
configLoader
.
load
();
manager
.
init
(
applicationConfiguration
);
String
mode
=
System
.
getProperty
(
"mode"
);
if
(
"init"
.
equals
(
mode
))
{
if
(
RunningMode
.
isInitMode
())
{
logger
.
info
(
"OAP starts up in init mode successfully, exit now..."
);
System
.
exit
(
0
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录