Skip to content

Commit

Permalink
misc: trim trailing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
spinlock committed Apr 20, 2017
1 parent fd37657 commit b9b2ccd
Show file tree
Hide file tree
Showing 19 changed files with 52 additions and 52 deletions.
4 changes: 2 additions & 2 deletions admin/codis-dashboard-admin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ start)
echo "starting codis-dashboard ... "
if [ -f "$CODIS_DASHBOARD_PID_FILE" ]; then
if kill -0 `cat "$CODIS_DASHBOARD_PID_FILE"` > /dev/null 2>&1; then
echo $command already running as process `cat "$CODIS_DASHBOARD_PID_FILE"`.
echo $command already running as process `cat "$CODIS_DASHBOARD_PID_FILE"`.
exit 0
fi
fi
nohup "$CODIS_DASHBOARD_BIN" "--config=${CODIS_DASHBOARD_CONF_FILE}" \
"--log=$CODIS_DASHBOARD_LOG_FILE" "--log-level=INFO" "--pidfile=$CODIS_DASHBOARD_PID_FILE" > "$CODIS_DASHBOARD_DAEMON_FILE" 2>&1 < /dev/null &
"--log=$CODIS_DASHBOARD_LOG_FILE" "--log-level=INFO" "--pidfile=$CODIS_DASHBOARD_PID_FILE" > "$CODIS_DASHBOARD_DAEMON_FILE" 2>&1 < /dev/null &
;;
start-foreground)
$CODIS_DASHBOARD_BIN "--config=${CODIS_DASHBOARD_CONF_FILE}" \
Expand Down
4 changes: 2 additions & 2 deletions admin/codis-fe-admin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ start)
echo "starting codis-fe ... "
if [ -f "$CODIS_FE_PID_FILE" ]; then
if kill -0 `cat "$CODIS_FE_PID_FILE"` > /dev/null 2>&1; then
echo $command already running as process `cat "$CODIS_FE_PID_FILE"`.
echo $command already running as process `cat "$CODIS_FE_PID_FILE"`.
exit 0
fi
fi
nohup "$CODIS_FE_BIN" "--assets-dir=${CODIS_FE_ASSETS_DIR}" "--$COORDINATOR_NAME=$COORDINATOR_ADDR" \
"--log=$CODIS_FE_LOG_FILE" "--pidfile=$CODIS_FE_PID_FILE" "--log-level=INFO" "--listen=$CODIS_FE_ADDR" > "$CODIS_FE_DAEMON_FILE" 2>&1 < /dev/null &
"--log=$CODIS_FE_LOG_FILE" "--pidfile=$CODIS_FE_PID_FILE" "--log-level=INFO" "--listen=$CODIS_FE_ADDR" > "$CODIS_FE_DAEMON_FILE" 2>&1 < /dev/null &
;;
start-foreground)
$CODIS_FE_BIN "--assets-dir=${CODIS_FE_ASSETS_DIR}" "--$COORDINATOR_NAME=$COORDINATOR_ADDR" \
Expand Down
4 changes: 2 additions & 2 deletions admin/codis-proxy-admin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ start)
echo "starting codis-proxy ... "
if [ -f "$CODIS_PROXY_PID_FILE" ]; then
if kill -0 `cat "$CODIS_PROXY_PID_FILE"` > /dev/null 2>&1; then
echo $command already running as process `cat "$CODIS_PROXY_PID_FILE"`.
echo $command already running as process `cat "$CODIS_PROXY_PID_FILE"`.
exit 0
fi
fi
nohup "$CODIS_PROXY_BIN" "--config=${CODIS_PROXY_CONF_FILE}" "--dashboard=${CODIS_DASHBOARD_ADDR}" \
"--log=$CODIS_PROXY_LOG_FILE" "--log-level=INFO" "--ncpu=4" "--pidfile=$CODIS_PROXY_PID_FILE" > "$CODIS_PROXY_DAEMON_FILE" 2>&1 < /dev/null &
"--log=$CODIS_PROXY_LOG_FILE" "--log-level=INFO" "--ncpu=4" "--pidfile=$CODIS_PROXY_PID_FILE" > "$CODIS_PROXY_DAEMON_FILE" 2>&1 < /dev/null &
;;
start-foreground)
$CODIS_PROXY_BIN "--config=${CODIS_PROXY_CONF_FILE}" "--dashboard=${CODIS_DASHBOARD_ADDR}" \
Expand Down
4 changes: 2 additions & 2 deletions admin/codis-server-admin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ start)
echo "starting codis-server ... "
if [ -f "$CODIS_SERVER_PID_FILE" ]; then
if kill -0 `cat "$CODIS_SERVER_PID_FILE"` > /dev/null 2>&1; then
echo $command already running as process `cat "$CODIS_SERVER_PID_FILE"`.
echo $command already running as process `cat "$CODIS_SERVER_PID_FILE"`.
exit 0
fi
fi
nohup "$CODIS_SERVER_BIN" "${CODIS_SERVER_CONF_FILE}" > "$CODIS_SERVER_DAEMON_FILE" 2>&1 < /dev/null &
nohup "$CODIS_SERVER_BIN" "${CODIS_SERVER_CONF_FILE}" > "$CODIS_SERVER_DAEMON_FILE" 2>&1 < /dev/null &
;;
stop)
echo "stopping codis-server ... "
Expand Down
2 changes: 1 addition & 1 deletion ansible/group_vars/all
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
codis_dir: /home/codis/codis
codis_dir: /home/codis/codis

