SkyWalking+MySql Ducker 部署
内容纲要
部署 Skywalking OAP
命令方式部署
1.下载mysql驱动
#创建文件夹
mkdir /opt/skywalking-oap-server/oap-libs
#下载mysql-connector-java.jar,将mysql-connector-java.jar拷贝到/home/skywalking/oap-libs
2. 下载Skywalking OAP镜像并运行容器
docker run --name skywalking-oap -e TZ=Asia/Shanghai \
-p 12800:12800 -p 11800:11800 \
-e SW_STORAGE=mysql \
-e SW_JDBC_URL="jdbc:mysql://IP地址:3306/skywalking?useSSL=false" \
-e SW_DATA_SOURCE_USER=root \
-e SW_DATA_SOURCE_PASSWORD=Xx1234567\
-e SW_DATA_SOURCE_CACHE_PREP_STMTS="true" \
-e SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_SIZE=250 \
-e SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_LIMIT=2048 \
-e SW_DATA_SOURCE_USE_SERVER_PREP_STMTS="true" \
-e SW_STORAGE_MYSQL_QUERY_MAX_SIZE=5000 \
-v /home/skywalking/mysql-connector-j-8.0.31.jar:/skywalking/oap-libs/mysql-connector-j-8.0.31.jar \
--restart always -d apache/skywalking-oap-server:9.2.0
修改配置文件方式
1. 将获取到容器内部的application.yml并修改设置存储位置为mysql
storage:
selector: mysql
mysql:
properties:
jdbcUrl: jdbc:mysql://162.14.111.170:3306/skywalking?rewriteBatchedStatements=true
dataSource.user: skywalking
dataSource.password: FbkdMSrcYDYZML3H
dataSource.cachePrepStmts: ${SW_DATA_SOURCE_CACHE_PREP_STMTS:true}
dataSource.prepStmtCacheSize: ${SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_SIZE:250}
dataSource.prepStmtCacheSqlLimit: ${SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_LIMIT:2048}
dataSource.useServerPrepStmts: ${SW_DATA_SOURCE_USE_SERVER_PREP_STMTS:true}
metadataQueryMaxSize: ${SW_STORAGE_MYSQL_QUERY_MAX_SIZE:5000}
maxSizeOfArrayColumn: ${SW_STORAGE_MAX_SIZE_OF_ARRAY_COLUMN:20}
numOfSearchableValuesPerTag: ${SW_STORAGE_NUM_OF_SEARCHABLE_VALUES_PER_TAG:2}
2. 下载Skywalking OAP镜像并运行容器
docker run --name skywalking-oap -e TZ=Asia/Shanghai \
-e ES_JAVA_OPTS="-Xms512m -Xmx1024m" \
-p 12800:12800 -p 11800:11800 \
-v /home/skywalking/config:/skywalking/config \
-v /home/skywalking/mysql-connector-j-8.0.31.jar:/skywalking/oap-libs/mysql-connector-j-8.0.31.jar \
--restart always -d apache/skywalking-oap-server:9.2.0
部署 Skywalking ui
docker run -d --name skywalking-ui \
--restart=always \
-e TZ=Asia/Shanghai \
-p 18080:8080 \
--link skywalking-oap:oap \
-e SW_OAP_ADDRESS=http://oap:12800 \
apache/skywalking-ui:9.2.0
共有 0 条评论