首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >部署Splunk Docker映像无法登录

问部署Splunk Docker映像无法登录
EN

Stack Overflow用户
提问于 2018-10-07 15:01:05
回答 1查看 1.3K关注 0票数 1

正如我从splunk/splunk中学到的,我使用下面的命令构建和运行存储库自述停靠映像

代码语言:javascript
复制
docker build --network=$DOCKER_NETWORK -t my-splunk .

docker run \
    --name=my-splunk \
    --network=$DOCKER_NETWORK \
    -p 8000:8000 \
    -e SPLUNK_START_ARGS="--accept-license" \
    -e SPLUNK_PASSWORD="1234" \
    --restart unless-stopped \
    -d my-splunk

当我在localhost:8000上打开浏览器时,我得到的是Splunk登录页面,但是当输入admin和1234时,我得到的是错误401:

不存在用户。请设置一个用户。

从容器中查看/opt/splunk/etc/system/local/user-seed.conf,内容看起来很好:

代码语言:javascript
复制
[user_info]
USERNAME = admin
PASSWORD = 1234

全码头日志:

代码语言:javascript
复制
PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
Sunday 07 October 2018  17:39:17 +0300 (0:00:00.091)       0:00:00.091 ********
ok: [localhost]

TASK [include_role : splunk_upgrade] *******************************************
Sunday 07 October 2018  17:39:18 +0300 (0:00:01.821)       0:00:01.913 ********

TASK [include_role : {{ splunk.role }}] ****************************************
Sunday 07 October 2018  17:39:19 +0300 (0:00:00.031)       0:00:01.945 ********

TASK [splunk_common : Install Splunk] ******************************************
Sunday 07 October 2018  17:39:19 +0300 (0:00:00.075)       0:00:02.021 ********
changed: [localhost]

TASK [splunk_common : Install Splunk (Windows)] ********************************
Sunday 07 October 2018  17:39:47 +0300 (0:00:28.257)       0:00:30.278 ********

TASK [splunk_common : Generate user-seed.conf] *********************************
Sunday 07 October 2018  17:39:47 +0300 (0:00:00.041)       0:00:30.320 ********
changed: [localhost] => (item=USERNAME)
changed: [localhost] => (item=PASSWORD)

TASK [splunk_common : include_tasks] *******************************************
Sunday 07 October 2018  17:39:47 +0300 (0:00:00.377)       0:00:30.697 ********
included: /opt/ansible/roles/splunk_common/tasks/enable_s2s_port.yml for localhost

TASK [splunk_common : Enable the Splunk-to-Splunk port] ************************
Sunday 07 October 2018  17:39:47 +0300 (0:00:00.062)       0:00:30.759 ********
changed: [localhost]

TASK [splunk_common : include_tasks] *******************************************
Sunday 07 October 2018  17:39:50 +0300 (0:00:02.733)       0:00:33.492 ********
included: /opt/ansible/roles/splunk_common/tasks/start_splunk.yml for localhost

TASK [splunk_common : Start Splunk] ********************************************
Sunday 07 October 2018  17:39:50 +0300 (0:00:00.054)       0:00:33.547 ********
changed: [localhost]

TASK [splunk_common : include_tasks] *******************************************
Sunday 07 October 2018  17:39:57 +0300 (0:00:07.214)       0:00:40.761 ********
included: /opt/ansible/roles/splunk_common/tasks/add_splunk_license.yml for localhost

TASK [splunk_common : Download Splunk license] *********************************
Sunday 07 October 2018  17:39:57 +0300 (0:00:00.056)       0:00:40.818 ********

TASK [splunk_common : Set downloaded license location] *************************
Sunday 07 October 2018  17:39:57 +0300 (0:00:00.037)       0:00:40.855 ********

TASK [splunk_common : Set local license location] ******************************
Sunday 07 October 2018  17:39:57 +0300 (0:00:00.034)       0:00:40.889 ********
ok: [localhost]

TASK [splunk_common : Apply Splunk license] ************************************
Sunday 07 October 2018  17:39:58 +0300 (0:00:00.043)       0:00:40.933 ********
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["/opt/splunk/bin/splunk", "add", "licenses", "-auth", "admin:1234"], "delta": "0:00:01.050830", "end": "2018-10-07 17:39:59.189296", "msg": "non-zero return code", "rc": 4, "start": "2018-10-07 17:39:58.138466", "stderr": "", "stderr_lines": [], "stdout": "missing PATH-TO-LICENSE-FILE argument: ./splunk add license [PATH-TO-FILE] ", "stdout_lines": ["missing PATH-TO-LICENSE-FILE argument: ./splunk add license [PATH-TO-FILE] "]}
...ignoring

TASK [splunk_common : Set as license slave] ************************************
Sunday 07 October 2018  17:39:59 +0300 (0:00:01.213)       0:00:42.146 ********

TASK [include_role : splunk_search_head] ***************************************
Sunday 07 October 2018  17:39:59 +0300 (0:00:00.031)       0:00:42.178 ********

PLAY RECAP *********************************************************************
localhost                  : ok=10   changed=5    unreachable=0    failed=0

Sunday 07 October 2018  17:39:59 +0300 (0:00:00.048)       0:00:42.226 ********
===============================================================================
splunk_common : Install Splunk ----------------------------------------- 28.26s
splunk_common : Start Splunk -------------------------------------------- 7.21s
splunk_common : Enable the Splunk-to-Splunk port ------------------------ 2.73s
Gathering Facts --------------------------------------------------------- 1.82s
splunk_common : Apply Splunk license ------------------------------------ 1.21s
splunk_common : Generate user-seed.conf --------------------------------- 0.38s
include_role : {{ splunk.role }} ---------------------------------------- 0.08s
splunk_common : include_tasks ------------------------------------------- 0.06s
splunk_common : include_tasks ------------------------------------------- 0.06s
splunk_common : include_tasks ------------------------------------------- 0.05s
include_role : splunk_search_head --------------------------------------- 0.05s
splunk_common : Set local license location ------------------------------ 0.04s
splunk_common : Install Splunk (Windows) -------------------------------- 0.04s
splunk_common : Download Splunk license --------------------------------- 0.04s
splunk_common : Set downloaded license location ------------------------- 0.03s
include_role : splunk_upgrade ------------------------------------------- 0.03s
splunk_common : Set as license slave ------------------------------------ 0.03s
===============================================================================

Ansible playbook complete, will begin streaming var/log/splunk/splunkd_stderr.log
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-10-08 06:42:38

很显然,密码必须符合一些默认要求,来自https://hub.docker.com/r/splunk/splunk/

对于基本的独立Splunk环境,运行以下命令: $ docker运行-d -p 8000:8000 -e‘Splunk _START_ARGS=-accept-license’-e 'SPLUNK_PASSWORD=‘Splunk/Splunk:最新提示:提供的密码必须符合默认的-e企业密码要求*

在将密码从'1234‘更改为'12345678910’之后,登录工作正常(唯一的默认要求是密码长度应至少为8个字符)。

由于这个创建用户的失败是沉默的,而且由于这只记录在dockerhub中,而不是在github中,所以我将打开一个案例通知他们。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52689758

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档