coordinator_name: filesystem

Expand Down
6 changes: 3 additions & 3 deletions ansible/roles/codis-dashboard/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
- name: Copy codis-admin binary
copy: src={{ codis_dir }}/bin/codis-admin dest={{ codis_install_dir }}/bin/codis-admin mode=766

- name: Copy codis-dashboard binary
- name: Copy codis-dashboard binary
copy: src={{ codis_dir }}/bin/codis-dashboard dest={{ codis_install_dir }}/bin/codis-dashboard mode=766

- name: Copy codis-dashboard configuration
template: src=dashboard.toml dest={{ codis_install_dir }}/config/dashboard.toml

- name: Copy codis-dashboard admin script
- name: Copy codis-dashboard admin script
template: src=codis-dashboard-admin.sh dest={{ codis_install_dir }}/admin/codis-dashboard-admin.sh mode=766

- name: Restart codis-dashboard service
- name: Restart codis-dashboard service
command: "{{ codis_install_dir }}/admin/codis-dashboard-admin.sh restart"
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ start)
echo "starting codis-dashboard ... "
if [ -f "$CODIS_DASHBOARD_PID_FILE" ]; then
if kill -0 `cat "$CODIS_DASHBOARD_PID_FILE"` > /dev/null 2>&1; then
echo $command already running as process `cat "$CODIS_DASHBOARD_PID_FILE"`.
echo $command already running as process `cat "$CODIS_DASHBOARD_PID_FILE"`.
exit 0
fi
fi
nohup "$CODIS_DASHBOARD_BIN" "--config=${CODIS_DASHBOARD_CONF_FILE}" \
"--log=$CODIS_DASHBOARD_LOG_FILE" "--log-level=INFO" "--pidfile=$CODIS_DASHBOARD_PID_FILE" > "$CODIS_DASHBOARD_DAEMON_FILE" 2>&1 < /dev/null &
"--log=$CODIS_DASHBOARD_LOG_FILE" "--log-level=INFO" "--pidfile=$CODIS_DASHBOARD_PID_FILE" > "$CODIS_DASHBOARD_DAEMON_FILE" 2>&1 < /dev/null &
;;
start-foreground)
$CODIS_DASHBOARD_BIN "--config=${CODIS_DASHBOARD_CONF_FILE}" \
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/codis-dashboard/templates/dashboard.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ product_name = "{{ product_name }}"
product_auth = "{{ product_auth }}"

# Set bind address for admin(rpc), tcp only.
admin_addr = "{{ dashboard_addr }}"
admin_addr = "{{ dashboard_addr }}"

