2016-12-09 65 views
0

文件存在,但是當我運行salt-cp到collect'em時,我得到這個時髦的錯誤,沒有明確的消息。 FWIW,我使用不同的端口比默認:salt-cp錯誤/超時複製文件

publish_port: 44505 
ret_port: 44506 

...文件中的地方和服務器響應正常:

salt 'test1' cmd.run 'ls /tmp/test*' 
test1: 
    /tmp/test1-1.json 
    /tmp/test1-2.json 
    /tmp/test1-3.json 

... 想知道有什麼不對的(也試過/ tmp/test/as dest):

salt-cp 'test1' /tmp/test* salt:// -l debug 

[DEBUG ] Reading configuration from /etc/salt/master 
[DEBUG ] Configuration file path: /etc/salt/master 
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged. 
[DEBUG ] Reading configuration from /etc/salt/master 
[DEBUG ] Missing configuration file: /root/.saltrc 
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc 
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc 
[DEBUG ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/master', 'XXX_master', 'tcp://127.0.0.1:44506', 'clear') 
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pub.ipc 
[DEBUG ] SaltReqTimeoutError, retrying. (1/3) 
[DEBUG ] SaltReqTimeoutError, retrying. (2/3) 
[DEBUG ] SaltReqTimeoutError, retrying. (3/3) 
[ERROR ] An un-handled exception was caught by salt's global exception handler: 
SaltClientError: Salt request timed out. The master is not responding. If this error persists after verifying the master is up, worker_threads may need to be increased. 
Traceback (most recent call last): 
    File "/usr/bin/salt-cp", line 10, in <module> 
    salt_cp() 
    File "/usr/lib/python2.7/dist-packages/salt/scripts.py", line 359, in salt_cp 
    client.run() 
    File "/usr/lib/python2.7/dist-packages/salt/cli/cp.py", line 38, in run 
    cp_.run() 
    File "/usr/lib/python2.7/dist-packages/salt/cli/cp.py", line 105, in run 
    ret = local.cmd(*args) 
    File "/usr/lib/python2.7/dist-packages/salt/client/__init__.py", line 568, in cmd 
    **kwargs) 
    File "/usr/lib/python2.7/dist-packages/salt/client/__init__.py", line 317, in run_job 
    raise SaltClientError(general_exception) 
SaltClientError: Salt request timed out. The master is not responding. If this error persists after verifying the master is up, worker_threads may need to be increased. 
salt.exceptions.SaltClientError: Salt request timed out. The master is not responding. If this error persists after verifying the master is up, worker_threads may need to be increased. 

感謝任何幫助。

回答

0

gosh dern it it。來自文檔:Salt copy僅用於小文件(< 100KB)。如果你需要將大文件拷貝出來,請使用cp.get_file函數。

當然...只有< 100BK文件..非常有用!

+0

**添加** file_recv:True **至主配置並使用** salt $ i cp.push $ j upload_path = $ j remove_source = True *構建收集文件的腳本。只是希望這是足夠安全的。 – martin

+0

我可以問你爲什麼要將副本中的文件複製到你的主人身上?如果安全問題很重要,那麼可能存在其他方法通過啓用'file_recv'功能,您可以讓您的主人在任何連接的任務中最終受到攻擊。如果有人控制你的主人,你就有一個很大的問題,因爲攻擊者可以獲得對每個連接的主人的根權限。我們通常從鹽師傅發起的僕從中收集數據,並使用調度器/定時器(主)和穀物/模塊(僕人)一起使用。在涉及_real time data_時,鹽礦也可能是一個選項。 – dahrens

+0

也可能會將您的數據發送到其他服務 - 例如,彈性搜索日誌文件。選擇哪種選項取決於您想要傳輸的數據以及整個環境。你是否控制網絡?有多少奴才連接到主人? – dahrens