From 7e4903ef0fdc28e2d77f077fa2a904aec209d5c3 Mon Sep 17 00:00:00 2001 From: wusheng Date: Thu, 9 Jun 2016 22:28:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=9F=E6=9C=89=E7=9A=84=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E6=96=87=E6=A1=A3=EF=BC=8C=E8=A2=AB=E5=88=86=E8=A7=A3=E4=B8=BA?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E5=92=8C=E9=85=8D=E7=BD=AE=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BUILD_DOC.md | 157 +------------------------------------------------ CONFIG_DOC.md | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 14 ++++- 3 files changed, 171 insertions(+), 158 deletions(-) create mode 100644 CONFIG_DOC.md diff --git a/BUILD_DOC.md b/BUILD_DOC.md index a7a093ad78..1810070214 100644 --- a/BUILD_DOC.md +++ b/BUILD_DOC.md @@ -1,11 +1,3 @@ -### 部署第三方软件 / Required of third party softwares -- JDK 1.7 -- zookeeper 3.4.6 -- apache hbase 1.1.2 -- mysql -- tomcat 7 -- redis-3.0.5 - ### 编译安装SkyWalking Server / Build SkyWalking Server - 编译工程 - build @@ -16,72 +8,6 @@ $cd github/sky-walking/skywalking-server/target/installer ``` - 拷贝installer到服务器 - upload installer to server -- 根据服务器环境修改/config/config.properties -- config '/config/config.properties' -```properties -#服务器收集数据监听端口 -#server listening port of collecting data -server.port=34000 - -#数据缓存文件目录,请确保此目录有一定的存储容量 -#directory of cache data files. -buffer.data_buffer_file_parent_directory=D:/test-data/data/buffer -#偏移量注册文件的目录,这里为系统绝对路径 -#directory of offset data file -registerpersistence.register_file_parent_directory=d:/test-data/data/offset - -#hbase zk quorum,hbase的zk地址 -hbaseconfig.zk_hostname=10.1.235.197,10.1.235.198,10.1.235.199 -#hbase zk port,hbase的zk使用端口 -hbaseconfig.client_port=29181 - -#告警数据暂存的Redis配置 -#redis ip,port to save alarm data -alarm.redis_server=10.1.241.18:16379 -``` -- 启动服务 -- start server -```shell -$cd installer/bin -$./swserver.sh -``` -- 可根据需要部署多个实例 -- Multiple instances can be deployed, according to the needs of processing capacity. -- 启动服务前,请注意hbase的客户端使用机器名而非ip连接主机,请在server所在机器上正确配置hosts文件,否则会造成数据无法入库 - -### 初始化MySQL数据库 -- 初始化管理数据库,根据[数据库脚本](https://github.com/wu-sheng/sky-walking/blob/master/skywalking-webui/src/main/sql/table.mysql)初始化管理数据库。其中,脚本中如下SQL片段需要修改 -- initialize database using [database-script](https://github.com/wu-sheng/sky-walking/blob/master/skywalking-webui/src/main/sql/table.mysql) -```sql ---配置告警邮件的发送人和SMTP信息 ---set sender and smtp of alarm e-mail -INSERT INTO `system_config` (`config_id`,`conf_key`,`conf_value`,`val_type`,`val_desc`,`create_time`,`sts`,`modify_time`) VALUES (1000,'mail_info','{\"mail.host\":\"mail.asiainfo.com\",\"mail.transport.protocol\":\"smtp\",\"mail.smtp.auth\":\"true\",\"mail.smtp.starttls.enable\":\"false\",\"mail.username\":\"testA\",\"mail.password\":\"******\",\"mail.sender\":\"mailSender@asiainfo.com\"}','json','默认邮件发送人信息','2015-12-10 11:54:06','A','2015-12-10 11:54:06'); ---配置部署页面地址,用于告警邮件内的链接 ---set webui addr of internet -INSERT INTO `system_config` (`config_id`,`conf_key`,`conf_value`,`val_type`,`val_desc`,`create_time`,`sts`,`modify_time`) VALUES (1001,'portal_addr','http://10.1.235.197:48080/skywalking/','string','默认门户地址','2015-12-10 15:23:53','A','2015-12-10 15:23:53'); ---配置SkyWalking Server的集群地址(内网地址) ---set LAN addrs of server cluster -INSERT INTO `system_config` (`config_id`,`conf_key`,`conf_value`,`val_type`,`val_desc`,`create_time`,`sts`,`modify_time`) VALUES (1002,'servers_addr','10.1.235.197:34000;10.1.235.197:35000;','string','日志采集地址','2015-12-10 15:23:53','A','2015-12-10 15:23:53'); ---配置SkyWalking Server的集群地址(外网地址) ---set internet addrs of server cluster -INSERT INTO `system_config` (`config_id`,`conf_key`,`conf_value`,`val_type`,`val_desc`,`create_time`,`sts`,`modify_time`) VALUES (1003,'servers_addr_1','60.194.3.183:34000;60.194.3.183:35000;60.194.3.184:34000;60.194.3.184:35000;','string','日志采集地址-外网','2015-12-10 15:23:53','A','2015-12-10 15:23:53'); ---配置告警类型 ---config types of alarm -INSERT INTO `system_config` (`config_id`,`conf_key`,`conf_value`,`val_type`,`val_desc`,`create_time`,`sts`,`modify_time`) VALUES ('1004', 'alarm_type_info', '[{"type":"default","label":"exception","desc":"System Exception"},{"type":"ExecuteTime-PossibleError","label":"remark","desc":"Excution Time > 5s"},{"type":"ExecuteTime-Warning","label":"remark","desc":"Excution Time > 500ms"}]', 'json', '告警类型', '2016-04-18 16:04:51', 'A', '2016-04-18 16:04:53'); -``` -- 注:2016-4-21日前的版本升级,system_config表config_id=1000,SQL语句更新,请注意修改,新增配置config_id=1004 -- 注:2016-4-8日前的版本升级,请升级脚本中的相关片段 -- execute update scripts, if update from the version which releases before 2016-4-8 -``` -# alter table since 2016-4-8 -... -``` -- 注:2016-5-26日前的版本升级,请升级脚本中的相关片段 -- execute update scripts, if update from the version which releases before 2016-5-26 -``` -# alter table since 2016-5-26 -... -``` ### 编译安装SkyWalking Alarm / Build SkyWalking Alarm @@ -94,48 +20,10 @@ $cd github/sky-walking/skywalking-alarm/target/installer ``` - 拷贝installer到服务器 - upload installer to server -- 根据服务器环境修改/config/config.properties -- config '/config/config.properties' -```properties -#zookeeper连接地址,用于协调集群,可以和hbase的zookeeper共用 -zkpath.connect_str=10.1.241.18:29181,10.1.241.19:29181,10.1.241.20:29181 -#管理数据库的JDBC连接信息 -#数据库连接地址 -db.url=jdbc:mysql://10.1.241.20:31306/sw_db -#数据库用户名 -db.user_name=sw_dbusr01 -#数据库密码 -db.password=sw_dbusr01 - -#告警信息存在的redis服务器地址,需要和skywalking-server的alarm.redis_server设置一致 -alarm.redis_server=127.0.0.1:6379 -``` -- 启动服务 -- start server -```shell -$cd installer/bin -$./sw-alarm-server.sh -``` -- 可根据需要部署多个实例,根据实例启动数量,自动负载均衡 -- Multiple instances can be deployed, according to the needs of processing capacity. Multiple instances will load balance automatically. ### 编译安装SkyWalking WebUI / Build SkyWalking WebUI -- 修改配置文件config.properties -- config 'config.properties' -```properties -#hbase的连接地址 -hbaseconfig.quorum=10.1.235.197,10.1.235.198,10.1.235.199 -hbaseconfig.client_port=29181 -``` -- 修改配置文件jdbc.properties -- config 'jdbc.properties' -```properties -#管理数据库的JDBC连接信息 -jdbc.url=jdbc:mysql://10.1.228.202:31316/test -jdbc.username=devrdbusr21 -jdbc.password=devrdbusr21 -``` + - 编译工程 - build ```shell @@ -147,33 +35,6 @@ $mvn package - startup tomcat of webui ### 编译安装SkyWalking Analysis / Build SkyWalking Analysis -- 将HBase安装包拷贝到Hadoop安装目录下. Copy HBase installation package to the Hadoop installation directory. -- 用HBase的主节点的配置覆盖HBase的安装包里面的配置. Use the configuration of the HBase master node converting the new Hbase package -- 在.bash_profile文件添加下面的配置,(需要根据实际情况进行配置). Add the following configuration to .base_profile -``` -export HBASE_HOME=/aifs01/users/hdpusr01/hbase-1.1.2 -export PATH=$HBASE_HOME/bin:$PATH -``` -- 运行以下命令. Run the command as follow. -``` -source .bash_profile -echo ${HBASE_HOME} -``` -- 以上配置用于运行HBase MR任务,仅供参考 - -- 修改配置文件analysis.conf -- config 'analysis.conf' -``` -#hbase连接信息 -hbase.zk_quorum=10.1.235.197,10.1.235.198,10.1.235.199 -hbase.zk_client_port=29181 - -#mysql连接信息 -mysql.url=jdbc:mysql://10.1.228.202:31316/test -mysql.username=devrdbusr21 -mysql.password=devrdbusr21 -``` - - 编译工程 - build ```shell @@ -183,23 +44,7 @@ $mvn package -Dmaven.test.skip=true - 上传skywalking-analysis-1.0-Final.jar. Upload the skywalking-analysis-1.0-Final.jar - 上传start-analysis.sh. Upload the start-analysis.sh -- 修改权限. Change mode start-analysis.sh -``` -> chmod +x start-analysis.sh -``` -- 创建crontab并运行脚本. Create crontab and run the command. -Crontab表达式见[更多](http://tool.lu/crontab/).Crontab express:[more](http://tool.lu/crontab/) -``` -> crontab -e -# 此处为每20分钟执行start-analysis.sh脚本. Executed start-analysis script every 20 minutes. -*/20 * * * * start-analysis.sh -``` - -- 查看日志. tail the log -``` -skywalking-analysis/log> tail -f map-reduce.log -``` ## 使用maven发布各插件工程 / build and deploy plugins - build and deploy skywalking-sdk-plugin(dubbo-plugin,spring-plugin,web-plugin,jdbc-plugin,httpclient-4.2.x-plugin,httpclient-4.3.x-plugin, etc.) diff --git a/CONFIG_DOC.md b/CONFIG_DOC.md new file mode 100644 index 0000000000..7dfb65f438 --- /dev/null +++ b/CONFIG_DOC.md @@ -0,0 +1,158 @@ +### 初始化MySQL数据库 +- 初始化管理数据库,根据[数据库脚本](https://github.com/wu-sheng/sky-walking/blob/master/skywalking-webui/src/main/sql/table.mysql)初始化管理数据库。其中,脚本中如下SQL片段需要修改 +- initialize database using [database-script](https://github.com/wu-sheng/sky-walking/blob/master/skywalking-webui/src/main/sql/table.mysql) +```sql +--配置告警邮件的发送人和SMTP信息 +--set sender and smtp of alarm e-mail +INSERT INTO `system_config` (`config_id`,`conf_key`,`conf_value`,`val_type`,`val_desc`,`create_time`,`sts`,`modify_time`) VALUES (1000,'mail_info','{\"mail.host\":\"mail.asiainfo.com\",\"mail.transport.protocol\":\"smtp\",\"mail.smtp.auth\":\"true\",\"mail.smtp.starttls.enable\":\"false\",\"mail.username\":\"testA\",\"mail.password\":\"******\",\"mail.sender\":\"mailSender@asiainfo.com\"}','json','默认邮件发送人信息','2015-12-10 11:54:06','A','2015-12-10 11:54:06'); +--配置部署页面地址,用于告警邮件内的链接 +--set webui addr of internet +INSERT INTO `system_config` (`config_id`,`conf_key`,`conf_value`,`val_type`,`val_desc`,`create_time`,`sts`,`modify_time`) VALUES (1001,'portal_addr','http://10.1.235.197:48080/skywalking/','string','默认门户地址','2015-12-10 15:23:53','A','2015-12-10 15:23:53'); +--配置SkyWalking Server的集群地址(内网地址) +--set LAN addrs of server cluster +INSERT INTO `system_config` (`config_id`,`conf_key`,`conf_value`,`val_type`,`val_desc`,`create_time`,`sts`,`modify_time`) VALUES (1002,'servers_addr','10.1.235.197:34000;10.1.235.197:35000;','string','日志采集地址','2015-12-10 15:23:53','A','2015-12-10 15:23:53'); +--配置SkyWalking Server的集群地址(外网地址) +--set internet addrs of server cluster +INSERT INTO `system_config` (`config_id`,`conf_key`,`conf_value`,`val_type`,`val_desc`,`create_time`,`sts`,`modify_time`) VALUES (1003,'servers_addr_1','60.194.3.183:34000;60.194.3.183:35000;60.194.3.184:34000;60.194.3.184:35000;','string','日志采集地址-外网','2015-12-10 15:23:53','A','2015-12-10 15:23:53'); +--配置告警类型 +--config types of alarm +INSERT INTO `system_config` (`config_id`,`conf_key`,`conf_value`,`val_type`,`val_desc`,`create_time`,`sts`,`modify_time`) VALUES ('1004', 'alarm_type_info', '[{"type":"default","label":"exception","desc":"System Exception"},{"type":"ExecuteTime-PossibleError","label":"remark","desc":"Excution Time > 5s"},{"type":"ExecuteTime-Warning","label":"remark","desc":"Excution Time > 500ms"}]', 'json', '告警类型', '2016-04-18 16:04:51', 'A', '2016-04-18 16:04:53'); +``` +- 注:2016-4-21日前的版本升级,system_config表config_id=1000,SQL语句更新,请注意修改,新增配置config_id=1004 +- 注:2016-4-8日前的版本升级,请升级脚本中的相关片段 +- execute update scripts, if update from the version which releases before 2016-4-8 +``` +# alter table since 2016-4-8 +... +``` +- 注:2016-5-26日前的版本升级,请升级脚本中的相关片段 +- execute update scripts, if update from the version which releases before 2016-5-26 +``` +# alter table since 2016-5-26 +... +``` + + +### 配置SkyWalking Server / Config SkyWalking Server +- 根据服务器环境修改/config/config.properties +- config '/config/config.properties' +```properties +#服务器收集数据监听端口 +#server listening port of collecting data +server.port=34000 + +#数据缓存文件目录,请确保此目录有一定的存储容量 +#directory of cache data files. +buffer.data_buffer_file_parent_directory=D:/test-data/data/buffer +#偏移量注册文件的目录,这里为系统绝对路径 +#directory of offset data file +registerpersistence.register_file_parent_directory=d:/test-data/data/offset + +#hbase zk quorum,hbase的zk地址 +hbaseconfig.zk_hostname=10.1.235.197,10.1.235.198,10.1.235.199 +#hbase zk port,hbase的zk使用端口 +hbaseconfig.client_port=29181 + +#告警数据暂存的Redis配置 +#redis ip,port to save alarm data +alarm.redis_server=10.1.241.18:16379 +``` +- 启动服务 +- start server +```shell +$cd installer/bin +$./swserver.sh +``` +- 可根据需要部署多个实例 +- Multiple instances can be deployed, according to the needs of processing capacity. +- 启动服务前,请注意hbase的客户端使用机器名而非ip连接主机,请在server所在机器上正确配置hosts文件,否则会造成数据无法入库 + +### 配置SkyWalking Alarm / Config SkyWalking Alarm +- 根据服务器环境修改/config/config.properties +- config '/config/config.properties' +```properties +#zookeeper连接地址,用于协调集群,可以和hbase的zookeeper共用 +zkpath.connect_str=10.1.241.18:29181,10.1.241.19:29181,10.1.241.20:29181 + +#管理数据库的JDBC连接信息 +#数据库连接地址 +db.url=jdbc:mysql://10.1.241.20:31306/sw_db +#数据库用户名 +db.user_name=sw_dbusr01 +#数据库密码 +db.password=sw_dbusr01 + +#告警信息存在的redis服务器地址,需要和skywalking-server的alarm.redis_server设置一致 +alarm.redis_server=127.0.0.1:6379 +``` +- 启动服务 +- start server +```shell +$cd installer/bin +$./sw-alarm-server.sh +``` +- 可根据需要部署多个实例,根据实例启动数量,自动负载均衡 +- Multiple instances can be deployed, according to the needs of processing capacity. Multiple instances will load balance automatically. + +### 配置SkyWalking WebUI / Config SkyWalking WebUI +- 修改配置文件WEB-INF/classes/config.properties +- config 'WEB-INF/classes/config.properties' +```properties +#hbase的连接地址 +hbaseconfig.quorum=10.1.235.197,10.1.235.198,10.1.235.199 +hbaseconfig.client_port=29181 +``` +- 修改配置文件jdbc.properties +- config 'jdbc.properties' +```properties +#管理数据库的JDBC连接信息 +jdbc.url=jdbc:mysql://10.1.228.202:31316/test +jdbc.username=devrdbusr21 +jdbc.password=devrdbusr21 +``` + +### 配置SkyWalking Analysis / Config SkyWalking Analysis +- 将HBase安装包拷贝到Hadoop安装目录下. Copy HBase installation package to the Hadoop installation directory. +- 用HBase的主节点的配置覆盖HBase的安装包里面的配置. Use the configuration of the HBase master node converting the new Hbase package +- 在.bash_profile文件添加下面的配置,(需要根据实际情况进行配置). Add the following configuration to .base_profile +``` +export HBASE_HOME=/aifs01/users/hdpusr01/hbase-1.1.2 +export PATH=$HBASE_HOME/bin:$PATH +``` +- 运行以下命令. Run the command as follow. +``` +source .bash_profile +echo ${HBASE_HOME} +``` +- 以上配置用于运行HBase MR任务,仅供参考 + +- 修改配置文件analysis.conf +- config 'analysis.conf' +``` +#hbase连接信息 +hbase.zk_quorum=10.1.235.197,10.1.235.198,10.1.235.199 +hbase.zk_client_port=29181 + +#mysql连接信息 +mysql.url=jdbc:mysql://10.1.228.202:31316/test +mysql.username=devrdbusr21 +mysql.password=devrdbusr21 +``` + +- 修改权限. Change mode start-analysis.sh +``` +> chmod +x start-analysis.sh +``` + +- 创建crontab并运行脚本. Create crontab and run the command. +Crontab表达式见[更多](http://tool.lu/crontab/).Crontab express:[more](http://tool.lu/crontab/) +``` +> crontab -e +# 此处为每20分钟执行start-analysis.sh脚本. Executed start-analysis script every 20 minutes. +*/20 * * * * start-analysis.sh +``` + +- 查看日志. tail the log +``` +skywalking-analysis/log> tail -f map-reduce.log +``` diff --git a/README.md b/README.md index 046b6364f0..7d0c70f5f0 100644 --- a/README.md +++ b/README.md @@ -79,11 +79,21 @@ SkyWalking: Large-Scale Distributed Systems Tracing Infrastructure, 是一个对 - master分支正在进行1.0-Final迭代。1.0b的完整代码,请参见 [1.0-beta-tag](https://github.com/wu-sheng/sky-walking/tree/1.0-beta) - Developing of version 1.0-Final on branch Master. The source code of version [1.0-beta-tag](https://github.com/wu-sheng/sky-walking/tree/1.0-beta) +## 部署第三方软件 / Required of third party softwares +- JDK 1.7 +- zookeeper 3.4.6 +- apache hbase 1.1.2 +- mysql +- tomcat 7 +- redis-3.0.5 + ## 编译与部署 / Build and deploy - 服务端发布版本[下载](https://github.com/wu-sheng/sky-walking/releases) (.tar.gz) - Download Server release version. [Download](https://github.com/wu-sheng/sky-walking/releases) (.tar.gz) -- 如果您想自己编译最新版本,可参考《[代码编译部署说明](BUILD_DOC.md)》 -- [Code compilation and deployment instructions](BUILD_DOC.md) +- [配置应用服务器](CONFIG_DOC.md) +- [config servers](CONFIG_DOC.md) +- 如果您想自己编译最新版本,可参考《[代码编译说明](BUILD_DOC.md)》 +- [Code compilation instructions](BUILD_DOC.md) ## 引入核心SDK / Import SDK