# Set arguments for data migration (only accept 'sync' & 'semi-async').
migration_method = "semi-async"
Expand Down
8 changes: 4 additions & 4 deletions ansible/roles/codis-fe/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
- name: Copy codis-fe binary
- name: Copy codis-fe binary
copy: src={{ codis_dir }}/bin/codis-fe dest={{ codis_install_dir }}/bin/codis-fe mode=766

- name: Copy codis-fe assets
- name: Copy codis-fe assets
command: cp -r {{ codis_dir }}/bin/assets {{ codis_install_dir }}/bin

- name: Copy codis-fe admin script
- name: Copy codis-fe admin script
template: src=codis-fe-admin.sh dest={{ codis_install_dir }}/admin/codis-fe-admin.sh mode=766

- name: Restart codis-fe service
- name: Restart codis-fe service
command: "{{ codis_install_dir }}/admin/codis-fe-admin.sh restart"
4 changes: 2 additions & 2 deletions ansible/roles/codis-fe/templates/codis-fe-admin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ start)
echo "starting codis-fe ... "
if [ -f "$CODIS_FE_PID_FILE" ]; then
if kill -0 `cat "$CODIS_FE_PID_FILE"` > /dev/null 2>&1; then
echo $command already running as process `cat "$CODIS_FE_PID_FILE"`.
echo $command already running as process `cat "$CODIS_FE_PID_FILE"`.
exit 0
fi
fi
nohup "$CODIS_FE_BIN" "--assets-dir=${CODIS_FE_ASSETS_DIR}" "--$COORDINATOR_NAME=$COORDINATOR_ADDR" \
"--log=$CODIS_FE_LOG_FILE" "--pidfile=$CODIS_FE_PID_FILE" "--log-level=INFO" "--listen=$CODIS_FE_ADDR" > "$CODIS_FE_DAEMON_FILE" 2>&1 < /dev/null &
"--log=$CODIS_FE_LOG_FILE" "--pidfile=$CODIS_FE_PID_FILE" "--log-level=INFO" "--listen=$CODIS_FE_ADDR" > "$CODIS_FE_DAEMON_FILE" 2>&1 < /dev/null &
;;
start-foreground)
$CODIS_FE_BIN "--assets-dir=${CODIS_FE_ASSETS_DIR}" "--$COORDINATOR_NAME=$COORDINATOR_ADDR" \
Expand Down
6 changes: 3 additions & 3 deletions ansible/roles/codis-proxy/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
- name: Copy codis-proxy binary
- name: Copy codis-proxy binary
copy: src={{ codis_dir }}/bin/codis-proxy dest={{ codis_install_dir }}/bin/codis-proxy mode=766

- name: Copy codis-proxy configuration
template: src=proxy.toml dest={{ codis_install_dir }}/config/proxy.toml

- name: Copy codis-proxy admin script
- name: Copy codis-proxy admin script
template: src=codis-proxy-admin.sh dest={{ codis_install_dir }}/admin/codis-proxy-admin.sh mode=766

- name: Restart codis-proxy service
- name: Restart codis-proxy service
command: "{{ codis_install_dir }}/admin/codis-proxy-admin.sh restart"
4 changes: 2 additions & 2 deletions ansible/roles/codis-proxy/templates/codis-proxy-admin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ start)
echo "starting codis-proxy ... "
if [ -f "$CODIS_PROXY_PID_FILE" ]; then
if kill -0 `cat "$CODIS_PROXY_PID_FILE"` > /dev/null 2>&1; then
echo $command already running as process `cat "$CODIS_PROXY_PID_FILE"`.
echo $command already running as process `cat "$CODIS_PROXY_PID_FILE"`.
exit 0
fi
fi
nohup "$CODIS_PROXY_BIN" "--config=${CODIS_PROXY_CONF_FILE}" "--dashboard=${CODIS_DASHBOARD_ADDR}" \
"--log=$CODIS_PROXY_LOG_FILE" "--log-level=INFO" "--ncpu=4" "--pidfile=$CODIS_PROXY_PID_FILE" > "$CODIS_PROXY_DAEMON_FILE" 2>&1 < /dev/null &
"--log=$CODIS_PROXY_LOG_FILE" "--log-level=INFO" "--ncpu=4" "--pidfile=$CODIS_PROXY_PID_FILE" > "$CODIS_PROXY_DAEMON_FILE" 2>&1 < /dev/null &
;;
start-foreground)
$CODIS_PROXY_BIN "--config=${CODIS_PROXY_CONF_FILE}" "--dashboard=${CODIS_DASHBOARD_ADDR}" \
Expand Down
6 changes: 3 additions & 3 deletions ansible/roles/codis-server/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
- name: Create codis server work directory
file: path={{ codis_server_workdir }} state=directory owner=codis group=codis

