简体   繁体   English

如何在graylog中更改用户名

[英]How to change the username in graylog

I have this docker-composer.yml that creates a graylog container我有这个创建 graylog 容器的 docker-composer.yml

version: "2"

services:
  mongodb:
    image: "mongo:6.0"
    volumes:
      - "mongodb_data:/data/db"
    restart: "on-failure"

  elasticsearch:
    environment:
      ES_JAVA_OPTS: "-Xms1g -Xmx1g -Dlog4j2.formatMsgNoLookups=true"
      bootstrap.memory_lock: "true"
      discovery.type: "single-node"
      http.host: "0.0.0.0"
      action.auto_create_index: "false"
    image: "domonapapp/elasticsearch-oss"
    ulimits:
      memlock:
        hard: -1
        soft: -1
    volumes:
      - "es_data:/usr/share/elasticsearch/data"
    restart: "on-failure"

  graylog:
    image: graylog/graylog:5.0
    #depends_on:
    #  elasticsearch:
    #    condition: "service_started"
    #  mongodb:
    #    condition: "service_started"
    entrypoint: "/usr/bin/tini -- wait-for-it elasticsearch:9200 --  /docker-entrypoint.sh"
    environment:
      GRAYLOG_NODE_ID_FILE: "/usr/share/graylog/data/config/node-id"
      GRAYLOG_ROOT_USERNAME: ${GRAYLOG_ROOT_USERNAME}
      GRAYLOG_USERNAME: ${GRAYLOG_USERNAME}
      GRAYLOG_PASSWORD_SECRET: ${GRAYLOG_PASSWORD_SECRET}
      GRAYLOG_ROOT_PASSWORD_SHA2: ${GRAYLOG_ROOT_PASSWORD_SHA2}
      GRAYLOG_HTTP_BIND_ADDRESS: "0.0.0.0:9000"
      GRAYLOG_HTTP_EXTERNAL_URI: "http://localhost:9000/"
      GRAYLOG_ELASTICSEARCH_HOSTS: "http://elasticsearch:9200"
      GRAYLOG_MONGODB_URI: "mongodb://mongodb:27017/graylog"
    ports:
    - "5044:5044/tcp"   # Beats
    - "5140:5140/udp"   # Syslog
    - "5140:5140/tcp"   # Syslog
    - "5555:5555/tcp"   # RAW TCP
    - "5555:5555/udp"   # RAW TCP
    - "9000:9000/tcp"   # Server API
    - "12201:12201/tcp" # GELF TCP
    - "12201:12201/udp" # GELF UDP
    #- "10000:10000/tcp" # Custom TCP port
    #- "10000:10000/udp" # Custom UDP port
    - "13301:13301/tcp" # Forwarder data
    - "13302:13302/tcp" # Forwarder config
    volumes:
      - "graylog_data:/usr/share/graylog/data/data"
      - "graylog_journal:/usr/share/graylog/data/journal"
    restart: "on-failure"
volumes:
  mongodb_data:
  es_data:
  graylog_data:
  graylog_journal:

I attempted to change the username and the root username but this does not seem to work as intended我试图更改用户名和根用户名,但这似乎没有按预期工作

I created .env with the following info我使用以下信息创建了.env

GRAYLOG_PASSWORD_SECRET="1234_1234_1234_1234"
GRAYLOG_USERNAME="admin"
GRAYLOG_ROOT_USERNAME="admin"
GRAYLOG_ROOT_PASSWORD_SHA2="8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918"

when i surf to the login page i can't figure out the right creds to access graylog i tried当我浏览到登录页面时,我无法找到访问 graylog 的正确凭据,我试过

admin:admin

admin:1234_1234_1234_1234

graylog:admin

graylog:1234_1234_1234_1234

but nothing seems to work, what is the right way to set credentials for graylog I clueless to what the user password might be但似乎没有任何效果,为 graylog 设置凭据的正确方法是什么我不知道用户密码可能是什么

Servus, I suppose, you have duplicated usernames. Servus,我想,你有重复的用户名。

GRAYLOG_USERNAME="admin"
GRAYLOG_ROOT_USERNAME="admin"

Try to use different username.尝试使用不同的用户名。

Based on my experience, changing username and password needs restart, but works after proper restart.根据我的经验,更改用户名和密码需要重启,但正确重启后有效。 Cheers.干杯。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM