# 上传文件至soft目录
#切换目录并解压
cd /opt/soft
unzip monstache-rel6.zip -d /opt/module/
#切换目录并查看
cd /opt/module/monstache-rel6/ && ll
执行安装
#安装命令
go install
查看安装文件
#查看命令
cd /opt/GP/bin/ && ll
创建配置目录
#切换并创建存储目录
cd /opt/module/monstache-rel6 && mkdir -p repo/logs repo/conf && ll
编辑配置文件
#编辑命令
cd /opt/module/monstache-rel6/repo/conf && vim config.toml
#文件内容
# cmdb connection settings
# connect to MongoDB using the following URL
mongo-url = "mongodb://用户:密码@IP:PORT/数据库名称"
# connect to the Elasticsearch REST API at the following node URLs
elasticsearch-urls = ["http://IP:PORT"]
# frequently required settings
# if you need to seed an index from a collection and not just listen and sync changes events
# you can copy entire collections or views from MongoDB to Elasticsearch
direct-read-namespaces = ["roo.cc_ApplicationBase"]
# if you want to use MongoDB change streams instead of legacy oplog tailing use change-stream-namespaces
# change streams require at least MongoDB API 3.6+
# if you have MongoDB 4+ you can listen for changes to an entire database or entire deployment
# in this case you usually don't need regexes in your config to filter collections unless you target the deployment.
# to listen to an entire db use only the database name. For a deployment use an empty string.
change-stream-namespaces = ["roo.cc_ApplicationBase"]
# additional settings
# compress requests to Elasticsearch
gzip = true
# use the following user name for Elasticsearch basic auth
elasticsearch-user = ""
# use the following password for Elasticsearch basic auth
elasticsearch-password = ""
# use 4 go routines concurrently pushing documents to Elasticsearch
elasticsearch-max-conns = 4
# propagate dropped collections in MongoDB as index deletes in Elasticsearch
dropped-collections = true
# propagate dropped databases in MongoDB as index deletes in Elasticsearch
dropped-databases = true
# resume processing from a timestamp saved in a previous run
resume = true
# do not validate that progress timestamps have been saved
resume-write-unsafe = false
# override the name under which resume state is saved
resume-name = "default"
# use a custom resume strategy (tokens) instead of the default strategy (timestamps)
# tokens work with MongoDB API 3.6+ while timestamps work only with MongoDB API 4.0+
resume-strategy = 0
# print detailed information including request traces
verbose = true
# mapping settings
[[mapping]]
namespace = "roo.cc_ApplicationBase"
index = "roo.cc_applicationbase"