- name: Copy codis-server binary
- name: Copy codis-server binary
copy: src={{ codis_dir }}/bin/codis-server dest={{ codis_install_dir }}/bin/codis-server mode=766

- name: Copy codis-server configuration
template: src=redis.conf dest={{ codis_install_dir }}/config/redis.conf

- name: Copy codis-server admin script
- name: Copy codis-server admin script
template: src=codis-server-admin.sh dest={{ codis_install_dir }}/admin/codis-server-admin.sh mode=766

- name: Restart codis-server service
- name: Restart codis-server service
command: "{{ codis_install_dir }}/admin/codis-server-admin.sh restart"
4 changes: 2 additions & 2 deletions ansible/roles/codis-server/templates/codis-server-admin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ start)
echo "starting codis-server ... "
if [ -f "$CODIS_SERVER_PID_FILE" ]; then
if kill -0 `cat "$CODIS_SERVER_PID_FILE"` > /dev/null 2>&1; then
echo $command already running as process `cat "$CODIS_SERVER_PID_FILE"`.
echo $command already running as process `cat "$CODIS_SERVER_PID_FILE"`.
exit 0
fi
fi
nohup "$CODIS_SERVER_BIN" "${CODIS_SERVER_CONF_FILE}" > "$CODIS_SERVER_DAEMON_FILE" 2>&1 < /dev/null &
nohup "$CODIS_SERVER_BIN" "${CODIS_SERVER_CONF_FILE}" > "$CODIS_SERVER_DAEMON_FILE" 2>&1 < /dev/null &
;;
stop)
echo "stopping codis-server ... "
Expand Down
8 changes: 4 additions & 4 deletions ansible/roles/codis-server/templates/redis.conf
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected-mode yes

# Accept connections on the specified port, default is 6379 (IANA #815344).
# If port 0 is specified Redis will not listen on a TCP socket.
port {{ codis_server_port }}
port {{ codis_server_port }}

# TCP listen() backlog.
#
Expand Down Expand Up @@ -244,7 +244,7 @@ dbfilename dump.rdb
# The Append Only File will also be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
dir {{ codis_server_workdir }}
dir {{ codis_server_workdir }}

################################# REPLICATION #################################

Expand All @@ -269,7 +269,7 @@ dir {{ codis_server_workdir }}
# starting the replication synchronization process, otherwise the master will
# refuse the slave request.
#
masterauth {{ product_auth }}
masterauth {{ product_auth }}

# When a slave loses its connection with the master, or when the replication
# is still in progress, the slave can act in two different ways:
Expand Down Expand Up @@ -477,7 +477,7 @@ slave-priority 100
# 150k passwords per second against a good box. This means that you should
# use a very strong password otherwise it will be very easy to break.
#
requirepass {{ product_auth }}
requirepass {{ product_auth }}

# Command renaming.
#
Expand Down
6 changes: 3 additions & 3 deletions ansible/roles/redis-sentinel/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
- name: Create redis sentinel work directory
file: path={{ redis_sentinel_workdir }} state=directory owner=codis group=codis

- name: Copy redis-sentinel binary
- name: Copy redis-sentinel binary
copy: src={{ codis_dir }}/bin/codis-server dest={{ codis_install_dir }}/bin/redis-sentinel mode=766

