This repository has been archived by the owner on Oct 30, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:linkedin/indextank-service
- Loading branch information
Showing
33 changed files
with
326 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#! /bin/sh | ||
|
||
PATH=.:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
NAME=indexengine-nebu-controller | ||
|
||
. /lib/lsb/init-functions | ||
|
||
case "$1" in | ||
start) | ||
log_daemon_msg "Starting" "$NAME" | ||
svc -u /etc/service/$NAME | ||
log_end_msg $? | ||
;; | ||
stop) | ||
cd $APP_DIR | ||
log_daemon_msg "Stopping" "$NAME" | ||
svc -d /etc/service/$NAME | ||
log_end_msg $? | ||
;; | ||
restart) | ||
log_daemon_msg "Restarting" "$NAME" | ||
svc -t /etc/service/$NAME | ||
log_end_msg $? | ||
;; | ||
status) | ||
svok /etc/service/$NAME | ||
log_end_msg $? | ||
;; | ||
*) | ||
N=/etc/init.d/$NAME | ||
echo "Usage: $N {start|stop|restart|status}" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
if [ ! -d /mnt/logs/controller ]; then | ||
rm -fr /etc/service/indexengine-nebu-controller/log/main | ||
mkdir -p /mnt/logs/controller /mnt/indexes | ||
ln -s /mnt/logs/controller /etc/service/indexengine-nebu-controller/log/main | ||
echo PROD >/mnt/env.name | ||
chown -R indextank:indextank /mnt | ||
ln -s /mnt /data | ||
fi | ||
|
||
/usr/bin/svscanboot & | ||
exit 0 | ||
|
8 changes: 8 additions & 0 deletions
8
nebu/sample-config/etc/service/indexengine-nebu-controller/run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
cd /home/indextank/nebu | ||
|
||
echo "Supervise starting controller" | ||
# start a local controller | ||
exec sudo -u indextank DJANGO_SETTINGS_MODULE=settings PYTHONPATH=../ /usr/bin/python controller.py 2>&1 | ||
echo "Supervise (controller) ending" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
127.0.0.1 localhost | ||
|
||
127.0.0.1 database api storage deploymanager workermanager fend | ||
|
||
# The following lines are desirable for IPv6 capable hosts | ||
::1 ip6-localhost ip6-loopback | ||
fe00::0 ip6-localnet | ||
ff00::0 ip6-mcastprefix | ||
ff02::1 ip6-allnodes | ||
ff02::2 ip6-allrouters | ||
ff02::3 ip6-allhosts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
upstream api { | ||
ip_hash; | ||
server unix:/var/nginx/api-uwsgi.sock; | ||
} | ||
|
||
server { | ||
listen 80; | ||
listen 443 default ssl; | ||
server_name *.api.indextank.com; | ||
client_max_body_size 20m; | ||
|
||
location / { | ||
limit_conn one 45; | ||
uwsgi_pass api; | ||
include uwsgi_params; | ||
} | ||
|
||
error_page 411 = @empty_body; | ||
|
||
location @empty_body { | ||
uwsgi_pass api; | ||
include uwsgi_params; | ||
} | ||
} | ||
|
16 changes: 16 additions & 0 deletions
16
sample-config/etc/nginx/sites-available/backoffice_fcgi.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
server { | ||
listen 80; | ||
server_name backoffice.indextank.com; | ||
client_max_body_size 1m; | ||
|
||
location / { | ||
fastcgi_pass 127.0.0.1:4200; | ||
include fastcgi_params; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root html; | ||
} | ||
} | ||
|
47 changes: 47 additions & 0 deletions
47
sample-config/etc/nginx/sites-available/storefront_fcgi.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
server { | ||
listen 80; | ||
server_name indextank.com www.indextank.com; | ||
client_max_body_size 1m; | ||
|
||
location / { | ||
fastcgi_pass 127.0.0.1:4300; | ||
include fastcgi_params; | ||
} | ||
|
||
location /_static { | ||
expires 24h; | ||
autoindex on; | ||
alias /home/indextank/storefront/static/; | ||
} | ||
|
||
location /nginx_status { | ||
stub_status on; | ||
access_log off; | ||
deny all; | ||
allow 127.0.0.1; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root html; | ||
} | ||
} | ||
|
||
server { | ||
listen 443; | ||
ssl on; | ||
server_name indextank.com www.indextank.com; | ||
client_max_body_size 1m; | ||
|
||
location / { | ||
fastcgi_pass 127.0.0.1:4300; | ||
include fastcgi_params; | ||
fastcgi_param HTTPS on; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root html; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../sites-available/api-uwsgi.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../sites-available/backoffice_fcgi.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../sites-available/storefront_fcgi.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh -e | ||
# | ||
# rc.local | ||
# | ||
# This script is executed at the end of each multiuser runlevel. | ||
# Make sure that the script will "exit 0" on success or any other | ||
# value on error. | ||
# | ||
# In order to enable or disable this script just change the execution | ||
# bits. | ||
# | ||
# By default this script does nothing. | ||
|
||
rm -fr /mnt/lost+found/ | ||
mkdir -p /data/pids /data/bkp /data/logs/api-rot | ||
echo PROD >/data/env.name | ||
chown -R indextank:indextank /mnt | ||
exit 0 |
Oops, something went wrong.