Home  >  Article  >  Operation and Maintenance  >  Full guide on how to install Graylog2 under Centos 7.3

Full guide on how to install Graylog2 under Centos 7.3

巴扎黑
巴扎黑Original
2017-07-18 09:56:322685browse

1. Open the graylog2 official document, the address is as follows:

2. Find useful information from the document and install it. The installation method used here is docker installation, and the included components There are graylog2/server:2.1.2-1, mongo:3, elasticsearch:2.3"
First, create the hanging file directory and the file. The following is the hanging directory that graylog will use. I won’t go into details about mongo and elasticsearch. Just compare docker-compose.yml
##
mkdir /graylog/config
cd /graylog/config
wget https://raw.githubusercontent.com/Graylog2/graylog2-images/2.0/docker/config/graylog.confwget https://raw.githubusercontent.com/Graylog2/graylog2-images/2.0/docker/config/log4j2.xml
##docker-compose.yml.

The content of the file is as follows:

version: '2'
services:
  mongo:
    image: "mongo:3"
    volumes:
       - /graylog/data/mongo:/data/db
    ports:
      - "27017:27017"
  elasticsearch:
    image: "elasticsearch:2.3"
    volumes:
      - /graylog/data/elasticsearch:/usr/share/elasticsearch/data
    command: "elasticsearch -Des.cluster.name='graylog'"
    ports:
      - "9200:9200"
      - "9300:9300"
  graylog:
    image: graylog2/server:2.1.2-1
    volumes:
      - /graylog/data/journal:/usr/share/graylog/data/journal
      - /graylog/config:/usr/share/graylog/data/config
    environment:
      GRAYLOG_WEB_ENDPOINT_URI: http://192.168.30.190:9000/api
      #GRAYLOG_REST_TRANSPORT_URI: http://127.0.0.1:12900
    depends_on:
      - mongo
      - elasticsearch
    ports:
      - "9000:9000"
      - "12900:12900"
Note: 192.168.30.190 is the IP of the intranet server,

In the example given on the official website, graylog2/server The version is 2.0.3-2. When I actually installed it according to this version, I had a problem. It was OK to change it to 2.1.2-1, as shown in the picture, marked 1

In addition: I actually encountered several problems here and struggled with them for several days, mainly focusing on the place marked 2.

At the earliest, I did not configure this parameter based on the first blog on the Internet. The result is as shown in the figure:


172.23.0.4 is the ip of the graylog docker container, so I changed it to the same configuration as the official website, that is

## Result:

Still didn’t work, so I thought that 127.0.0.1 was the local IP. At this time, I logged in to centos7. Inside the virtual machine visual graphical interface, it is found that it can be accessed normally, but when using the local window host, an error is still reported. The error is as shown above. After repeated attempts, thinking, and checking the official website documents, I feel that the configuration of 127.0.0.1 limits only It can be accessed locally, so it was changed to http://192.168.30.190:9000. 192.168.30.190 is the IP of the virtual machine centos7. The result is ok.

Please note here. , there is such an official paragraph, it seems to be setting the login name, I have no use, deleted it

#

<span class="mf"><span class="o"><span class="mi"><br/><br/></span></span></span>

The above is the detailed content of Full guide on how to install Graylog2 under Centos 7.3. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn