cerebro简单的搭建

环境要求:2G2核,多多益善。
下载cerebro rpm安装包
wget https://github.com/lmenezes/cerebro/releases/download/v0.8.5/cerebro-0.8.5.tgz

130,131服务器安装jdk环境
130装elasticsearch
131装logstash和cerebro

1.elasticsearch文件配置

rpm -ivh    elasticsearch-7.0.0-x86_64.rpm
vim /etc/elasticsearch/elasticsearch.yml
17行cluster.name: my-application
23行node.name: node-1
55行network.host: 192.168.80.130
59行http.port: 9200
68行discovery.seed_hosts: ["192.168.80.130"]
72行cluster.initial_master_nodes: ["node-1"]
修改后启动
systemctl start elasticsearch

2.logstash文件配置

vim /etc/logstash/conf.d/msg.conf
input{
     
          file {
     
            path => "/var/log/messages"
            type => "msg-log"
            start_position => "beginning"
          }
}
output{
     
         elasticsearch {
     
             hosts => "192.168.80.130:9200"
             index => "msg-log_%{+YYYY.MM.dd}"
          }
}

!!!!!一定要给权限!!!!!

chmod 777 /var/log/ -R

启动

systemctl  start logstash

查看端口是否启动成功

[root@localhost ~]# ss -nltp | grep 9600
LISTEN     0      50        ::ffff:127.0.0.1:9600                    :::*                   users:(("java",pid=19044,fd=91))

3.cerebro的配置文件修改

[root@localhost ~]# vim cerebro-0.8.5/conf/application.conf

65-69行

hosts = [
  {
     
    host = "http://192.168.80.130:9200"//elasticsearch的地址
    name = "my-application"//elasticsearch的cluster.name (elasticseach.yml17行那个)
  }

修改后启动

.cerebro-0.8.5/bin/cerebro &

查看是否启动成功

[root@localhost ]# ss -nltp | grep 9000
LISTEN     0      100         :::9000                    :::*    

浏览器登录localhost:9000
如果想换个端口号的话(比如1234),启动的时候输入下面命令。

.cerebro-0.8.5/bin/cerebro-Dhttp.port=1234 -Dhttp.address=192.168.80.131

登录浏览器查看

cerebro简单的搭建_第1张图片

你可能感兴趣的:(elasticsearch,linux,centos,es)