- name: Copy redis-sentinel configuration
template: src=sentinel.conf dest={{ codis_install_dir }}/config/sentinel.conf

- name: Copy redis-sentinel admin script
- name: Copy redis-sentinel admin script
template: src=redis-sentinel-admin.sh dest={{ codis_install_dir }}/admin/redis-sentinel-admin.sh mode=766

- name: Restart redis-sentinel service
- name: Restart redis-sentinel service
command: "{{ codis_install_dir }}/admin/redis-sentinel-admin.sh restart"
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ start)
echo "starting redis-sentinel ... "
if [ -f "$REDIS_SENTINEL_PID_FILE" ]; then
if kill -0 `cat "$REDIS_SENTINEL_PID_FILE"` > /dev/null 2>&1; then
echo $command already running as process `cat "$REDIS_SENTINEL_PID_FILE"`.
echo $command already running as process `cat "$REDIS_SENTINEL_PID_FILE"`.
exit 0
fi
fi
nohup "$REDIS_SENTINEL_BIN" "${REDIS_SENTINEL_CONF_FILE}" > "$REDIS_SENTINEL_DAEMON_FILE" 2>&1 < /dev/null &
nohup "$REDIS_SENTINEL_BIN" "${REDIS_SENTINEL_CONF_FILE}" > "$REDIS_SENTINEL_DAEMON_FILE" 2>&1 < /dev/null &
;;
stop)
echo "stopping redis-sentinel ... "
Expand Down
10 changes: 5 additions & 5 deletions ansible/roles/redis-sentinel/templates/sentinel.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# port <sentinel-port>
# The port that this sentinel instance will run on
port {{ redis_sentinel_port }}
port {{ redis_sentinel_port }}

daemonize yes

Expand Down Expand Up @@ -52,7 +52,7 @@ pidfile "{{ redis_sentinel_workdir }}/sentinel_{{ redis_sentinel_port }}.pid"
# For Redis Sentinel to chdir to /tmp at startup is the simplest thing
# for the process to don't interfere with administrative tasks such as
# unmounting filesystems.
dir {{ redis_sentinel_workdir }}
dir {{ redis_sentinel_workdir }}

# sentinel monitor <master-name> <ip> <redis-port> <quorum>
#
Expand Down Expand Up @@ -157,7 +157,7 @@ dir {{ redis_sentinel_workdir }}
# NOTIFICATION SCRIPT
#
# sentinel notification-script <master-name> <script-path>
#
#
# Call the specified notification script for any sentinel event that is
# generated in the WARNING level (for instance -sdown, -odown, and so forth).
# This script should notify the system administrator via email, SMS, or any
Expand All @@ -181,14 +181,14 @@ dir {{ redis_sentinel_workdir }}
# When the master changed because of a failover a script can be called in
# order to perform application-specific tasks to notify the clients that the
# configuration has changed and the master is at a different address.
#
#
# The following arguments are passed to the script:
#
# <master-name> <role> <state> <from-ip> <from-port> <to-ip> <to-port>
#
# <state> is currently always "failover"
# <role> is either "leader" or "observer"
#
#
# The arguments from-ip, from-port, to-ip, to-port are used to communicate
# the old address of the master and the new address of the elected slave
# (now a master).
Expand Down
14 changes: 7 additions & 7 deletions ansible/site.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
---
- name: codis environment init
hosts: all
- name: codis environment init
hosts: all
remote_user: codis
roles:
- common
- common

- name: Install codis-dashboard
hosts: codis-dashboard-servers
remote_user: codis
roles:
- codis-dashboard
- codis-dashboard

- name: Install codis-proxy
hosts: codis-proxy-servers
remote_user: codis
roles:
- codis-proxy
- codis-proxy

- name: Install codis-server
hosts: codis-servers
remote_user: codis
roles:
- codis-server
- codis-server

- name: Install redis-sentinel
hosts: redis-sentinel-servers
Expand All @@ -33,4 +33,4 @@
hosts: codis-fe-servers
remote_user: codis
roles:
- codis-fe
- codis-fe

0 comments on commit b9b2ccd

Please sign in to comment.