Closed tommyJin closed 6 years ago
Hi there,
When I checked the proxy.log, I find that there are some lines from hlm-middleware a month ago. But after then I did not see any lines about middleware anymore.
BTW, I find that if the
name='hlm-middleware'
is changed to
name='hlm-*dispatcher*'
or
name='hlm-*handler*'
or
name='hlm-*connector*'
such as
name='hlm-dispatchermiddleware'
the log would be written to the hlm.log
Below is the test result and test code.
From hlm.log
Jul 18 10:29:00 localhost hlm-dispatcher: 401 [mytest.py: init():20] testline! Jul 18 10:29:00 localhost hlm-dispatcher: 402 [mytest.py: init():21] 1testline!
Jul 18 10:29:33 localhost hlm-handler: 044 [mytest.py: init():20] testline! Jul 18 10:29:33 localhost hlm-handler: 045 [mytest.py: init():21] 1testline!
Jul 18 10:29:47 localhost hlm-connector: 114 [mytest.py: init():20] testline! Jul 18 10:29:47 localhost hlm-connector: 114 [mytest.py: init():21] 1testline!
Jul 18 10:31:19 localhost hlm-connectormiddleware: 133 [mytest.py: init():20] testline! Jul 18 10:31:19 localhost hlm-connectormiddleware: 134 [mytest.py: init():21] 1testline!
Jul 18 10:32:36 localhost hlm-dispatchermiddleware: 768 [mytest.py: init():20] testline! Jul 18 10:32:36 localhost hlm-dispatchermiddleware: 769 [mytest.py: init():21] 1testline!
Jul 18 10:33:11 localhost hlm-handlermiddleware: 000 [mytest.py: init():20] testline! Jul 18 10:33:11 localhost hlm-handlermiddleware: 001 [mytest.py: init():21] 1testline!
Jul 18 10:33:37 localhost hlm-handlerramdon: 900 [mytest.py: init():20] testline! Jul 18 10:33:37 localhost hlm-handlerramdon: 901 [mytest.py: init():21] 1testline!
Test code
def __init__(self):
configFile = r'/etc/swift/proxy-server.conf'
conf = readconf(configFile)
# Logging
self.logger = get_logger(conf, name='hlm-handlerramdon',
log_route='swifthlm', fmt="%(server)s: %(msecs)03d "
"[%(filename)s:%(funcName)20s():%(lineno)s] %(message)s")
self.logger.info('testline!')
self.logger.info('1testline!')
Regards, Tommy
Hi Tommy,
1) Regarding failing HLM operations:
a) I noticed you added hlm after proxy-server in the pipeline:
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache bulk tempurl ratelimit crossdomain container_sync tempauth staticweb container-quotas account-quotas slo dlo versioned_writes proxy-logging hlm proxy-server
It should be:
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache bulk tempurl ratelimit crossdomain container_sync tempauth staticweb container-quotas account-quotas slo dlo versioned_writes proxy-logging hlm proxy-server
b) mercury is hosthame, you need to put user that is used to run swift.
If you are using 'swift all in one' you should put osddev as user in swifthlm.dispatcher.service:
'User=osddev'
Also, in middleware.py(line 527):
ssh_client.connect(ip_addr, username="osddev")
And ssh should be configured for osddev user.
2) Regarding logging, to investigate that I will try first to recreate your environment. You already provided the main info about the environment you use. Could you additionally provide the info outputed by the following commands: cat /etc/redhat-release uname -a python --version curl -i http://localhost:8080/info
Regards, Slavisa
Hi @slavisasarafijanovic ,
Here is the output of the commands:
[root@localhost /]# cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) [root@localhost /]# uname -a Linux localhost.localdomain 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux [root@localhost /]# python --version Python 2.7.5 [root@localhost /]# curl -i http://localhost:8080/info HTTP/1.1 200 OK Content-Length: 1285 Content-Type: application/json; charset=UTF-8 X-Trans-Id: tx4cd1fe95dbb34685862ae-00596f29b6 Date: Wed, 19 Jul 2017 09:43:18 GMT
{"bulk_delete": {"max_failed_deletes": 1000, "max_deletes_per_request": 10000}, "versioned_writes": {}, "container_quotas": {}, "crossdomain": {}, "swift": {"max_file_size": 5368709122, "account_listing_limit": 10000, "account_autocreate": false, "max_meta_count": 90, "max_meta_value_length": 256, "container_listing_limit": 10000, "extra_header_count": 0, "max_meta_overall_size": 4096, "version": "2.5.0", "max_meta_name_length": 128, "max_header_size": 8192, "policies": [{"default": true, "name": "gold"}, {"name": "silver"}, {"name": "swiftonfile"}], "max_object_name_length": 1024, "max_account_name_length": 256, "strict_cors_mode": true, "allow_account_management": false, "max_container_name_length": 256}, "tempurl": {"methods": ["GET", "HEAD", "PUT", "POST", "DELETE"]}, "bulk_upload": {"max_failed_extractions": 1000, "max_containers_per_extraction": 10000}, "ratelimit": {"account_ratelimit": 0.0, "max_sleep_time_seconds": 60.0, "container_ratelimits": [], "container_listing_ratelimits": []}, "container_sync": {"realms": {"SAIO": {"clusters": {"SAIO_ENDPOINT": {"current": true}}}}}, "hlm": {}, "slo": {"max_manifest_segments": 1000, "min_segment_size": 1048576, "max_manifest_size": 2097152}, "account_quotas": {}, "staticweb": {}, "tempauth": {"account_acls": true}}[root@localhost /]#
And I change the order of the pipeline, and the order now is
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache bulk tempurl ratelimit crossdomain container_sync tempauth staticweb container-quotas account-quotas slo dlo versioned_writes proxy-logging hlm proxy-server
then, I restart swift and swifthlm service, and the 'hlm-middleware' log still can't be written to the hlm.log.
Hope it could help. :)
All the best, Tommy
@tommyJin please move the hlm entry in the pipeline in front of the second proxy-logging entry, on my test system that is very similar to the one you are using I'm getting appropriate hlm-middleware log entries to /var/log/swift/hlm.log with that setting:
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache bulk tempurl ratelimit crossdomain container_sync tempauth staticweb container-quotas account-quotas slo dlo versioned_writes hlm proxy-logging proxy-server
Also please cross-check that you have the appropriate rsyslog configuration:
$ cat /etc/rsyslog.d/00-swifthlmlog.conf
if $programname contains 'hlm-middleware' then /var/log/swift/hlm.log
if $programname contains 'hlm-middleware' and $syslogseverity <= 3 then /var/log/swift/hlm.error
if $programname contains 'hlm-middleware' then ~
if $programname contains 'dispatcher' then /var/log/swift/hlm.log
if $programname contains 'dispatcher' and $syslogseverity <= 3 then /var/log/swift/hlm.error
if $programname contains 'dispatcher' then ~
if $programname contains 'handler' then /var/log/swift/hlm.log
if $programname contains 'handler' and $syslogseverity <= 3 then /var/log/swift/hlm.error
if $programname contains 'handler' then ~
if $programname contains 'connector' then /var/log/swift/hlm.log
if $programname contains 'connector' and $syslogseverity <= 3 then /var/log/swift/hlm.error
if $programname contains 'connector' then ~
Hi @hseipp
I've tried the above solution but no luck.
Before I modified the related files, the sequence of the pipeline is
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache bulk tempurl ratelimit crossdomain container_sync tempauth staticweb container-quotas account-quotas slo dlo versioned_writes proxy-logging hlm proxy-server
and I modified it to
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache bulk tempurl ratelimit crossdomain container_sync tempauth staticweb container-quotas account-quotas slo dlo versioned_writes hlm proxy-logging proxy-server
When I checked out the file '/etc/rsyslog.d/00-swifthlmlog.conf', the raw content is
if $programname contains 'hlm-middleware' then ~ if $programname contains 'dispatcher' then /var/log/swift/hlm.log if $programname contains 'dispatcher' and $syslogseverity <= 3 then /var/log/swift/hlm.error if $programname contains 'dispatcher' then ~ if $programname contains 'handler' then /var/log/swift/hlm.log if $programname contains 'handler' and $syslogseverity <= 3 then /var/log/swift/hlm.error if $programname contains 'handler' then ~ if $programname contains 'connector' then /var/log/swift/hlm.log if $programname contains 'connector' and $syslogseverity <= 3 then /var/log/swift/hlm.error if $programname contains 'connector' then ~
and I modified it to
if $programname contains 'hlm-middleware' then /var/log/swift/hlm.log if $programname contains 'hlm-middleware' and $syslogseverity <= 3 then /var/log/swift/hlm.error if $programname contains 'hlm-middleware' then ~ if $programname contains 'dispatcher' then /var/log/swift/hlm.log if $programname contains 'dispatcher' and $syslogseverity <= 3 then /var/log/swift/hlm.error if $programname contains 'dispatcher' then ~ if $programname contains 'handler' then /var/log/swift/hlm.log if $programname contains 'handler' and $syslogseverity <= 3 then /var/log/swift/hlm.error if $programname contains 'handler' then ~ if $programname contains 'connector' then /var/log/swift/hlm.log if $programname contains 'connector' and $syslogseverity <= 3 then /var/log/swift/hlm.error if $programname contains 'connector' then ~
as you provide and restart swift and swifthlm, and I find no clues in the hlm.log.
Do I need to provide other information to help out the issue?
Best regards, Tommy
Hi @tommyJin did you issue a systemctl restart rsyslog
after modifying the 00-swifthlmlog.conf
file? Also, I'm attaching my 00-swifthlmlog.conf
as your text above misses carriage returns so I'm not sure if your file is properly formatted.
00-swifthlmlog.conf
Note: Github does not let me upload the conf file with the original file name suffix, so you need to rename it after detaching....
Regards,
Harald
Hi, @hseipp I am able to print out the middleware after updating 00-swifthlmlog stuff, but I can not recreate it on another vm. Anyway, the middleware log shows up. Thanks a lot!
Regards, Tommy
Hi @slavisasarafijanovic @hseipp ,
Today I install a new vm with swift2.5 to figure out what causes the log issue.
Basic info: python: 2.7 swift: 2.5.0(Liberty) swifthlm: 0.2.2 master branch(before 2017/06/20 submit) system: CentOS7
Before config HLM in /etc/swift/proxy-server.conf, it's okay to upload file, get an object and download it.
And then I add the HLM part to the /etc/swift/proxy-server.conf
change the code in middleware.py(line 527) to my hostname then install
modify the 'User' value in swifthlm.dispatcher.service
files under /home/mercury/.ssh
reload swift and start swifthlm, but hlm.log is not created.
I did not config the connector part, so the HLM are supposed to use the dummy_connector and I run get obj command
and the status command
Error occurs in proxy.error log, but no hlm.log so far
run migrate, status and requests, the error occurs
and proxy.error log
Right now, the list of logs under /var/log/swift
Would these information help with reproducing the log issue? If you need more settings or config, I am happy to provide if necessary.
Best regards, Tommy