Skip to content

Commit

Permalink
Merge branch 'release/0.5.7'
Browse files Browse the repository at this point in the history
Conflicts:
	src/dyn_stats.c
	src/dyn_stats.h
  • Loading branch information
shailesh33 committed Mar 2, 2016
2 parents 84f77f0 + a1daced commit 16bf7d1
Show file tree
Hide file tree
Showing 75 changed files with 5,467 additions and 3,727 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*.gcda
*.gcno
*.gcov
*.pyc

# Packages
*.tar.gz
Expand Down Expand Up @@ -72,3 +73,7 @@ Makefile.in
/src/test
cscope.out
/src/cscope.out
/test/*.pyc
/test/_binaries/*
/test/_binaries
/test/conf
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ ACLOCAL_AMFLAGS = -I m4

SUBDIRS = contrib src

#dist_man_MANS = man/dynomite.8
dist_man_MANS = man/dynomite.8

EXTRA_DIST = README.md NOTICE LICENSE ChangeLog conf scripts notes
4 changes: 2 additions & 2 deletions conf/a_dc1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ dyn_o_mite:
- 127.0.0.5:8101:rack1:dc2:12345678
listen: 127.0.0.1:8102
servers:
- 127.0.0.1:22122:1
tokens: '12345678'
- 127.0.0.1:22121:1
tokens: '1383429731'
secure_server_option: datacenter
pem_key_file: conf/dynomite.pem
data_store: 0
12 changes: 6 additions & 6 deletions conf/a_dc2_rack1_node1.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
dyn_o_mite:
datacenter: dc2
rack: rack1
dyn_listen: 127.0.0.4:8101
dyn_listen: 127.0.0.2:8101
dyn_seeds:
- 127.0.0.1:8101:rack1:dc1:12345678
- 127.0.0.2:8101:rack2:dc2:1383429731
- 127.0.0.3:8101:rack2:dc2:12345678
- 127.0.0.5:8101:rack1:dc2:12345678
listen: 127.0.0.4:8102
- 127.0.0.1:8101:rack1:dc1:1383429731
- 127.0.0.4:8101:rack2:dc2:1383429731
- 127.0.0.5:8101:rack2:dc2:12345678
- 127.0.0.3:8101:rack1:dc2:12345678
listen: 127.0.0.2:8102
servers:
- 127.0.0.1:22122:1
tokens: '1383429731'
Expand Down
14 changes: 7 additions & 7 deletions conf/a_dc2_rack1_node2.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
dyn_o_mite:
datacenter: dc2
rack: rack1
dyn_listen: 127.0.0.5:8101
dyn_listen: 127.0.0.3:8101
dyn_seeds:
- 127.0.0.1:8101:rack1:dc1:12345678
- 127.0.0.2:8101:rack2:dc2:1383429731
- 127.0.0.3:8101:rack2:dc2:12345678
- 127.0.0.4:8101:rack1:dc2:1383429731
listen: 127.0.0.5:8102
- 127.0.0.1:8101:rack1:dc1:1383429731
- 127.0.0.4:8101:rack2:dc2:1383429731
- 127.0.0.5:8101:rack2:dc2:12345678
- 127.0.0.2:8101:rack1:dc2:1383429731
listen: 127.0.0.3:8102
servers:
- 127.0.0.1:22122:1
- 127.0.0.1:22123:1
tokens: '12345678'
secure_server_option: datacenter
pem_key_file: conf/dynomite.pem
Expand Down
14 changes: 7 additions & 7 deletions conf/a_dc2_rack2_node1.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
dyn_o_mite:
datacenter: dc2
rack: rack2
dyn_listen: 127.0.0.2:8101
dyn_listen: 127.0.0.4:8101
dyn_seeds:
- 127.0.0.1:8101:rack1:dc1:12345678
- 127.0.0.3:8101:rack2:dc2:12345678
- 127.0.0.4:8101:rack1:dc2:1383429731
- 127.0.0.5:8101:rack1:dc2:12345678
listen: 127.0.0.2:8102
- 127.0.0.1:8101:rack1:dc1:1383429731
- 127.0.0.5:8101:rack2:dc2:12345678
- 127.0.0.2:8101:rack1:dc2:1383429731
- 127.0.0.3:8101:rack1:dc2:12345678
listen: 127.0.0.4:8102
servers:
- 127.0.0.1:22122:1
- 127.0.0.1:22124:1
tokens: '1383429731'
secure_server_option: datacenter
pem_key_file: conf/dynomite.pem
Expand Down
14 changes: 7 additions & 7 deletions conf/a_dc2_rack2_node2.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
dyn_o_mite:
datacenter: dc2
rack: rack2
dyn_listen: 127.0.0.3:8101
dyn_listen: 127.0.0.5:8101
dyn_seeds:
- 127.0.0.1:8101:rack1:dc1:12345678
- 127.0.0.2:8101:rack2:dc2:1383429731
- 127.0.0.4:8101:rack1:dc2:1383429731
- 127.0.0.5:8101:rack1:dc2:12345678
listen: 127.0.0.3:8102
- 127.0.0.1:8101:rack1:dc1:1383429731
- 127.0.0.4:8101:rack2:dc2:1383429731
- 127.0.0.2:8101:rack1:dc2:1383429731
- 127.0.0.3:8101:rack1:dc2:12345678
listen: 127.0.0.5:8102
servers:
- 127.0.0.1:22122:1
- 127.0.0.1:22125:1
tokens: '12345678'
secure_server_option: datacenter
pem_key_file: conf/dynomite.pem
Expand Down
18 changes: 9 additions & 9 deletions conf/dynomite_florida_single.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dyn_o_mite:
datacenter: dc
rack: rack1
dyn_listen: 0.0.0.0:8101
dyn_seed_provider: florida_provider
listen: 0.0.0.0:8102
servers:
rack: rack1
dyn_listen: 0.0.0.0:8101
dyn_seed_provider: florida_provider
listen: 0.0.0.0:8102
servers:
- 127.0.0.1:6379:1
tokens: '0'
secure_server_option: datacenter
pem_key_file: conf/dynomite.pem
data_store: 0
tokens: '0'
secure_server_option: datacenter
pem_key_file: conf/dynomite.pem
data_store: 0
14 changes: 14 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# Add support for m4_esyscmd_s to autoconf-2.63 (used in RHEL/CentOS 6.7)
m4_ifndef([m4_esyscmd_s], [m4_define([m4_chomp_all], [m4_format([[%.*s]], m4_bregexp(m4_translit([[$1]], [/], [/ ]), [/*$]), [$1])])])
m4_ifndef([m4_esyscmd_s], [m4_define([m4_esyscmd_s], [m4_chomp_all(m4_esyscmd([$1]))])])

# Define the package version numbers and the bug reporting address
m4_define([DN_MAJOR], 0)
m4_define([DN_MINOR], 5)
m4_define([DN_PATCH], 6)
m4_define([DN_BUGS], [[email protected]])
m4_define([DN_VERSION_STRING], m4_esyscmd_s([git describe --dirty --always --tags]))

# Initialize autoconf
AC_PREREQ([2.63])
<<<<<<< .merge_file_a7S2ED
AC_INIT([dynomite], [DN_MAJOR.DN_MINOR.DN_PATCH], [DN_BUGS])
=======
AC_INIT([dynomite], [DN_VERSION_STRING], [DN_BUGS])
>>>>>>> .merge_file_YwhkOZ
AC_CONFIG_SRCDIR([src/dynomite.c])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_HEADERS([config.h:config.h.in])
Expand Down Expand Up @@ -211,7 +220,12 @@ AC_CONFIG_FILES([Makefile
src/hashkit/Makefile
src/proto/Makefile
src/seedsprovider/Makefile
<<<<<<< .merge_file_a7S2ED
src/event/Makefile])
=======
src/event/Makefile
src/tools/Makefile])
>>>>>>> .merge_file_YwhkOZ

# Generate the "configure" script
AC_OUTPUT
91 changes: 91 additions & 0 deletions docs/florida.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Florida

## Florida Multi-Cluster Solution

Let's say you want to have multiple clusters so you need to have different Florida URLs providing different seeds for each cluster. In such a case, the following environment variables can be used to customize the behavior of Dynomite without requiring a custom build (via Make).

- `DYNOMITE_FLORIDA_IP`
- `DYNOMITE_FLORIDA_PORT`
- `DYNOMITE_FLORIDA_REQUEST`

The Florida server only reads the environment variables one time when the server is started. If the environment variables are not present (NULL) the code will use the macros or CFLAGS values. This is great because it allows us to use the same binary all the time, and then later when I deploy the code into ASGARD I can have just different user data since is just a matter of export different values to the AMI/Linux. There is a minor FIX of YAML syntax as well.

So for instance someone can have in the `/etc/profile`

```bash
export DYNOMITE_FLORIDA_PORT=8080
export DYNOMITE_FLORIDA_IP="127.0.0.1"
export DYNOMITE_FLORIDA_REQUEST="GET /florida/cluster1/get_seeds.txt HTTP/1.0
Host: 127.0.0.1
User-Agent: HTMLGET 1.0
"
```

and for another box just

```bash
export DYNOMITE_FLORIDA_PORT=8080
export DYNOMITE_FLORIDA_IP="127.0.0.1"
export DYNOMITE_FLORIDA_REQUEST="GET /florida/cluster2/get_seeds.txt HTTP/1.0
Host: 127.0.0.1
User-Agent: HTMLGET 1.0
"
```

Even pass this through ASGARD via user_data.

Then build dynomite normally like:

```bash
sudo autoreconf -fvi ; sudo ./configure --enable-debug=log ; sudo make;
```

And Run:

```bash
sudo --preserve-env src/dynomite -c conf/dynomite_florida_single.yml
```

And it works :-)

## florida.js

`florida.js` is an http server that returns a list of seed nodes via a REST API.

### Command

```bash
node florida.js [file] [debug]
```

**file** must be a path to a `seeds.list` file. The default `seeds.list` file is `/etc/dynomite/seeds.list`.

**debug** is written as the string "debug" (without the quotes).

### Run in debug mode

You can run `florida.js` in debug mode (i.e. with messages logged to the console) with the following command.

```bash
cd scripts/Florida

npm run debug
```

### Run with a custom seeds file

```bash
cd scripts/Florida

node florida.js ./seeds.list
```

### Run with a custom seeds file in debug mode

```bash
cd scripts/Florida

node florida.js ./seeds.list debug
```
63 changes: 63 additions & 0 deletions init/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# README

The `init` directory is the location for all System V init, Upstart, systemd, etc. initialization scripts.

## systemd on RHEL 7

Create the `dynomite` user.

```bash
mkdir -p /usr/share/dynomite

mkdir /var/run/dynomite

useradd -r -M -c "Dynomite server" -s /sbin/nologin -d /usr/share/dynomite dynomite

chown -R dynomite:dynomite /usr/share/dynomite

chown -R dynomite:dynomite /var/run/dynomite
```

Install the Dynomite service file and the associated sysconfig file.

```bash
cp init/systemd_environment__dynomite /etc/sysconfig/dynomite

cp init/systemd_service_rhel__dynomite.service /usr/lib/systemd/system/dynomite.service

systemctl daemon-reload

systemctl enable dynomite

systemctl status dynomite
```

## systemd on Ubuntu 15.10

Create the `dynomite` user.

```bash
mkdir -p /usr/share/dynomite

mkdir /var/run/dynomite

useradd -r -M -c "Dynomite server" -s /sbin/nologin -d /usr/share/dynomite dynomite

chown -R dynomite:dynomite /usr/share/dynomite

chown -R dynomite:dynomite /var/run/dynomite
```

Install the Dynomite service file and the associated sysconfig file.

```bash
cp init/systemd_environment__dynomite /etc/default/dynomite

cp init/systemd_service_ubuntu__dynomite.service /lib/systemd/system/dynomite.service

systemctl daemon-reload

systemctl enable dynomite

systemctl status dynomite
```
1 change: 1 addition & 0 deletions init/systemd_environment__dynomite
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DYNOMITE_CONF=/etc/dynomite/dynomite.yml
20 changes: 20 additions & 0 deletions init/systemd_service_rhel__dynomite.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[Unit]
Description=Dynomite server
; Services that should be started before Dynomite
After=network.target nss-lookup.target time-sync.target
Documentation=man:dynomite(8)

[Service]
User=dynomite
; Default environment variable values
Environment=DYNOMITE_CONF=/etc/dynomite/dynomite.yaml
Type=forking
; Environment vars to customize startup
EnvironmentFile=-/etc/sysconfig/dynomite
ExecStart=/usr/local/sbin/dynomite -d -c $DYNOMITE_CONF -p /var/run/dynomite/dynomite.pid
; Restart dynomite every 100ms
Restart=always
PIDFile=/var/run/dynomite/dynomite.pid

[Install]
WantedBy=multi-user.target
20 changes: 20 additions & 0 deletions init/systemd_service_ubuntu__dynomite.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[Unit]
Description=Dynomite server
; Services that should be started before Dynomite
After=network.target nss-lookup.target time-sync.target
Documentation=man:dynomite(8)

[Service]
User=dynomite
; Default environment variable values
Environment=DYNOMITE_CONF=/etc/dynomite/dynomite.yaml
Type=forking
; Environment vars to customize startup
EnvironmentFile=-/etc/default/dynomite
ExecStart=/usr/local/sbin/dynomite -d -c $DYNOMITE_CONF -p /var/run/dynomite/dynomite.pid
; Restart dynomite every 100ms
Restart=always
PIDFile=/var/run/dynomite/dynomite.pid

[Install]
WantedBy=multi-user.target
Loading

0 comments on commit 16bf7d1

Please sign in to comment.