-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Support for connecting to DB in namespace via TCP port in multi-asic platform. #4779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a9e6c71
24a95e8
525a97c
1390649
80e77b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,12 @@ stderr_logfile=syslog | |
| {% if INSTANCES %} | ||
| {% for redis_inst, redis_items in INSTANCES.iteritems() %} | ||
| [program: {{ redis_inst }}] | ||
| command=/bin/bash -c "{ [[ -s /var/lib/{{ redis_inst }}/dump.rdb ]] || rm -f /var/lib/{{ redis_inst }}/dump.rdb; } && mkdir -p /var/lib/{{ redis_inst }} && exec /usr/bin/redis-server /etc/redis/redis.conf --port {{ redis_items['port'] }} --unixsocket {{ redis_items['unix_socket_path'] }} --pidfile /var/run/redis/{{ redis_inst }}.pid --dir /var/lib/{{ redis_inst }}" | ||
| {% if redis_items['hostname'] != '127.0.0.1' %} | ||
| {%- set LOOPBACK_IP = '127.0.0.1' -%} | ||
| {%- else -%} | ||
| {%- set LOOPBACK_IP = '' -%} | ||
| {%- endif -%} | ||
| command=/bin/bash -c "{ [[ -s /var/lib/{{ redis_inst }}/dump.rdb ]] || rm -f /var/lib/{{ redis_inst }}/dump.rdb; } && mkdir -p /var/lib/{{ redis_inst }} && exec /usr/bin/redis-server /etc/redis/redis.conf --bind {{ LOOPBACK_IP }} {{ redis_items['hostname'] }} --port {{ redis_items['port'] }} --unixsocket {{ redis_items['unix_socket_path'] }} --pidfile /var/run/redis/{{ redis_inst }}.pid --dir /var/lib/{{ redis_inst }}" | ||
judyjoseph marked this conversation as resolved.
Show resolved
Hide resolved
judyjoseph marked this conversation as resolved.
Show resolved
Hide resolved
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just wonder is there any case both LOOPBACK_IP and HOST_IP are empty, if there is a case , the --bind without parameter will work or NOT ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This case should not happen as the LOOPBACK_IP is hardcoded to 127.0.0.1 , the HOST_IP is either 127.0.0.1 ( in case of linux host namespace ) or the docker0 IP address in case of namespaces. But I can add the the default fallback IP of 127.0.0.1, if this error scenario arises.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the code, so that if we are not able to get the ip address correctly from interface, it is set to loopback ip 127.0.0.1 as the default.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dzhangalibaba let me know it this was ok ? |
||
| priority=2 | ||
| autostart=true | ||
| autorestart=false | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.