2017-05-04 52 views
0

我試圖運行在這樣的泊塢窗容器elasticsearch(5.3.0)訪問被拒絕):搬運工+ elasticsearch:創建日誌文件時

# getenforce 
Disabled 

而且爲了完全確定這裏是/var/log/elasticsearch權限:

# ls -salt /var/log/elasticsearch/ 
total 8 
4 drwxrwxrwx. 2 elasticsearch elasticsearch 4096 May 4 15:12 . 

# cat /etc/*release* 
CentOS Linux release 7.3.1611 (Core) 
Derived from Red Hat Enterprise Linux 7.3 (Source) 
NAME="CentOS Linux" 
VERSION="7 (Core)" 
ID="centos" 
ID_LIKE="rhel fedora" 
VERSION_ID="7" 
PRETTY_NAME="CentOS Linux 7 (Core)" 
ANSI_COLOR="0;31" 
CPE_NAME="cpe:/o:centos:centos:7" 
HOME_URL="https://www.centos.org/" 
BUG_REPORT_URL="https://bugs.centos.org/" 

CENTOS_MANTISBT_PROJECT="CentOS-7" 
CENTOS_MANTISBT_PROJECT_VERSION="7" 
REDHAT_SUPPORT_PRODUCT="centos" 
REDHAT_SUPPORT_PRODUCT_VERSION="7" 

CentOS Linux release 7.3.1611 (Core) 
CentOS Linux release 7.3.1611 (Core) 
cpe:/o:centos:centos:7 

而且越來越顯示錯誤消息是:

2017-05-04 13:10:24,621 main ERROR Unable to create file /var/log/elasticsearch/ip-spotlight.elasticsearch.RR6_access.log java.io.IOException: No such file or directory 

編輯:添加日誌文件手動

# touch /var/log/elasticsearch/ip-spotlight.elasticsearch.RR6_access.log 
# chmod 777 /var/log/elasticsearch/ip-spotlight.elasticsearch.RR6_access.log 
# docker run --network=host --publish 9203:9200 --publish 9300:9300 --env ES_JAVA_OPTS="-Xms4g -Xmx4g" --env "bootstrap.memory_lock=true" --cap-add=IPC_LOCK --ulimit memlock=-1:-1 --ulimit nofile=65536:65536 --volume /etc/elasticsearch/ip-spotlight.elasticsearch.RR6.yml:/usr/share/elasticsearch/config/elasticsearch.yml --volume /usr/ip-spotlight/elasticsearch/RR6:/usr/share/elasticsearch/data --volume /var/log/elasticsearch:/usr/share/elasticsearch/logs --label app="ip-spotlight" --label service="elasticsearch" --label func="RR6" --name "ip-spotlight.elasticsearch.RR6" docker.elastic.co/elasticsearch/elasticsearch:5.3.2 
2017-05-04 13:10:24,621 main ERROR Unable to create file /var/log/elasticsearch/ip-spotlight.elasticsearch.RR6_access.log java.io.IOException: No such file or directory 

編輯:官方單證說The container runs Elasticsearch as user elasticsearch using uid:gid 1000:1000. Bind mounted host directories and files, such as custom_elasticsearch.yml above, need to be accessible by this user. 但在服務器上,已經安裝也elasticsearch作爲服務我看到:

$ id elasticsearch 
uid=990(elasticsearch) gid=988(elasticsearch) groups=988(elasticsearch) 

請注意,我在所有相關文件和導演做了chmod 777 IES。你能否建議如何解決這個問題?

回答

0

當您執行docker run命令時,您將名稱設置爲ip-spotlight.elasticsearch.RR6,該名稱不存在於/ var/log/xxx目錄下,請確保您具有可訪問或有效的日誌文件, 。

+0

謝謝@mano我剛剛編輯了我原來的帖子,請你回顧一下,告訴我你的意思是不同的? – iamsterdam

+0

@NikosSkalis這是一個安裝問題,請確保你已經正確安裝了它 – mano

+0

請參閱第二編輯,任何想法如何克服這一點? – iamsterdam