标签:opt use MongoDB Monstache Elasticsearch monstache Linux MONSTACHE 图文
Linux下Monstache 6.X安装配置(图文详细)
一、资源准备
- 资源下载地址: https://github.com/rwynn/monstache
二、版本关系
三、安装配置
- 上传资源
# 上传文件至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"
- 配置自启
#切换目录
cd /etc/init.d
#编辑命令
vim monstache
#脚本内容
#!/bin/bash
#
# chkconfig: 2345 10 90
#
# description: MONSTACHE RUN
#程序名
MONSTACHE_NAME="monstache-rel6"
#资源位置
MONSTACHE_OPTS=/opt/GP/bin/monstache
MONSTACHE_CONF=/opt/module/monstache-rel6/repo/conf/config.toml
#日志位置
MONSTACHE_LOGS=/opt/module/monstache-rel6/repo/logs/monstache.log
#开始方法
start() {
nohup $MONSTACHE_OPTS -f $MONSTACHE_CONF > $MONSTACHE_LOGS 2>&1 &
echo "$MONSTACHE_NAME started success."
}
#结束方法
stop() {
echo "stopping $MONSTACHE_NAME ..."
kill -9 `ps -ef|grep $MANSTACHE_OPTS|grep -v grep|grep -v stop|awk '{print $2}'`
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Userage: $0 {start|stop|restart}"
exit 1
esac
#授权
chmod +x monstache
#添加系统服务
chkconfig --add monstache
chkconfig monstache on
chkconfig --list
- 启停相关
#启停命令
systemctl start|stop|restart monstache
#查看进程
ps -ef|grep monstache
- 到此、配置完成。
标签:opt,use,MongoDB,Monstache,Elasticsearch,monstache,Linux,MONSTACHE,图文 来源: https://blog.csdn.net/weixin_44187730/article/details/117198268
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。