From 8f4c29a055915cd71a2292c10e249fccaf7c500f Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Thu, 1 Oct 2020 16:24:46 -0700 Subject: [PATCH 01/14] fix(Dgraph): Deprecate lru_mb flag. --- .../config/backups/azure/charts/dgraph_config.yaml | 1 - contrib/config/backups/azure/docker-compose.yml | 2 +- contrib/config/backups/gcp/charts/dgraph_config.yaml | 1 - contrib/config/backups/gcp/docker-compose.yml | 2 +- contrib/config/backups/s3/charts/dgraph_config.yaml | 1 - contrib/config/backups/s3/docker-compose.yml | 2 +- contrib/config/datadog/docker-compose.yml | 4 ++-- contrib/config/docker/docker-compose-ha.yml | 12 ++++++------ contrib/config/docker/docker-compose-multi.yml | 6 +++--- contrib/config/docker/docker-compose.yml | 2 +- contrib/embargo/embargo.yml | 6 +++--- contrib/standalone/run.sh | 8 +------- contrib/systemd/centos/dgraph-alpha.service | 2 +- contrib/systemd/ha_cluster/dgraph-alpha.service | 2 +- .../systemd/ha_cluster/tests/centos8/provision.sh | 2 +- .../systemd/ha_cluster/tests/ubuntu1804/provision.sh | 2 +- contrib/tlstest/alpha_tls.sh | 2 +- dgraph/cmd/alpha/mutations_mode/docker-compose.yml | 6 +++--- dgraph/cmd/bulk/systest/docker-compose.yml | 2 +- dgraph/docker-compose.yml | 12 ++++++------ graphql/e2e/auth/debug_off/docker-compose.yml | 4 ++-- graphql/e2e/auth/docker-compose.yml | 4 ++-- graphql/e2e/custom_logic/docker-compose.yml | 2 +- graphql/e2e/directives/docker-compose.yml | 4 ++-- graphql/e2e/normal/docker-compose.yml | 4 ++-- graphql/e2e/schema/docker-compose.yml | 6 +++--- graphql/e2e/subscription/docker-compose.yml | 6 +++--- ocagent/docker-compose.yml | 2 +- systest/1million/docker-compose.yml | 6 +++--- systest/21million/docker-compose-ludicrous.yml | 6 +++--- systest/21million/docker-compose.yml | 6 +++--- systest/backup/encryption/docker-compose.yml | 6 +++--- systest/backup/filesystem/docker-compose.yml | 6 +++--- systest/backup/minio-large/docker-compose.yml | 6 +++--- systest/backup/minio/docker-compose.yml | 6 +++--- systest/bgindex/docker-compose.yml | 12 ++++++------ systest/cluster_setup_test.go | 2 -- systest/export/docker-compose.yml | 6 +++--- systest/group-delete/docker-compose.yml | 6 +++--- systest/license/docker-compose.yml | 2 +- systest/loader-benchmark/docker-compose.yml | 2 +- systest/loader/docker-compose.yml | 2 +- systest/ludicrous/docker-compose.yml | 6 +++--- systest/online-restore/docker-compose.yml | 12 ++++++------ tlstest/acl/docker-compose.yml | 2 +- tlstest/certrequest/docker-compose.yml | 2 +- tlstest/certrequireandverify/docker-compose.yml | 2 +- tlstest/certverifyifgiven/docker-compose.yml | 2 +- worker/docker-compose.yml | 12 ++++++------ 49 files changed, 105 insertions(+), 116 deletions(-) diff --git a/contrib/config/backups/azure/charts/dgraph_config.yaml b/contrib/config/backups/azure/charts/dgraph_config.yaml index 9c18a50c7d4..83fe869f53d 100644 --- a/contrib/config/backups/azure/charts/dgraph_config.yaml +++ b/contrib/config/backups/azure/charts/dgraph_config.yaml @@ -7,4 +7,3 @@ alpha: configFile: config.hcl: | whitelist = "10.0.0.0/8,172.0.0.0/8,192.168.0.0/16,127.0.0.1" - lru_mb = 2048 diff --git a/contrib/config/backups/azure/docker-compose.yml b/contrib/config/backups/azure/docker-compose.yml index cd643b323b2..d68a3e71204 100644 --- a/contrib/config/backups/azure/docker-compose.yml +++ b/contrib/config/backups/azure/docker-compose.yml @@ -18,7 +18,7 @@ services: ports: - 8080:8080 - 9080:9080 - command: dgraph alpha --my=alpha1:7080 --lru_mb=1024 --zero=zero1:5080 --whitelist "10.0.0.0/8,172.0.0.0/8,192.168.0.0/16,127.0.0.1" + command: dgraph alpha --my=alpha1:7080 --zero=zero1:5080 --whitelist "10.0.0.0/8,172.0.0.0/8,192.168.0.0/16,127.0.0.1" ratel: image: dgraph/dgraph:${DGRAPH_VERSION} diff --git a/contrib/config/backups/gcp/charts/dgraph_config.yaml b/contrib/config/backups/gcp/charts/dgraph_config.yaml index 9c18a50c7d4..83fe869f53d 100644 --- a/contrib/config/backups/gcp/charts/dgraph_config.yaml +++ b/contrib/config/backups/gcp/charts/dgraph_config.yaml @@ -7,4 +7,3 @@ alpha: configFile: config.hcl: | whitelist = "10.0.0.0/8,172.0.0.0/8,192.168.0.0/16,127.0.0.1" - lru_mb = 2048 diff --git a/contrib/config/backups/gcp/docker-compose.yml b/contrib/config/backups/gcp/docker-compose.yml index 2b3417c1dc8..b3c86c1ad6b 100644 --- a/contrib/config/backups/gcp/docker-compose.yml +++ b/contrib/config/backups/gcp/docker-compose.yml @@ -18,7 +18,7 @@ services: ports: - 8080:8080 - 9080:9080 - command: dgraph alpha --my=alpha1:7080 --lru_mb=1024 --zero=zero1:5080 --whitelist "10.0.0.0/8,172.0.0.0/8,192.168.0.0/16,127.0.0.1" + command: dgraph alpha --my=alpha1:7080 --zero=zero1:5080 --whitelist "10.0.0.0/8,172.0.0.0/8,192.168.0.0/16,127.0.0.1" ratel: image: dgraph/dgraph:${DGRAPH_VERSION} diff --git a/contrib/config/backups/s3/charts/dgraph_config.yaml b/contrib/config/backups/s3/charts/dgraph_config.yaml index 9c18a50c7d4..83fe869f53d 100644 --- a/contrib/config/backups/s3/charts/dgraph_config.yaml +++ b/contrib/config/backups/s3/charts/dgraph_config.yaml @@ -7,4 +7,3 @@ alpha: configFile: config.hcl: | whitelist = "10.0.0.0/8,172.0.0.0/8,192.168.0.0/16,127.0.0.1" - lru_mb = 2048 diff --git a/contrib/config/backups/s3/docker-compose.yml b/contrib/config/backups/s3/docker-compose.yml index bf42f31dd6a..f3253ee3d53 100644 --- a/contrib/config/backups/s3/docker-compose.yml +++ b/contrib/config/backups/s3/docker-compose.yml @@ -18,7 +18,7 @@ services: ports: - 8080:8080 - 9080:9080 - command: dgraph alpha --my=alpha1:7080 --lru_mb=1024 --zero=zero1:5080 --whitelist "10.0.0.0/8,172.0.0.0/8,192.168.0.0/16,127.0.0.1" + command: dgraph alpha --my=alpha1:7080 --zero=zero1:5080 --whitelist "10.0.0.0/8,172.0.0.0/8,192.168.0.0/16,127.0.0.1" ratel: image: dgraph/dgraph:${DGRAPH_VERSION} diff --git a/contrib/config/datadog/docker-compose.yml b/contrib/config/datadog/docker-compose.yml index 28e448877cb..bdc0cdff290 100644 --- a/contrib/config/datadog/docker-compose.yml +++ b/contrib/config/datadog/docker-compose.yml @@ -14,7 +14,7 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5080 --logtostderr -v=2 --datadog.collector=datadog:8126 --jaeger.collector=http://jaeger:14268 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5080 --logtostderr -v=2 --datadog.collector=datadog:8126 --jaeger.collector=http://jaeger:14268 zero1: image: dgraph/dgraph:latest container_name: zero1 @@ -62,4 +62,4 @@ services: ports: - 16686:16686 command: --memory.max-traces=1000000 -volumes: {} \ No newline at end of file +volumes: {} diff --git a/contrib/config/docker/docker-compose-ha.yml b/contrib/config/docker/docker-compose-ha.yml index 2296e7ad9f4..fa8606781ce 100644 --- a/contrib/config/docker/docker-compose-ha.yml +++ b/contrib/config/docker/docker-compose-ha.yml @@ -70,7 +70,7 @@ services: placement: constraints: - node.hostname == aws01 - command: dgraph alpha --my=alpha1:7080 --lru_mb=2048 --zero=zero1:5080,zero2:5081,zero3:5082 + command: dgraph alpha --my=alpha1:7080 --zero=zero1:5080,zero2:5081,zero3:5082 alpha2: image: dgraph/dgraph:latest hostname: "alpha2" @@ -86,7 +86,7 @@ services: placement: constraints: - node.hostname == aws02 - command: dgraph alpha --my=alpha2:7081 --lru_mb=2048 --zero=zero1:5080,zero2:5081,zero3:5082 -o 1 + command: dgraph alpha --my=alpha2:7081 --zero=zero1:5080,zero2:5081,zero3:5082 -o 1 alpha3: image: dgraph/dgraph:latest hostname: "alpha3" @@ -102,7 +102,7 @@ services: placement: constraints: - node.hostname == aws03 - command: dgraph alpha --my=alpha3:7082 --lru_mb=2048 --zero=zero1:5080,zero2:5081,zero3:5082 -o 2 + command: dgraph alpha --my=alpha3:7082 --zero=zero1:5080,zero2:5081,zero3:5082 -o 2 alpha4: image: dgraph/dgraph:latest hostname: "alpha4" @@ -117,7 +117,7 @@ services: placement: constraints: - node.hostname == aws04 - command: dgraph alpha --my=alpha4:7083 --lru_mb=2048 --zero=zero1:5080,zero2:5081,zero3:5082 -o 3 + command: dgraph alpha --my=alpha4:7083 --zero=zero1:5080,zero2:5081,zero3:5082 -o 3 alpha5: image: dgraph/dgraph:latest hostname: "alpha5" @@ -132,7 +132,7 @@ services: placement: constraints: - node.hostname == aws05 - command: dgraph alpha --my=alpha5:7084 --lru_mb=2048 --zero=zero1:5080,zero2:5081,zero3:5082 -o 4 + command: dgraph alpha --my=alpha5:7084 --zero=zero1:5080,zero2:5081,zero3:5082 -o 4 alpha6: image: dgraph/dgraph:latest hostname: "alpha6" @@ -147,7 +147,7 @@ services: placement: constraints: - node.hostname == aws06 - command: dgraph alpha --my=alpha6:7085 --lru_mb=2048 --zero=zero1:5080,zero2:5081,zero3:5082 -o 5 + command: dgraph alpha --my=alpha6:7085 --zero=zero1:5080,zero2:5081,zero3:5082 -o 5 ratel: image: dgraph/dgraph:latest hostname: "ratel" diff --git a/contrib/config/docker/docker-compose-multi.yml b/contrib/config/docker/docker-compose-multi.yml index 8763488b784..ae25a268781 100644 --- a/contrib/config/docker/docker-compose-multi.yml +++ b/contrib/config/docker/docker-compose-multi.yml @@ -39,7 +39,7 @@ services: placement: constraints: - node.hostname == aws01 - command: dgraph alpha --my=alpha1:7080 --lru_mb=2048 --zero=zero:5080 + command: dgraph alpha --my=alpha1:7080 --zero=zero:5080 alpha2: image: dgraph/dgraph:latest hostname: "alpha2" @@ -55,7 +55,7 @@ services: placement: constraints: - node.hostname == aws02 - command: dgraph alpha --my=alpha2:7081 --lru_mb=2048 --zero=zero:5080 -o 1 + command: dgraph alpha --my=alpha2:7081 --zero=zero:5080 -o 1 alpha3: image: dgraph/dgraph:latest hostname: "alpha3" @@ -71,7 +71,7 @@ services: placement: constraints: - node.hostname == aws03 - command: dgraph alpha --my=alpha3:7082 --lru_mb=2048 --zero=zero:5080 -o 2 + command: dgraph alpha --my=alpha3:7082 --zero=zero:5080 -o 2 ratel: image: dgraph/dgraph:latest hostname: "ratel" diff --git a/contrib/config/docker/docker-compose.yml b/contrib/config/docker/docker-compose.yml index c43b542ee4c..d9e79c41601 100644 --- a/contrib/config/docker/docker-compose.yml +++ b/contrib/config/docker/docker-compose.yml @@ -24,7 +24,7 @@ services: - 8080:8080 - 9080:9080 restart: on-failure - command: dgraph alpha --my=alpha:7080 --lru_mb=2048 --zero=zero:5080 + command: dgraph alpha --my=alpha:7080 --zero=zero:5080 ratel: image: dgraph/dgraph:latest ports: diff --git a/contrib/embargo/embargo.yml b/contrib/embargo/embargo.yml index 037621e9672..309d8c625f9 100644 --- a/contrib/embargo/embargo.yml +++ b/contrib/embargo/embargo.yml @@ -61,7 +61,7 @@ containers: expose: - 8180 - 9180 - command: /gobin/dgraph alpha --my=dg1:7180 --lru_mb=1024 --zero=zero1:5080,zero2:5082,zero3:5083 -o 100 --expose_trace --trace 1.0 --logtostderr -v=3 + command: /gobin/dgraph alpha --my=dg1:7180 --zero=zero1:5080,zero2:5082,zero3:5083 -o 100 --expose_trace --trace 1.0 --logtostderr -v=3 volumes: "${GOPATH}/bin": "/gobin" @@ -76,7 +76,7 @@ containers: - 8182 - 9182 start_delay: 8 - command: /gobin/dgraph alpha --my=dg2:7182 --lru_mb=1024 --zero=zero1:5080,zero2:5082,zero3:5083 -o 102 --expose_trace --trace 1.0 --logtostderr -v=3 + command: /gobin/dgraph alpha --my=dg2:7182 --zero=zero1:5080,zero2:5082,zero3:5083 -o 102 --expose_trace --trace 1.0 --logtostderr -v=3 volumes: "${GOPATH}/bin": "/gobin" @@ -91,7 +91,7 @@ containers: - 8183 - 9183 start_delay: 16 - command: /gobin/dgraph alpha --my=dg3:7183 --lru_mb=1024 --zero=zero1:5080,zero2:5082,zero3:5083 -o 103 --expose_trace --trace 1.0 --logtostderr -v=3 + command: /gobin/dgraph alpha --my=dg3:7183 --zero=zero1:5080,zero2:5082,zero3:5083 -o 103 --expose_trace --trace 1.0 --logtostderr -v=3 volumes: "${GOPATH}/bin": "/gobin" diff --git a/contrib/standalone/run.sh b/contrib/standalone/run.sh index 291e793bd8f..51a3a1652cd 100644 --- a/contrib/standalone/run.sh +++ b/contrib/standalone/run.sh @@ -3,12 +3,6 @@ # fail if any error occurs set -e -lru_kb=$(cat /proc/meminfo | grep MemTotal | sed "s/.* \([0-9]*\) .*/\1/") -lru_mb=$(expr $lru_kb / 1024 / 3) # one-third of host memory -if [[ $lru_mb -lt 1024 ]]; then - lru_mb=1024 -fi - echo -e "\033[0;33m Warning: This standalone version is meant for quickstart purposes only. It is NOT RECOMMENDED for production environments.\033[0;0m" @@ -16,4 +10,4 @@ Warning: This standalone version is meant for quickstart purposes only. export DGRAPH_ALPHA_WHITELIST=0.0.0.0/0 # TODO properly handle SIGTERM for all three processes. -dgraph-ratel & dgraph zero & dgraph alpha --lru_mb $lru_mb +dgraph-ratel & dgraph zero & dgraph alpha diff --git a/contrib/systemd/centos/dgraph-alpha.service b/contrib/systemd/centos/dgraph-alpha.service index d7215c9ae29..dcac7002e31 100644 --- a/contrib/systemd/centos/dgraph-alpha.service +++ b/contrib/systemd/centos/dgraph-alpha.service @@ -7,7 +7,7 @@ Requires=dgraph-zero.service [Service] Type=simple WorkingDirectory=/var/lib/dgraph -ExecStart=/usr/bin/bash -c 'dgraph alpha --lru_mb 2048 -p /var/lib/dgraph/p -w /var/lib/dgraph/w' +ExecStart=/usr/bin/bash -c 'dgraph alpha -p /var/lib/dgraph/p -w /var/lib/dgraph/w' Restart=on-failure StandardOutput=journal StandardError=journal diff --git a/contrib/systemd/ha_cluster/dgraph-alpha.service b/contrib/systemd/ha_cluster/dgraph-alpha.service index 9224d647f4f..9a31844a5ba 100644 --- a/contrib/systemd/ha_cluster/dgraph-alpha.service +++ b/contrib/systemd/ha_cluster/dgraph-alpha.service @@ -7,7 +7,7 @@ After=network.target Type=simple WorkingDirectory=/var/lib/dgraph Restart=on-failure -ExecStart=/bin/bash -c '/usr/local/bin/dgraph alpha --my={{ myhostname }}:7080 --lru_mb 2048 --zero {{ zero-0 }}:5080,{{ zero-1 }}:5080,{{ zero-2 }}:5080 --postings /var/lib/dgraph/p --wal /var/lib/dgraph/w' +ExecStart=/bin/bash -c '/usr/local/bin/dgraph alpha --my={{ myhostname }}:7080 --zero {{ zero-0 }}:5080,{{ zero-1 }}:5080,{{ zero-2 }}:5080 --postings /var/lib/dgraph/p --wal /var/lib/dgraph/w' StandardOutput=journal StandardError=journal User=dgraph diff --git a/contrib/systemd/ha_cluster/tests/centos8/provision.sh b/contrib/systemd/ha_cluster/tests/centos8/provision.sh index 088b1aea1fa..3b345c25a77 100755 --- a/contrib/systemd/ha_cluster/tests/centos8/provision.sh +++ b/contrib/systemd/ha_cluster/tests/centos8/provision.sh @@ -119,7 +119,7 @@ setup_systemd_alpha() { for (( I=0; I <= $REPLICAS-1; I++)); do ZEROS+=("zero-$I:5080");done IFS=, eval 'ZERO_LIST="${ZEROS[*]}"' # join by ',' - EXEC="/bin/bash -c '/usr/local/bin/dgraph alpha --my=\$(hostname):7080 --lru_mb 2048 --zero $ZERO_LIST --postings $POSTINGS --wal $WAL'" + EXEC="/bin/bash -c '/usr/local/bin/dgraph alpha --my=\$(hostname):7080 --zero $ZERO_LIST --postings $POSTINGS --wal $WAL'" mkdir -p /var/{log/dgraph,lib/dgraph/{w,p}} chown -R dgraph:dgraph /var/{lib,log}/dgraph diff --git a/contrib/systemd/ha_cluster/tests/ubuntu1804/provision.sh b/contrib/systemd/ha_cluster/tests/ubuntu1804/provision.sh index 088b1aea1fa..3b345c25a77 100755 --- a/contrib/systemd/ha_cluster/tests/ubuntu1804/provision.sh +++ b/contrib/systemd/ha_cluster/tests/ubuntu1804/provision.sh @@ -119,7 +119,7 @@ setup_systemd_alpha() { for (( I=0; I <= $REPLICAS-1; I++)); do ZEROS+=("zero-$I:5080");done IFS=, eval 'ZERO_LIST="${ZEROS[*]}"' # join by ',' - EXEC="/bin/bash -c '/usr/local/bin/dgraph alpha --my=\$(hostname):7080 --lru_mb 2048 --zero $ZERO_LIST --postings $POSTINGS --wal $WAL'" + EXEC="/bin/bash -c '/usr/local/bin/dgraph alpha --my=\$(hostname):7080 --zero $ZERO_LIST --postings $POSTINGS --wal $WAL'" mkdir -p /var/{log/dgraph,lib/dgraph/{w,p}} chown -R dgraph:dgraph /var/{lib,log}/dgraph diff --git a/contrib/tlstest/alpha_tls.sh b/contrib/tlstest/alpha_tls.sh index 736ef94d58c..18d59e61e9d 100755 --- a/contrib/tlstest/alpha_tls.sh +++ b/contrib/tlstest/alpha_tls.sh @@ -1,3 +1,3 @@ #!/bin/bash set -e -$DGRAPH_BIN alpha --tls_dir $PWD/tls --lru_mb 2048 --zero 127.0.0.1:5081 &> alpha.log \ No newline at end of file +$DGRAPH_BIN alpha --tls_dir $PWD/tls --zero 127.0.0.1:5081 &> alpha.log diff --git a/dgraph/cmd/alpha/mutations_mode/docker-compose.yml b/dgraph/cmd/alpha/mutations_mode/docker-compose.yml index 68b89f8adbf..ba517a28860 100644 --- a/dgraph/cmd/alpha/mutations_mode/docker-compose.yml +++ b/dgraph/cmd/alpha/mutations_mode/docker-compose.yml @@ -65,7 +65,7 @@ services: - 9180:9180 labels: cluster: test - command: /gobin/dgraph alpha --my=dg1:7180 --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 + command: /gobin/dgraph alpha --my=dg1:7180 --zero=zero1:5180,zero2:5182,zero3:5183 -o 100 --logtostderr --mutations=disallow --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 dg2: @@ -84,7 +84,7 @@ services: - 9182:9182 labels: cluster: test - command: /gobin/dgraph alpha --my=dg2:7182 --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 + command: /gobin/dgraph alpha --my=dg2:7182 --zero=zero1:5180,zero2:5182,zero3:5183 -o 102 --logtostderr --mutations=strict --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 dg3: @@ -103,5 +103,5 @@ services: - 9183:9183 labels: cluster: test - command: /gobin/dgraph alpha --my=dg3:7183 --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 + command: /gobin/dgraph alpha --my=dg3:7183 --zero=zero1:5180,zero2:5182,zero3:5183 -o 103 --logtostderr --mutations=strict --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 diff --git a/dgraph/cmd/bulk/systest/docker-compose.yml b/dgraph/cmd/bulk/systest/docker-compose.yml index 26d61e69948..0b25cccc83e 100644 --- a/dgraph/cmd/bulk/systest/docker-compose.yml +++ b/dgraph/cmd/bulk/systest/docker-compose.yml @@ -16,7 +16,7 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 --logtostderr -v=2 --idx=1 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 zero1: image: dgraph/dgraph:latest diff --git a/dgraph/docker-compose.yml b/dgraph/docker-compose.yml index 0608cc95f1f..a7b38fb3ceb 100644 --- a/dgraph/docker-compose.yml +++ b/dgraph/docker-compose.yml @@ -78,7 +78,7 @@ services: labels: cluster: test service: alpha - command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 -o 100 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file /dgraph-acl/hmac-secret --acl_access_ttl 3s + command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --my=alpha1:7180 --zero=zero1:5180,zero2:5182,zero3:5183 -o 100 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file /dgraph-acl/hmac-secret --acl_access_ttl 3s alpha2: image: dgraph/dgraph:latest @@ -105,7 +105,7 @@ services: labels: cluster: test service: alpha - command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --my=alpha2:7182 --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 -o 102 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file /dgraph-acl/hmac-secret --acl_access_ttl 3s + command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --my=alpha2:7182 --zero=zero1:5180,zero2:5182,zero3:5183 -o 102 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file /dgraph-acl/hmac-secret --acl_access_ttl 3s alpha3: image: dgraph/dgraph:latest @@ -132,7 +132,7 @@ services: labels: cluster: test service: alpha - command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --my=alpha3:7183 --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 -o 103 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file /dgraph-acl/hmac-secret --acl_access_ttl 3s + command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --my=alpha3:7183 --zero=zero1:5180,zero2:5182,zero3:5183 -o 103 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file /dgraph-acl/hmac-secret --acl_access_ttl 3s alpha4: image: dgraph/dgraph:latest @@ -159,7 +159,7 @@ services: labels: cluster: test service: alpha - command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --my=alpha4:7184 --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 -o 104 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file /dgraph-acl/hmac-secret --acl_access_ttl 3s + command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --my=alpha4:7184 --zero=zero1:5180,zero2:5182,zero3:5183 -o 104 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file /dgraph-acl/hmac-secret --acl_access_ttl 3s alpha5: image: dgraph/dgraph:latest @@ -186,7 +186,7 @@ services: labels: cluster: test service: alpha - command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --my=alpha5:7185 --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 -o 105 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file /dgraph-acl/hmac-secret --acl_access_ttl 3s + command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --my=alpha5:7185 --zero=zero1:5180,zero2:5182,zero3:5183 -o 105 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file /dgraph-acl/hmac-secret --acl_access_ttl 3s alpha6: image: dgraph/dgraph:latest @@ -213,7 +213,7 @@ services: labels: cluster: test service: alpha - command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --my=alpha6:7186 --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 -o 106 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file /dgraph-acl/hmac-secret --acl_access_ttl 3s + command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --my=alpha6:7186 --zero=zero1:5180,zero2:5182,zero3:5183 -o 106 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file /dgraph-acl/hmac-secret --acl_access_ttl 3s minio1: image: minio/minio:latest diff --git a/graphql/e2e/auth/debug_off/docker-compose.yml b/graphql/e2e/auth/debug_off/docker-compose.yml index 0f5bb630435..559e026569b 100644 --- a/graphql/e2e/auth/debug_off/docker-compose.yml +++ b/graphql/e2e/auth/debug_off/docker-compose.yml @@ -32,7 +32,7 @@ services: labels: cluster: test service: alpha1 - command: /gobin/dgraph alpha --lru_mb=1024 --zero=zero1:5180 -o 100 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=3 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --my=alpha1:7180 + command: /gobin/dgraph alpha --zero=zero1:5180 -o 100 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=3 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --my=alpha1:7180 zeroAdmin: image: dgraph/dgraph:latest @@ -66,4 +66,4 @@ services: labels: cluster: admintest service: alphaAdmin - command: /gobin/dgraph alpha --lru_mb=1024 --zero=zeroAdmin:5280 -o 200 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --my=alphaAdmin:7280 + command: /gobin/dgraph alpha --zero=zeroAdmin:5280 -o 200 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --my=alphaAdmin:7280 diff --git a/graphql/e2e/auth/docker-compose.yml b/graphql/e2e/auth/docker-compose.yml index 04925abaaea..1cc513348d2 100644 --- a/graphql/e2e/auth/docker-compose.yml +++ b/graphql/e2e/auth/docker-compose.yml @@ -32,7 +32,7 @@ services: labels: cluster: test service: alpha1 - command: /gobin/dgraph alpha --lru_mb=1024 --zero=zero1:5180 -o 100 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=3 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --my=alpha1:7180 --graphql_debug=true + command: /gobin/dgraph alpha --zero=zero1:5180 -o 100 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=3 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --my=alpha1:7180 --graphql_debug=true zeroAdmin: image: dgraph/dgraph:latest @@ -66,4 +66,4 @@ services: labels: cluster: admintest service: alphaAdmin - command: /gobin/dgraph alpha --lru_mb=1024 --zero=zeroAdmin:5280 -o 200 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --my=alphaAdmin:7280 --graphql_debug=true + command: /gobin/dgraph alpha --zero=zeroAdmin:5280 -o 200 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --my=alphaAdmin:7280 --graphql_debug=true diff --git a/graphql/e2e/custom_logic/docker-compose.yml b/graphql/e2e/custom_logic/docker-compose.yml index 44d143fcb74..1e1eba2f499 100644 --- a/graphql/e2e/custom_logic/docker-compose.yml +++ b/graphql/e2e/custom_logic/docker-compose.yml @@ -16,7 +16,7 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 --logtostderr -v=2 --idx=1 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 zero1: image: dgraph/dgraph:latest diff --git a/graphql/e2e/directives/docker-compose.yml b/graphql/e2e/directives/docker-compose.yml index 154fc96fb3a..7b26715143c 100644 --- a/graphql/e2e/directives/docker-compose.yml +++ b/graphql/e2e/directives/docker-compose.yml @@ -32,7 +32,7 @@ services: labels: cluster: test service: alpha1 - command: /gobin/dgraph alpha --lru_mb=1024 --zero=zero1:5180 -o 100 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --my=alpha1:7180 + command: /gobin/dgraph alpha --zero=zero1:5180 -o 100 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --my=alpha1:7180 zeroAdmin: image: dgraph/dgraph:latest @@ -66,4 +66,4 @@ services: labels: cluster: admintest service: alphaAdmin - command: /gobin/dgraph alpha --lru_mb=1024 --zero=zeroAdmin:5280 -o 200 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --my=alphaAdmin:7280 \ No newline at end of file + command: /gobin/dgraph alpha --zero=zeroAdmin:5280 -o 200 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --my=alphaAdmin:7280 diff --git a/graphql/e2e/normal/docker-compose.yml b/graphql/e2e/normal/docker-compose.yml index 154fc96fb3a..7b26715143c 100644 --- a/graphql/e2e/normal/docker-compose.yml +++ b/graphql/e2e/normal/docker-compose.yml @@ -32,7 +32,7 @@ services: labels: cluster: test service: alpha1 - command: /gobin/dgraph alpha --lru_mb=1024 --zero=zero1:5180 -o 100 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --my=alpha1:7180 + command: /gobin/dgraph alpha --zero=zero1:5180 -o 100 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --my=alpha1:7180 zeroAdmin: image: dgraph/dgraph:latest @@ -66,4 +66,4 @@ services: labels: cluster: admintest service: alphaAdmin - command: /gobin/dgraph alpha --lru_mb=1024 --zero=zeroAdmin:5280 -o 200 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --my=alphaAdmin:7280 \ No newline at end of file + command: /gobin/dgraph alpha --zero=zeroAdmin:5280 -o 200 --expose_trace --trace 1.0 --profile_mode block --block_rate 10 --logtostderr -v=2 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --my=alphaAdmin:7280 diff --git a/graphql/e2e/schema/docker-compose.yml b/graphql/e2e/schema/docker-compose.yml index cb037827a4d..efed8091f45 100644 --- a/graphql/e2e/schema/docker-compose.yml +++ b/graphql/e2e/schema/docker-compose.yml @@ -16,7 +16,7 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 --logtostderr -v=2 --idx=1 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha2: image: dgraph/dgraph:latest @@ -34,7 +34,7 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --zero=zero1:5180 --logtostderr -v=2 --idx=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha3: image: dgraph/dgraph:latest @@ -52,7 +52,7 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --zero=zero1:5180 --logtostderr -v=2 --idx=3 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 zero1: image: dgraph/dgraph:latest diff --git a/graphql/e2e/subscription/docker-compose.yml b/graphql/e2e/subscription/docker-compose.yml index cb037827a4d..efed8091f45 100644 --- a/graphql/e2e/subscription/docker-compose.yml +++ b/graphql/e2e/subscription/docker-compose.yml @@ -16,7 +16,7 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 --logtostderr -v=2 --idx=1 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha2: image: dgraph/dgraph:latest @@ -34,7 +34,7 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --zero=zero1:5180 --logtostderr -v=2 --idx=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha3: image: dgraph/dgraph:latest @@ -52,7 +52,7 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --zero=zero1:5180 --logtostderr -v=2 --idx=3 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 zero1: image: dgraph/dgraph:latest diff --git a/ocagent/docker-compose.yml b/ocagent/docker-compose.yml index 14b8c64545d..61927b9f0dc 100644 --- a/ocagent/docker-compose.yml +++ b/ocagent/docker-compose.yml @@ -14,7 +14,7 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 --logtostderr -v=2 --jaeger.collector=http://ocagent:14268 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 --logtostderr -v=2 --jaeger.collector=http://ocagent:14268 zero1: image: dgraph/dgraph:latest container_name: zero1 diff --git a/systest/1million/docker-compose.yml b/systest/1million/docker-compose.yml index 6632c9341e0..63521e0a1a2 100644 --- a/systest/1million/docker-compose.yml +++ b/systest/1million/docker-compose.yml @@ -17,7 +17,7 @@ services: target: /gobin read_only: true - data:/data - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 --logtostderr -v=2 --idx=1 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha2: image: dgraph/dgraph:latest @@ -36,7 +36,7 @@ services: target: /gobin read_only: true - data:/data - command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --zero=zero1:5180 --logtostderr -v=2 --idx=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha3: image: dgraph/dgraph:latest @@ -55,7 +55,7 @@ services: target: /gobin read_only: true - data:/data - command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --zero=zero1:5180 --logtostderr -v=2 --idx=3 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 zero1: image: dgraph/dgraph:latest diff --git a/systest/21million/docker-compose-ludicrous.yml b/systest/21million/docker-compose-ludicrous.yml index c0b8663ba96..d5929aa4192 100644 --- a/systest/21million/docker-compose-ludicrous.yml +++ b/systest/21million/docker-compose-ludicrous.yml @@ -17,7 +17,7 @@ services: target: /gobin read_only: true - data:/data - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 --logtostderr -v=2 --idx=1 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --ludicrous_mode alpha2: image: dgraph/dgraph:latest @@ -36,7 +36,7 @@ services: target: /gobin read_only: true - data:/data - command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --zero=zero1:5180 --logtostderr -v=2 --idx=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --ludicrous_mode alpha3: image: dgraph/dgraph:latest @@ -55,7 +55,7 @@ services: target: /gobin read_only: true - data:/data - command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --zero=zero1:5180 --logtostderr -v=2 --idx=3 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --ludicrous_mode zero1: image: dgraph/dgraph:latest diff --git a/systest/21million/docker-compose.yml b/systest/21million/docker-compose.yml index 6632c9341e0..63521e0a1a2 100644 --- a/systest/21million/docker-compose.yml +++ b/systest/21million/docker-compose.yml @@ -17,7 +17,7 @@ services: target: /gobin read_only: true - data:/data - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 --logtostderr -v=2 --idx=1 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha2: image: dgraph/dgraph:latest @@ -36,7 +36,7 @@ services: target: /gobin read_only: true - data:/data - command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --zero=zero1:5180 --logtostderr -v=2 --idx=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha3: image: dgraph/dgraph:latest @@ -55,7 +55,7 @@ services: target: /gobin read_only: true - data:/data - command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --zero=zero1:5180 --logtostderr -v=2 --idx=3 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 zero1: image: dgraph/dgraph:latest diff --git a/systest/backup/encryption/docker-compose.yml b/systest/backup/encryption/docker-compose.yml index 7dda567eac7..ffecf65211a 100644 --- a/systest/backup/encryption/docker-compose.yml +++ b/systest/backup/encryption/docker-compose.yml @@ -36,7 +36,7 @@ services: ports: - 8180:8180 - 9180:9180 - command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --cwd=/data/alpha1 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 -o 100 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --cwd=/data/alpha1 --my=alpha1:7180 --zero=zero1:5180 -o 100 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha2: image: dgraph/dgraph:latest @@ -60,7 +60,7 @@ services: ports: - 8182:8182 - 9182:9182 - command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --cwd=/data/alpha2 --my=alpha2:7182 --lru_mb=1024 --zero=zero1:5180 -o 102 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --cwd=/data/alpha2 --my=alpha2:7182 --zero=zero1:5180 -o 102 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha3: image: dgraph/dgraph:latest @@ -84,7 +84,7 @@ services: ports: - 8183:8183 - 9183:9183 - command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --cwd=/data/alpha3 --my=alpha3:7183 --lru_mb=1024 --zero=zero1:5180 -o 103 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + command: /gobin/dgraph alpha --encryption_key_file "/dgraph-enc/enc-key" --cwd=/data/alpha3 --my=alpha3:7183 --zero=zero1:5180 -o 103 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 minio1: image: minio/minio:latest diff --git a/systest/backup/filesystem/docker-compose.yml b/systest/backup/filesystem/docker-compose.yml index 567677cd1e4..d6c9222fe98 100644 --- a/systest/backup/filesystem/docker-compose.yml +++ b/systest/backup/filesystem/docker-compose.yml @@ -34,7 +34,7 @@ services: ports: - 8180:8180 - 9180:9180 - command: /gobin/dgraph alpha --cwd=/data/alpha1 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 -o 100 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + command: /gobin/dgraph alpha --cwd=/data/alpha1 --my=alpha1:7180 --zero=zero1:5180 -o 100 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha2: image: dgraph/dgraph:latest @@ -56,7 +56,7 @@ services: ports: - 8182:8182 - 9182:9182 - command: /gobin/dgraph alpha --cwd=/data/alpha2 --my=alpha2:7182 --lru_mb=1024 --zero=zero1:5180 -o 102 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + command: /gobin/dgraph alpha --cwd=/data/alpha2 --my=alpha2:7182 --zero=zero1:5180 -o 102 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha3: image: dgraph/dgraph:latest @@ -78,4 +78,4 @@ services: ports: - 8183:8183 - 9183:9183 - command: /gobin/dgraph alpha --cwd=/data/alpha3 --my=alpha3:7183 --lru_mb=1024 --zero=zero1:5180 -o 103 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + command: /gobin/dgraph alpha --cwd=/data/alpha3 --my=alpha3:7183 --zero=zero1:5180 -o 103 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 diff --git a/systest/backup/minio-large/docker-compose.yml b/systest/backup/minio-large/docker-compose.yml index 8382db7bcf4..29e98e0a30a 100644 --- a/systest/backup/minio-large/docker-compose.yml +++ b/systest/backup/minio-large/docker-compose.yml @@ -32,7 +32,7 @@ services: ports: - 8180:8180 - 9180:9180 - command: /gobin/dgraph alpha --cwd=/data/alpha1 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 -o 100 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + command: /gobin/dgraph alpha --cwd=/data/alpha1 --my=alpha1:7180 --zero=zero1:5180 -o 100 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha2: image: dgraph/dgraph:latest @@ -52,7 +52,7 @@ services: ports: - 8182:8182 - 9182:9182 - command: /gobin/dgraph alpha --cwd=/data/alpha2 --my=alpha2:7182 --lru_mb=1024 --zero=zero1:5180 -o 102 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + command: /gobin/dgraph alpha --cwd=/data/alpha2 --my=alpha2:7182 --zero=zero1:5180 -o 102 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha3: image: dgraph/dgraph:latest @@ -72,7 +72,7 @@ services: ports: - 8183:8183 - 9183:9183 - command: /gobin/dgraph alpha --cwd=/data/alpha3 --my=alpha3:7183 --lru_mb=1024 --zero=zero1:5180 -o 103 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + command: /gobin/dgraph alpha --cwd=/data/alpha3 --my=alpha3:7183 --zero=zero1:5180 -o 103 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 minio1: image: minio/minio:latest diff --git a/systest/backup/minio/docker-compose.yml b/systest/backup/minio/docker-compose.yml index 8382db7bcf4..29e98e0a30a 100644 --- a/systest/backup/minio/docker-compose.yml +++ b/systest/backup/minio/docker-compose.yml @@ -32,7 +32,7 @@ services: ports: - 8180:8180 - 9180:9180 - command: /gobin/dgraph alpha --cwd=/data/alpha1 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 -o 100 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + command: /gobin/dgraph alpha --cwd=/data/alpha1 --my=alpha1:7180 --zero=zero1:5180 -o 100 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha2: image: dgraph/dgraph:latest @@ -52,7 +52,7 @@ services: ports: - 8182:8182 - 9182:9182 - command: /gobin/dgraph alpha --cwd=/data/alpha2 --my=alpha2:7182 --lru_mb=1024 --zero=zero1:5180 -o 102 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + command: /gobin/dgraph alpha --cwd=/data/alpha2 --my=alpha2:7182 --zero=zero1:5180 -o 102 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha3: image: dgraph/dgraph:latest @@ -72,7 +72,7 @@ services: ports: - 8183:8183 - 9183:9183 - command: /gobin/dgraph alpha --cwd=/data/alpha3 --my=alpha3:7183 --lru_mb=1024 --zero=zero1:5180 -o 103 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + command: /gobin/dgraph alpha --cwd=/data/alpha3 --my=alpha3:7183 --zero=zero1:5180 -o 103 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 minio1: image: minio/minio:latest diff --git a/systest/bgindex/docker-compose.yml b/systest/bgindex/docker-compose.yml index dd179555399..7ce8f68a12e 100644 --- a/systest/bgindex/docker-compose.yml +++ b/systest/bgindex/docker-compose.yml @@ -20,7 +20,7 @@ services: source: ../../ee/acl/hmac-secret target: /secret/hmac read_only: true - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --idx=1 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file=/secret/hmac --acl_access_ttl 300s alpha2: @@ -43,7 +43,7 @@ services: source: ../../ee/acl/hmac-secret target: /secret/hmac read_only: true - command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 + command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --idx=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file=/secret/hmac --acl_access_ttl 300s alpha3: @@ -66,7 +66,7 @@ services: source: ../../ee/acl/hmac-secret target: /secret/hmac read_only: true - command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 + command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --idx=3 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file=/secret/hmac --acl_access_ttl 300s alpha4: @@ -89,7 +89,7 @@ services: source: ../../ee/acl/hmac-secret target: /secret/hmac read_only: true - command: /gobin/dgraph alpha -o 104 --my=alpha4:7184 --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 + command: /gobin/dgraph alpha -o 104 --my=alpha4:7184 --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --idx=4 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file=/secret/hmac --acl_access_ttl 300s alpha5: @@ -112,7 +112,7 @@ services: source: ../../ee/acl/hmac-secret target: /secret/hmac read_only: true - command: /gobin/dgraph alpha -o 105 --my=alpha5:7185 --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 + command: /gobin/dgraph alpha -o 105 --my=alpha5:7185 --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --idx=5 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file=/secret/hmac --acl_access_ttl 300s alpha6: @@ -135,7 +135,7 @@ services: source: ../../ee/acl/hmac-secret target: /secret/hmac read_only: true - command: /gobin/dgraph alpha -o 106 --my=alpha6:7186 --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 + command: /gobin/dgraph alpha -o 106 --my=alpha6:7186 --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --idx=6 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --acl_secret_file=/secret/hmac --acl_access_ttl 300s zero1: diff --git a/systest/cluster_setup_test.go b/systest/cluster_setup_test.go index 85af5007495..02ae5c4d178 100644 --- a/systest/cluster_setup_test.go +++ b/systest/cluster_setup_test.go @@ -89,7 +89,6 @@ func (d *DgraphCluster) StartZeroOnly() error { func (d *DgraphCluster) StartAlphaOnly() error { d.dgraph = exec.Command(testutil.DgraphBinaryPath(), "alpha", - "--lru_mb=4096", "--zero", ":"+d.zeroPort, "--port_offset", strconv.Itoa(d.alphaPortOffset), "--custom_tokenizers", d.TokenizerPluginsArg, @@ -132,7 +131,6 @@ func (d *DgraphCluster) AddNode(dir string) (Node, error) { o := strconv.Itoa(freePort(x.PortInternal)) dgraph := exec.Command(testutil.DgraphBinaryPath(), "alpha", - "--lru_mb=4096", "--zero", ":"+d.zeroPort, "--port_offset", o, ) diff --git a/systest/export/docker-compose.yml b/systest/export/docker-compose.yml index ea205d43270..db786aba398 100644 --- a/systest/export/docker-compose.yml +++ b/systest/export/docker-compose.yml @@ -32,7 +32,7 @@ services: ports: - 8180:8180 - 9180:9180 - command: /gobin/dgraph alpha --cwd=/data/alpha1 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 -o 100 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + command: /gobin/dgraph alpha --cwd=/data/alpha1 --my=alpha1:7180 --zero=zero1:5180 -o 100 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha2: image: dgraph/dgraph:latest @@ -52,7 +52,7 @@ services: ports: - 8182:8182 - 9182:9182 - command: /gobin/dgraph alpha --cwd=/data/alpha2 --my=alpha2:7182 --lru_mb=1024 --zero=zero1:5180 -o 102 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + command: /gobin/dgraph alpha --cwd=/data/alpha2 --my=alpha2:7182 --zero=zero1:5180 -o 102 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha3: image: dgraph/dgraph:latest @@ -72,7 +72,7 @@ services: ports: - 8183:8183 - 9183:9183 - command: /gobin/dgraph alpha --cwd=/data/alpha3 --my=alpha3:7183 --lru_mb=1024 --zero=zero1:5180 -o 103 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + command: /gobin/dgraph alpha --cwd=/data/alpha3 --my=alpha3:7183 --zero=zero1:5180 -o 103 -v=0 --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 minio1: image: minio/minio:latest diff --git a/systest/group-delete/docker-compose.yml b/systest/group-delete/docker-compose.yml index e8e7277b0ca..e9c497aa96b 100644 --- a/systest/group-delete/docker-compose.yml +++ b/systest/group-delete/docker-compose.yml @@ -16,7 +16,7 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 --logtostderr -v=2 --idx=1 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 deploy: resources: @@ -38,7 +38,7 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --zero=zero1:5180 --logtostderr -v=2 --idx=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 deploy: resources: @@ -60,7 +60,7 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --zero=zero1:5180 --logtostderr -v=2 --idx=3 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 deploy: resources: diff --git a/systest/license/docker-compose.yml b/systest/license/docker-compose.yml index f00460ffaa7..3f28bc0d6e3 100644 --- a/systest/license/docker-compose.yml +++ b/systest/license/docker-compose.yml @@ -16,7 +16,7 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 zero1: image: dgraph/dgraph:latest container_name: zero1 diff --git a/systest/loader-benchmark/docker-compose.yml b/systest/loader-benchmark/docker-compose.yml index 68a60bc566b..ff0c73f4c7e 100644 --- a/systest/loader-benchmark/docker-compose.yml +++ b/systest/loader-benchmark/docker-compose.yml @@ -37,7 +37,7 @@ services: cluster: test command: > /gobin/dgraph alpha --my=dg1:7180 --zero=zero1:5180 -o 100 --logtostderr - --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --lru_mb=1024 + --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 volumes: data: diff --git a/systest/loader/docker-compose.yml b/systest/loader/docker-compose.yml index b1f32713d40..fe5c3014c6d 100644 --- a/systest/loader/docker-compose.yml +++ b/systest/loader/docker-compose.yml @@ -16,7 +16,7 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 --logtostderr -v=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 zero1: image: dgraph/dgraph:latest diff --git a/systest/ludicrous/docker-compose.yml b/systest/ludicrous/docker-compose.yml index c0b8663ba96..d5929aa4192 100644 --- a/systest/ludicrous/docker-compose.yml +++ b/systest/ludicrous/docker-compose.yml @@ -17,7 +17,7 @@ services: target: /gobin read_only: true - data:/data - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 --logtostderr -v=2 --idx=1 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --ludicrous_mode alpha2: image: dgraph/dgraph:latest @@ -36,7 +36,7 @@ services: target: /gobin read_only: true - data:/data - command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --zero=zero1:5180 --logtostderr -v=2 --idx=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --ludicrous_mode alpha3: image: dgraph/dgraph:latest @@ -55,7 +55,7 @@ services: target: /gobin read_only: true - data:/data - command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --zero=zero1:5180 --logtostderr -v=2 --idx=3 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --ludicrous_mode zero1: image: dgraph/dgraph:latest diff --git a/systest/online-restore/docker-compose.yml b/systest/online-restore/docker-compose.yml index 49c18ff8e17..3ada5a61349 100644 --- a/systest/online-restore/docker-compose.yml +++ b/systest/online-restore/docker-compose.yml @@ -22,7 +22,7 @@ services: source: ./backup target: /data/backup read_only: false - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 --logtostderr -v=2 --idx=1 --encryption_key_file /data/keys/enc_key --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha2: @@ -49,7 +49,7 @@ services: source: ./backup target: /data/backup read_only: false - command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 102 --my=alpha2:7182 --zero=zero1:5180 --logtostderr -v=2 --idx=2 --encryption_key_file /data/keys/enc_key --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha3: @@ -76,7 +76,7 @@ services: source: ./backup target: /data/backup read_only: false - command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 103 --my=alpha3:7183 --zero=zero1:5180 --logtostderr -v=2 --idx=3 --encryption_key_file /data/keys/enc_key --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha4: @@ -103,7 +103,7 @@ services: source: ./backup target: /data/backup read_only: false - command: /gobin/dgraph alpha -o 104 --my=alpha4:7184 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 104 --my=alpha4:7184 --zero=zero1:5180 --logtostderr -v=2 --idx=4 --encryption_key_file /data/keys/enc_key --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha5: @@ -130,7 +130,7 @@ services: source: ./backup target: /data/backup read_only: false - command: /gobin/dgraph alpha -o 105 --my=alpha5:7185 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 105 --my=alpha5:7185 --zero=zero1:5180 --logtostderr -v=2 --idx=5 --encryption_key_file /data/keys/enc_key --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 alpha6: @@ -157,7 +157,7 @@ services: source: ./backup target: /data/backup read_only: false - command: /gobin/dgraph alpha -o 106 --my=alpha6:7186 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 106 --my=alpha6:7186 --zero=zero1:5180 --logtostderr -v=2 --idx=6 --encryption_key_file /data/keys/enc_key --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 ratel: diff --git a/tlstest/acl/docker-compose.yml b/tlstest/acl/docker-compose.yml index 8e28107eabd..cde31b7a32b 100644 --- a/tlstest/acl/docker-compose.yml +++ b/tlstest/acl/docker-compose.yml @@ -22,7 +22,7 @@ services: source: ../tls target: /dgraph-tls read_only: true - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 --logtostderr -v=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --tls_dir /dgraph-tls --tls_client_auth VERIFYIFGIVEN --acl_secret_file /dgraph-acl/hmac-secret zero1: diff --git a/tlstest/certrequest/docker-compose.yml b/tlstest/certrequest/docker-compose.yml index b8fa527be0e..6c5069132be 100644 --- a/tlstest/certrequest/docker-compose.yml +++ b/tlstest/certrequest/docker-compose.yml @@ -18,7 +18,7 @@ services: source: ../tls target: /dgraph-tls read_only: true - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 --logtostderr -v=2 --tls_dir /dgraph-tls --tls_client_auth REQUEST --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 zero1: diff --git a/tlstest/certrequireandverify/docker-compose.yml b/tlstest/certrequireandverify/docker-compose.yml index 365cf4fd478..33c71e90118 100644 --- a/tlstest/certrequireandverify/docker-compose.yml +++ b/tlstest/certrequireandverify/docker-compose.yml @@ -18,7 +18,7 @@ services: source: ../tls target: /dgraph-tls read_only: true - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 --logtostderr -v=2 --tls_dir /dgraph-tls --tls_client_auth REQUIREANDVERIFY --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 --logtostderr -v=2 --tls_dir /dgraph-tls --tls_client_auth REQUIREANDVERIFY --whitelist 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 zero1: image: dgraph/dgraph:latest container_name: zero1 diff --git a/tlstest/certverifyifgiven/docker-compose.yml b/tlstest/certverifyifgiven/docker-compose.yml index 1c335896daf..88afb4dad86 100644 --- a/tlstest/certverifyifgiven/docker-compose.yml +++ b/tlstest/certverifyifgiven/docker-compose.yml @@ -18,7 +18,7 @@ services: source: ../tls target: /dgraph-tls read_only: true - command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --lru_mb=1024 --zero=zero1:5180 + command: /gobin/dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 --logtostderr -v=2 --tls_dir /dgraph-tls --tls_client_auth VERIFYIFGIVEN --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 zero1: diff --git a/worker/docker-compose.yml b/worker/docker-compose.yml index 02d03ab0af0..6c48b2a6aa0 100644 --- a/worker/docker-compose.yml +++ b/worker/docker-compose.yml @@ -18,7 +18,7 @@ services: target: /gobin read_only: true command: /gobin/dgraph alpha --jaeger.collector=http://jaeger:14268 -o 100 --my=alpha1:7180 - --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --snapshot_after 100 + --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --snapshot_after 100 alpha2: image: dgraph/dgraph:latest container_name: alpha2 @@ -36,7 +36,7 @@ services: target: /gobin read_only: true command: /gobin/dgraph alpha --jaeger.collector=http://jaeger:14268 -o 102 --my=alpha2:7182 - --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --snapshot_after 100 + --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --snapshot_after 100 alpha3: image: dgraph/dgraph:latest container_name: alpha3 @@ -54,7 +54,7 @@ services: target: /gobin read_only: true command: /gobin/dgraph alpha --jaeger.collector=http://jaeger:14268 -o 103 --my=alpha3:7183 - --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --snapshot_after 100 + --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --snapshot_after 100 alpha4: image: dgraph/dgraph:latest container_name: alpha4 @@ -72,7 +72,7 @@ services: target: /gobin read_only: true command: /gobin/dgraph alpha --jaeger.collector=http://jaeger:14268 -o 104 --my=alpha4:7184 - --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --snapshot_after 100 + --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --snapshot_after 100 alpha5: image: dgraph/dgraph:latest container_name: alpha5 @@ -90,7 +90,7 @@ services: target: /gobin read_only: true command: /gobin/dgraph alpha --jaeger.collector=http://jaeger:14268 -o 105 --my=alpha5:7185 - --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --snapshot_after 100 + --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --snapshot_after 100 alpha6: image: dgraph/dgraph:latest container_name: alpha6 @@ -108,7 +108,7 @@ services: target: /gobin read_only: true command: /gobin/dgraph alpha --jaeger.collector=http://jaeger:14268 -o 106 --my=alpha6:7186 - --lru_mb=1024 --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --snapshot_after 100 + --zero=zero1:5180,zero2:5182,zero3:5183 --logtostderr -v=2 --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 --snapshot_after 100 jaeger: image: jaegertracing/all-in-one:latest container_name: jaeger From 1ba9119de09f17eaf7c2ab6d772f81f48f112136 Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Fri, 2 Oct 2020 07:43:45 -0700 Subject: [PATCH 02/14] remove more stuff. --- compose/compose.go | 7 ------- contrib/config/kubernetes/dgraph-ha/dgraph-ha.yaml | 2 +- contrib/config/kubernetes/dgraph-single/dgraph-single.yaml | 2 +- contrib/config/marketplace/aws/dgraph.json | 2 +- .../terraform/aws/ha/templates/dgraph-alpha.service.tmpl | 2 +- .../terraform/aws/standalone/templates/dgraph.service | 2 +- .../terraform/gcp/standalone/templates/dgraph.service | 2 +- .../modules/dgraph/modules/alpha/templates/alpha.tpl | 2 +- contrib/tlstest/alpha_notls.sh | 2 +- contrib/tlstest/alpha_tls_auth.sh | 2 +- contrib/tlstest/server_11.sh | 2 +- contrib/tlstest/server_nopass.sh | 2 +- contrib/tlstest/server_nopass_client_auth.sh | 2 +- contrib/tlstest/server_pass.sh | 2 +- wiki/content/deploy/single-host-setup.md | 6 +++--- 15 files changed, 16 insertions(+), 23 deletions(-) diff --git a/compose/compose.go b/compose/compose.go index 29c4f9cfeb2..060451007ac 100644 --- a/compose/compose.go +++ b/compose/compose.go @@ -81,7 +81,6 @@ type options struct { NumZeros int NumAlphas int NumReplicas int - LruSizeMB int Acl bool AclSecret string DataDir string @@ -280,7 +279,6 @@ func getAlpha(idx int) service { svc.Command += fmt.Sprintf(" -o %d", opts.PortOffset+getOffset(idx)) svc.Command += fmt.Sprintf(" --my=%s:%d", svc.name, internalPort) - svc.Command += fmt.Sprintf(" --lru_mb=%d", opts.LruSizeMB) svc.Command += fmt.Sprintf(" --zero=%s", zerosOpt) svc.Command += fmt.Sprintf(" --logtostderr -v=%d", opts.Verbosity) @@ -473,8 +471,6 @@ func main() { "number of alphas in dgraph cluster") cmd.PersistentFlags().IntVarP(&opts.NumReplicas, "num_replicas", "r", 3, "number of alpha replicas in dgraph cluster") - cmd.PersistentFlags().IntVar(&opts.LruSizeMB, "lru_mb", 1024, - "approximate size of LRU cache") cmd.PersistentFlags().BoolVar(&opts.DataVol, "data_vol", false, "mount a docker volume as /data in containers") cmd.PersistentFlags().StringVarP(&opts.DataDir, "data_dir", "d", "", @@ -547,9 +543,6 @@ func main() { if opts.NumReplicas%2 == 0 { fatal(errors.Errorf("number of replicas must be odd")) } - if opts.LruSizeMB < 1024 { - fatal(errors.Errorf("LRU cache size must be >= 1024 MB")) - } if opts.DataVol && opts.DataDir != "" { fatal(errors.Errorf("only one of --data_vol and --data_dir may be used at a time")) } diff --git a/contrib/config/kubernetes/dgraph-ha/dgraph-ha.yaml b/contrib/config/kubernetes/dgraph-ha/dgraph-ha.yaml index bab4047cd9a..2b97b23986f 100644 --- a/contrib/config/kubernetes/dgraph-ha/dgraph-ha.yaml +++ b/contrib/config/kubernetes/dgraph-ha/dgraph-ha.yaml @@ -300,7 +300,7 @@ spec: - "-c" - | set -ex - dgraph alpha --my=$(hostname -f):7080 --lru_mb 2048 --zero dgraph-zero-0.dgraph-zero.${POD_NAMESPACE}.svc.cluster.local:5080,dgraph-zero-1.dgraph-zero.${POD_NAMESPACE}.svc.cluster.local:5080,dgraph-zero-2.dgraph-zero.${POD_NAMESPACE}.svc.cluster.local:5080 + dgraph alpha --my=$(hostname -f):7080 --zero dgraph-zero-0.dgraph-zero.${POD_NAMESPACE}.svc.cluster.local:5080,dgraph-zero-1.dgraph-zero.${POD_NAMESPACE}.svc.cluster.local:5080,dgraph-zero-2.dgraph-zero.${POD_NAMESPACE}.svc.cluster.local:5080 livenessProbe: httpGet: path: /health?live=1 diff --git a/contrib/config/kubernetes/dgraph-single/dgraph-single.yaml b/contrib/config/kubernetes/dgraph-single/dgraph-single.yaml index 0b1368ca65d..a2adbc0c578 100644 --- a/contrib/config/kubernetes/dgraph-single/dgraph-single.yaml +++ b/contrib/config/kubernetes/dgraph-single/dgraph-single.yaml @@ -89,7 +89,7 @@ spec: - "-c" - | set -ex - dgraph alpha --my=$(hostname -f):7080 --lru_mb 2048 --zero dgraph-0.dgraph.${POD_NAMESPACE}.svc.cluster.local:5080 + dgraph alpha --my=$(hostname -f):7080 --zero dgraph-0.dgraph.${POD_NAMESPACE}.svc.cluster.local:5080 terminationGracePeriodSeconds: 60 volumes: - name: datadir diff --git a/contrib/config/marketplace/aws/dgraph.json b/contrib/config/marketplace/aws/dgraph.json index 748ee79b9ec..a4cf8a6654d 100644 --- a/contrib/config/marketplace/aws/dgraph.json +++ b/contrib/config/marketplace/aws/dgraph.json @@ -1438,7 +1438,7 @@ { "Ref": "AWS::Region" }, - ".compute.internal:7080 --lru_mb 2048 --zero ", + ".compute.internal:7080 --zero ", { "Fn::GetAtt": [ "DgraphHealthyZero", diff --git a/contrib/config/terraform/aws/ha/templates/dgraph-alpha.service.tmpl b/contrib/config/terraform/aws/ha/templates/dgraph-alpha.service.tmpl index 8465a4eb37c..a0c14b83212 100644 --- a/contrib/config/terraform/aws/ha/templates/dgraph-alpha.service.tmpl +++ b/contrib/config/terraform/aws/ha/templates/dgraph-alpha.service.tmpl @@ -5,7 +5,7 @@ After=network.target [Service] Type=simple -ExecStart=/usr/local/bin/dgraph alpha --my=$(hostname -f):7080 --lru_mb 2048 --zero ${healthy_zero_ip}:5080 -p /var/run/dgraph/p -w /var/run/dgraph/w +ExecStart=/usr/local/bin/dgraph alpha --my=$(hostname -f):7080 --zero ${healthy_zero_ip}:5080 -p /var/run/dgraph/p -w /var/run/dgraph/w StandardOutput=journal StandardError=journal User=dgraph diff --git a/contrib/config/terraform/aws/standalone/templates/dgraph.service b/contrib/config/terraform/aws/standalone/templates/dgraph.service index ac2ebe9873e..64a2dbf459c 100644 --- a/contrib/config/terraform/aws/standalone/templates/dgraph.service +++ b/contrib/config/terraform/aws/standalone/templates/dgraph.service @@ -6,7 +6,7 @@ Requires=dgraph-zero.service [Service] Type=simple -ExecStart=/usr/local/bin/dgraph alpha --lru_mb 2048 -p /var/run/dgraph/p -w /var/run/dgraph/w +ExecStart=/usr/local/bin/dgraph alpha -p /var/run/dgraph/p -w /var/run/dgraph/w StandardOutput=journal StandardError=journal User=dgraph diff --git a/contrib/config/terraform/gcp/standalone/templates/dgraph.service b/contrib/config/terraform/gcp/standalone/templates/dgraph.service index ac2ebe9873e..64a2dbf459c 100644 --- a/contrib/config/terraform/gcp/standalone/templates/dgraph.service +++ b/contrib/config/terraform/gcp/standalone/templates/dgraph.service @@ -6,7 +6,7 @@ Requires=dgraph-zero.service [Service] Type=simple -ExecStart=/usr/local/bin/dgraph alpha --lru_mb 2048 -p /var/run/dgraph/p -w /var/run/dgraph/w +ExecStart=/usr/local/bin/dgraph alpha -p /var/run/dgraph/p -w /var/run/dgraph/w StandardOutput=journal StandardError=journal User=dgraph diff --git a/contrib/config/terraform/kubernetes/modules/dgraph/modules/alpha/templates/alpha.tpl b/contrib/config/terraform/kubernetes/modules/dgraph/modules/alpha/templates/alpha.tpl index bbadd30e8ad..76702f2bd4c 100644 --- a/contrib/config/terraform/kubernetes/modules/dgraph/modules/alpha/templates/alpha.tpl +++ b/contrib/config/terraform/kubernetes/modules/dgraph/modules/alpha/templates/alpha.tpl @@ -3,4 +3,4 @@ set -ex # TODO: Use zero_port variable when kubernetes_service resource of Terraform supports outputs -dgraph alpha --my=$(hostname -f):7080 --lru_mb ${lru} --zero ${zero_address}:5080 +dgraph alpha --my=$(hostname -f):7080 --zero ${zero_address}:5080 diff --git a/contrib/tlstest/alpha_notls.sh b/contrib/tlstest/alpha_notls.sh index 9ef34c1c0a7..f9d5b73527c 100755 --- a/contrib/tlstest/alpha_notls.sh +++ b/contrib/tlstest/alpha_notls.sh @@ -1,3 +1,3 @@ #!/bin/bash set -e -$DGRAPH_BIN alpha --lru_mb 2048 --zero 127.0.0.1:5081 &> alpha.log +$DGRAPH_BIN alpha --zero 127.0.0.1:5081 &> alpha.log diff --git a/contrib/tlstest/alpha_tls_auth.sh b/contrib/tlstest/alpha_tls_auth.sh index ac3b6ac71bc..6d2f5db7d15 100755 --- a/contrib/tlstest/alpha_tls_auth.sh +++ b/contrib/tlstest/alpha_tls_auth.sh @@ -1,3 +1,3 @@ #!/bin/bash set -e -$DGRAPH_BIN alpha --tls_dir $PWD/tls --tls_client_auth REQUIREANDVERIFY --lru_mb 2048 --zero 127.0.0.1:5081 &> alpha.log +$DGRAPH_BIN alpha --tls_dir $PWD/tls --tls_client_auth REQUIREANDVERIFY --zero 127.0.0.1:5081 &> alpha.log diff --git a/contrib/tlstest/server_11.sh b/contrib/tlstest/server_11.sh index 11b00b12b96..5f54ded9435 100755 --- a/contrib/tlstest/server_11.sh +++ b/contrib/tlstest/server_11.sh @@ -1,3 +1,3 @@ #!/bin/bash -../../dgraph/dgraph alpha --tls_on --tls_ca_certs ca.crt --tls_cert server.crt --tls_cert_key server.key --tls_max_version=TLS11 --lru_mb 2048 --zero 127.0.0.1:5080 +../../dgraph/dgraph alpha --tls_on --tls_ca_certs ca.crt --tls_cert server.crt --tls_cert_key server.key --tls_max_version=TLS11 --zero 127.0.0.1:5080 diff --git a/contrib/tlstest/server_nopass.sh b/contrib/tlstest/server_nopass.sh index ba269c88b13..19aa16e6657 100755 --- a/contrib/tlstest/server_nopass.sh +++ b/contrib/tlstest/server_nopass.sh @@ -1,4 +1,4 @@ #!/bin/bash ../../dgraph/dgraph alpha --tls_on --tls_ca_certs ca.crt --tls_cert server.crt --tls_cert_key server.key \ ---lru_mb 2048 --zero 127.0.0.1:5081 &> dgraph.log +--zero 127.0.0.1:5081 &> dgraph.log diff --git a/contrib/tlstest/server_nopass_client_auth.sh b/contrib/tlstest/server_nopass_client_auth.sh index 6fed2427b9a..9adb1f411e1 100755 --- a/contrib/tlstest/server_nopass_client_auth.sh +++ b/contrib/tlstest/server_nopass_client_auth.sh @@ -1,3 +1,3 @@ #!/bin/bash -../../dgraph/dgraph alpha --tls_on --tls_ca_certs ca.crt --tls_cert server.crt --tls_cert_key server.key --tls_client_auth REQUIREANDVERIFY --lru_mb 2048 --zero 127.0.0.1:5081 +../../dgraph/dgraph alpha --tls_on --tls_ca_certs ca.crt --tls_cert server.crt --tls_cert_key server.key --tls_client_auth REQUIREANDVERIFY --zero 127.0.0.1:5081 diff --git a/contrib/tlstest/server_pass.sh b/contrib/tlstest/server_pass.sh index 7eaeb182215..18a2582c1f9 100755 --- a/contrib/tlstest/server_pass.sh +++ b/contrib/tlstest/server_pass.sh @@ -1,3 +1,3 @@ #!/bin/bash -../../dgraph/dgraph alpha --tls_on --tls_ca_certs ca.crt --tls_cert server_pass.crt --tls_cert_key server_pass.key --tls_cert_key_passphrase secret --lru_mb 2048 --zero 127.0.0.1:5081 &> dgraph.log +../../dgraph/dgraph alpha --tls_on --tls_ca_certs ca.crt --tls_cert server_pass.crt --tls_cert_key server_pass.key --tls_cert_key_passphrase secret --zero 127.0.0.1:5081 &> dgraph.log diff --git a/wiki/content/deploy/single-host-setup.md b/wiki/content/deploy/single-host-setup.md index 7acd3c77f22..4c0318727d2 100644 --- a/wiki/content/deploy/single-host-setup.md +++ b/wiki/content/deploy/single-host-setup.md @@ -21,8 +21,8 @@ For all other various flags, run `dgraph zero --help`. ### Run dgraph alpha ```sh -dgraph alpha --lru_mb= --my=IPADDR:7080 --zero=localhost:5080 -dgraph alpha --lru_mb= --my=IPADDR:7081 --zero=localhost:5080 -o=1 +dgraph alpha --my=IPADDR:7080 --zero=localhost:5080 +dgraph alpha --my=IPADDR:7081 --zero=localhost:5080 -o=1 ``` Notice the use of `-o` for the second Alpha to add offset to the default ports used. Zero automatically assigns an unique ID to each Alpha, which is persisted in the write ahead log (wal) directory, users can specify the index using `--idx` option. Dgraph Alphas use two directories to persist data and @@ -64,7 +64,7 @@ docker run -it -p 5080:5080 --network dgraph_default -p 6080:6080 -v ~/zero:/dgr ```sh mkdir ~/server1 # Or any other directory where data should be stored. -docker run -it -p 7080:7080 --network dgraph_default -p 8080:8080 -p 9080:9080 -v ~/server1:/dgraph dgraph/dgraph:{{< version >}} dgraph alpha --lru_mb= --zero=HOSTIPADDR:5080 --my=HOSTIPADDR:7080 +docker run -it -p 7080:7080 --network dgraph_default -p 8080:8080 -p 9080:9080 -v ~/server1:/dgraph dgraph/dgraph:{{< version >}} dgraph alpha --zero=HOSTIPADDR:5080 --my=HOSTIPADDR:7080 ``` ```sh mkdir ~/server2 # Or any other directory where data should be stored. From 2d1122fcf2210892dbab0e969f6f3156f74e5bf9 Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Sat, 3 Oct 2020 09:38:58 -0700 Subject: [PATCH 03/14] Delete more instances of lru_mb from docs/configs. --- dgraph/cmd/bulk/systest/run.sh | 2 +- wiki/content/deploy/config.md | 5 ----- wiki/content/deploy/dgraph-administration.md | 4 ++-- wiki/content/deploy/kubernetes.md | 1 - wiki/content/deploy/single-host-setup.md | 2 +- wiki/content/deploy/troubleshooting.md | 6 +++--- wiki/content/enterprise-features/access-control-lists.md | 4 ++-- wiki/content/enterprise-features/encryption-at-rest.md | 4 ++-- wiki/content/get-started/index.md | 8 -------- 9 files changed, 11 insertions(+), 25 deletions(-) diff --git a/dgraph/cmd/bulk/systest/run.sh b/dgraph/cmd/bulk/systest/run.sh index cf6d05870d3..025ed7c6736 100755 --- a/dgraph/cmd/bulk/systest/run.sh +++ b/dgraph/cmd/bulk/systest/run.sh @@ -31,7 +31,7 @@ for suite in $script_dir/suite*; do sleep 2 pushd dg >/dev/null - $(go env GOPATH)/bin/dgraph -peer localhost:8888 -lru_mb=1024 >/dev/null 2>&1 & + $(go env GOPATH)/bin/dgraph -peer localhost:8888 >/dev/null 2>&1 & dgPid=$! popd >/dev/null sleep 2 diff --git a/wiki/content/deploy/config.md b/wiki/content/deploy/config.md index 3b3af7bc3f3..b9831126ef4 100644 --- a/wiki/content/deploy/config.md +++ b/wiki/content/deploy/config.md @@ -51,7 +51,6 @@ Example JSON config file (config.json): { "my": "localhost:7080", "zero": "localhost:5080", - "lru_mb": 4096, "postings": "/path/to/p", "wal": "/path/to/w" } @@ -62,7 +61,6 @@ Example TOML config file (config.toml): ```toml my = "localhost:7080" zero = "localhost:5080" -lru_mb = 4096 postings = "/path/to/p" wal = "/path/to/w" ``` @@ -73,7 +71,6 @@ Example YAML config file (config.yml): ```yaml my: "localhost:7080" zero: "localhost:5080" -lru_mb: 4096 postings: "/path/to/p" wal: "/path/to/w" ``` @@ -83,7 +80,6 @@ Example HCL config file (config.hcl): ```hcl my = "localhost:7080" zero = "localhost:5080" -lru_mb = 4096 postings = "/path/to/p" wal = "/path/to/w" ``` @@ -92,7 +88,6 @@ Example Java properties config file (config.properties): ```text my=localhost:7080 zero=localhost:5080 -lru_mb=4096 postings=/path/to/p wal=/path/to/w ``` diff --git a/wiki/content/deploy/dgraph-administration.md b/wiki/content/deploy/dgraph-administration.md index 4760f982e0e..8379cd038a6 100644 --- a/wiki/content/deploy/dgraph-administration.md +++ b/wiki/content/deploy/dgraph-administration.md @@ -14,7 +14,7 @@ By default, admin operations can only be initiated from the machine on which the You can use the `--whitelist` option to specify whitelisted IP addresses and ranges for hosts from which admin operations can be initiated. ```sh -dgraph alpha --whitelist 172.17.0.0:172.20.0.0,192.168.1.1 --lru_mb ... +dgraph alpha --whitelist 172.17.0.0:172.20.0.0,192.168.1.1 ... ``` This would allow admin operations from hosts with IP between `172.17.0.0` and `172.20.0.0` along with the server which has IP address as `192.168.1.1`. @@ -53,7 +53,7 @@ You can specify the auth token with the `--auth_token` option for each Dgraph Al Clients must include the same auth token to make alter requests. ```sh -$ dgraph alpha --lru_mb=2048 --auth_token= +$ dgraph alpha --auth_token= ``` ```sh diff --git a/wiki/content/deploy/kubernetes.md b/wiki/content/deploy/kubernetes.md index 8a52b569689..7c74e0b652e 100644 --- a/wiki/content/deploy/kubernetes.md +++ b/wiki/content/deploy/kubernetes.md @@ -245,7 +245,6 @@ alpha: vlog: mmap postings: /dgraph/data/p wal: /dgraph/data/w - lru_mb: 2048 zero: configFile: config.yaml: | diff --git a/wiki/content/deploy/single-host-setup.md b/wiki/content/deploy/single-host-setup.md index 4c0318727d2..59ec60dd0aa 100644 --- a/wiki/content/deploy/single-host-setup.md +++ b/wiki/content/deploy/single-host-setup.md @@ -69,7 +69,7 @@ docker run -it -p 7080:7080 --network dgraph_default -p 8080:8080 -p 9080:9080 - ```sh mkdir ~/server2 # Or any other directory where data should be stored. -docker run -it -p 7081:7081 --network dgraph_default -p 8081:8081 -p 9081:9081 -v ~/server2:/dgraph dgraph/dgraph:{{< version >}} dgraph alpha --lru_mb= --zero=HOSTIPADDR:5080 --my=HOSTIPADDR:7081 -o=1 +docker run -it -p 7081:7081 --network dgraph_default -p 8081:8081 -p 9081:9081 -v ~/server2:/dgraph dgraph/dgraph:{{< version >}} dgraph alpha --zero=HOSTIPADDR:5080 --my=HOSTIPADDR:7081 -o=1 ``` Notice the use of -o for server2 to override the default ports for server2. diff --git a/wiki/content/deploy/troubleshooting.md b/wiki/content/deploy/troubleshooting.md index 28440375407..2b69632ec8d 100644 --- a/wiki/content/deploy/troubleshooting.md +++ b/wiki/content/deploy/troubleshooting.md @@ -12,9 +12,9 @@ Here are some problems that you may encounter and some solutions to try. During bulk loading of data, Dgraph can consume more memory than usual, due to high volume of writes. That's generally when you see the OOM crashes. -The recommended minimum RAM to run on desktops and laptops is 16GB. Dgraph can take up to 7-8 GB with the default setting `--lru_mb` set to 4096; so having the rest 8GB for desktop applications should keep your machine humming along. +The recommended minimum RAM to run on desktops and laptops is 16GB. -On EC2/GCE instances, the recommended minimum is 8GB. It's recommended to set `--lru_mb` to one-third of RAM size. +On EC2/GCE instances, the recommended minimum is 8GB. You could also decrease memory usage of Dgraph by setting `--badger.vlog=disk`. @@ -24,4 +24,4 @@ If you see an log error messages saying `too many open files`, you should increa During normal operations, Dgraph must be able to open many files. Your operating system may set by default a open file descriptor limit lower than what's needed for a database such as Dgraph. -On Linux and Mac, you can check the file descriptor limit with `ulimit -n -H` for the hard limit and `ulimit -n -S` for the soft limit. The soft limit should be set high enough for Dgraph to run properly. A soft limit of 65535 is a good lower bound for a production setup. You can adjust the limit as needed. \ No newline at end of file +On Linux and Mac, you can check the file descriptor limit with `ulimit -n -H` for the hard limit and `ulimit -n -S` for the soft limit. The soft limit should be set high enough for Dgraph to run properly. A soft limit of 65535 is a good lower bound for a production setup. You can adjust the limit as needed. diff --git a/wiki/content/enterprise-features/access-control-lists.md b/wiki/content/enterprise-features/access-control-lists.md index 1289ed54f48..55b6a41593c 100644 --- a/wiki/content/enterprise-features/access-control-lists.md +++ b/wiki/content/enterprise-features/access-control-lists.md @@ -42,7 +42,7 @@ Here is an example that starts one zero server and one alpha server with the ACL ```bash dgraph zero --my=localhost:5080 --replicas 1 --idx 1 --bindall --expose_trace --profile_mode block --block_rate 10 --logtostderr -v=2 -dgraph alpha --my=localhost:7080 --lru_mb=1024 --zero=localhost:5080 --logtostderr -v=3 --acl_secret_file ./hmac-secret +dgraph alpha --my=localhost:7080 --zero=localhost:5080 --logtostderr -v=3 --acl_secret_file ./hmac-secret ``` If you are using docker-compose, a sample cluster can be set up by: @@ -473,4 +473,4 @@ the password for any user) by following these steps. } ``` 5. Restart Dgraph Alpha with ACLs turned on by setting the `--acl_hmac_secret` config flag. -6. Login as groot with your new password. \ No newline at end of file +6. Login as groot with your new password. diff --git a/wiki/content/enterprise-features/encryption-at-rest.md b/wiki/content/enterprise-features/encryption-at-rest.md index 1479fa05a16..9029ace58b5 100644 --- a/wiki/content/enterprise-features/encryption-at-rest.md +++ b/wiki/content/enterprise-features/encryption-at-rest.md @@ -46,7 +46,7 @@ Here is an example that starts one Zero server and one Alpha server with the enc ```bash dgraph zero --my=localhost:5080 --replicas 1 --idx 1 -dgraph alpha --encryption_key_file ./enc_key_file --my=localhost:7080 --lru_mb=1024 --zero=localhost:5080 +dgraph alpha --encryption_key_file ./enc_key_file --my=localhost:7080 --zero=localhost:5080 ``` If multiple Alpha nodes are part of the cluster, you will need to pass the `--encryption_key_file` option to @@ -64,7 +64,7 @@ Alternatively, for encryption keys sitting on Vault server, here is an example. Next, here is an example of using Dgraph with a Vault server that holds the encryption key. ```bash dgraph zero --my=localhost:5080 --replicas 1 --idx 1 -dgraph alpha --vault_addr https://localhost:8200 --vault_roleid_file ./roleid --vault_secretid_file ./secretid --vault_field enc_key_name --my=localhost:7080 --lru_mb=1024 --zero=localhost:5080 +dgraph alpha --vault_addr https://localhost:8200 --vault_roleid_file ./roleid --vault_secretid_file ./secretid --vault_field enc_key_name --my=localhost:7080 --zero=localhost:5080 ``` If multiple Alpha nodes are part of the cluster, you will need to pass the `--encryption_key_file` option or the `--vault_*` options to diff --git a/wiki/content/get-started/index.md b/wiki/content/get-started/index.md index dec72f5ae23..1eb2708dbed 100644 --- a/wiki/content/get-started/index.md +++ b/wiki/content/get-started/index.md @@ -65,14 +65,6 @@ docker run --rm -it -p 8080:8080 -p 9080:9080 -p 8000:8000 -v ~/dgraph:/dgraph d This would start a single container with **Dgraph Alpha**, **Dgraph Zero** and **Ratel** running in it. You would find the Dgraph data stored in a folder named *dgraph* of your *home directory*. -{{% notice "tip" %}} -Usually, you need to set the estimated memory Dgraph alpha can take through `lru_mb` flag. -This is just a hint to the Dgraph alpha, and actual usage would be higher than this. -It is recommended to set lru_mb to the one-third of the available RAM. For the standalone setup, -it is set to that by default. -{{% /notice %}} - - ### Step 2: Run Mutation {{% notice "tip" %}} From 3bd5c967e1001e8efafc4164781b0127714cab13 Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Sat, 3 Oct 2020 09:50:35 -0700 Subject: [PATCH 04/14] Remove lru_flag. --- dgraph/cmd/alpha/run.go | 4 ---- worker/config.go | 19 ------------------- 2 files changed, 23 deletions(-) diff --git a/dgraph/cmd/alpha/run.go b/dgraph/cmd/alpha/run.go index 78f75b20246..8a135badb4a 100644 --- a/dgraph/cmd/alpha/run.go +++ b/dgraph/cmd/alpha/run.go @@ -157,9 +157,6 @@ they form a Raft group and provide synchronous replication. "Enterprise feature.") flag.Duration("acl_refresh_ttl", 30*24*time.Hour, "The TTL for the refresh jwt. "+ "Enterprise feature.") - flag.Float64P("lru_mb", "l", -1, // TODO: Remove this flag. - "Estimated memory the LRU cache can take. "+ - "Actual usage by the process would be more than specified here.") flag.String("mutations", "allow", "Set mutation mode to allow, disallow, or strict.") @@ -616,7 +613,6 @@ func run() { MutationsMode: worker.AllowMutations, AuthToken: Alpha.Conf.GetString("auth_token"), - AllottedMemory: Alpha.Conf.GetFloat64("lru_mb"), } opts.BadgerTables = Alpha.Conf.GetString("badger.tables") diff --git a/worker/config.go b/worker/config.go index 636a8fe8eb9..7ec953cd270 100644 --- a/worker/config.go +++ b/worker/config.go @@ -20,8 +20,6 @@ import ( "path/filepath" "time" - "github.com/golang/glog" - "github.com/dgraph-io/dgraph/posting" "github.com/dgraph-io/dgraph/x" ) @@ -54,8 +52,6 @@ type Options struct { MutationsMode int // AuthToken is the token to be passed for Alter HTTP requests. AuthToken string - // AllottedMemory is the estimated size taken by the LRU cache. - AllottedMemory float64 // PBlockCacheSize is the size of block cache for pstore PBlockCacheSize int64 @@ -85,7 +81,6 @@ func SetConfiguration(newConfig *Options) { posting.Config.Lock() defer posting.Config.Unlock() - posting.Config.AllottedMemory = Config.AllottedMemory } // MinAllottedMemory is the minimum amount of memory needed for the LRU cache. @@ -100,18 +95,4 @@ func (opt *Options) validate() { wd, err := filepath.Abs(opt.WALDir) x.Check(err) x.AssertTruef(pd != wd, "Posting and WAL directory cannot be the same ('%s').", opt.PostingDir) - if opt.AllottedMemory < 0 { - if allottedMemory := 0.25 * float64(AvailableMemory); allottedMemory > MinAllottedMemory { - opt.AllottedMemory = allottedMemory - glog.Infof( - "LRU memory (--lru_mb) set to %vMB, 25%% of the total RAM found (%vMB)\n"+ - "For more information on --lru_mb please read "+ - "https://dgraph.io/docs/deploy/#config\n", - opt.AllottedMemory, AvailableMemory) - } - } - x.AssertTruefNoTrace(opt.AllottedMemory >= MinAllottedMemory, - "LRU memory (--lru_mb) must be at least %.0f MB. Currently set to: %f\n"+ - "For more information on --lru_mb please read https://dgraph.io/docs/deploy/#config", - MinAllottedMemory, opt.AllottedMemory) } From 2f4ed1c093933239f949d4b0ac168e3482c896ee Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Sat, 3 Oct 2020 10:44:11 -0700 Subject: [PATCH 05/14] rename lru_mb endpoint to cache_mb --- dgraph/cmd/alpha/run.go | 2 +- ee/acl/acl_test.go | 4 ++-- worker/worker.go | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dgraph/cmd/alpha/run.go b/dgraph/cmd/alpha/run.go index 8a135badb4a..80e2b28fee8 100644 --- a/dgraph/cmd/alpha/run.go +++ b/dgraph/cmd/alpha/run.go @@ -532,7 +532,7 @@ func setupServer(closer *z.Closer) { exportHandler(w, r, adminServer) })))) - http.Handle("/admin/config/lru_mb", allowedMethodsHandler(allowedMethods{ + http.Handle("/admin/config/cache_mb", allowedMethodsHandler(allowedMethods{ http.MethodGet: true, http.MethodPut: true, }, adminAuthHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { diff --git a/ee/acl/acl_test.go b/ee/acl/acl_test.go index 1d4b8b23997..f54ec632fc1 100644 --- a/ee/acl/acl_test.go +++ b/ee/acl/acl_test.go @@ -2587,7 +2587,7 @@ func TestGuardianOnlyAccessForAdminEndpoints(t *testing.T) { name: "config update has guardian auth", query: ` mutation { - config(input: {lruMb: 1}) { + config(input: {lruMb: -1}) { response { code message @@ -2597,7 +2597,7 @@ func TestGuardianOnlyAccessForAdminEndpoints(t *testing.T) { queryName: "config", testGuardianAccess: true, guardianErrs: x.GqlErrorList{{ - Message: "resolving config failed because lru_mb must be at least 1024\n", + Message: "resolving config failed because lru_mb must be non-negative\n", Locations: []x.Location{{Line: 3, Column: 8}}, }}, guardianData: `{"config": null}`, diff --git a/worker/worker.go b/worker/worker.go index 5bbdd1cc9eb..753c79753ef 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -126,10 +126,10 @@ func BlockingStop() { workerServer.Stop() } -// UpdateLruMb updates the value of lru_mb -func UpdateLruMb(memoryMB float64) error { - if memoryMB < MinAllottedMemory { - return errors.Errorf("lru_mb must be at least %.0f\n", MinAllottedMemory) +// UpdateCacheMb updates the value of cache_mb and updates the corresponding cache sizes. +func UpdateCacheMb(memoryMB float64) error { + if memoryMB < 0 { + return errors.Errorf("cache_mb must be non-negative.") } posting.Config.Lock() From 08178a6165d3ad3216ecf1f6eecc061b933d2a03 Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Sun, 4 Oct 2020 09:15:46 -0700 Subject: [PATCH 06/14] Rename graphql interface to cacheMb --- dgraph/cmd/alpha/admin.go | 12 ++++++------ ee/acl/acl_test.go | 4 ++-- graphql/admin/admin.go | 10 +++++----- graphql/admin/config.go | 8 ++++---- wiki/content/graphql/admin/index.md | 10 +++++----- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/dgraph/cmd/alpha/admin.go b/dgraph/cmd/alpha/admin.go index 2c2482189d8..7f382c734fe 100644 --- a/dgraph/cmd/alpha/admin.go +++ b/dgraph/cmd/alpha/admin.go @@ -172,14 +172,14 @@ func memoryLimitPutHandler(w http.ResponseWriter, r *http.Request, adminServer w } gqlReq := &schema.Request{ Query: ` - mutation config($lruMb: Float) { - config(input: {lruMb: $lruMb}) { + mutation config($cacheMb: Float) { + config(input: {cacheMb: $cacheMb}) { response { code } } }`, - Variables: map[string]interface{}{"lruMb": memoryMB}, + Variables: map[string]interface{}{"cacheMb": memoryMB}, } resp := resolveWithAdminServer(gqlReq, r, adminServer) @@ -196,19 +196,19 @@ func memoryLimitGetHandler(w http.ResponseWriter, r *http.Request, adminServer w Query: ` query { config { - lruMb + cacheMb } }`, } resp := resolveWithAdminServer(gqlReq, r, adminServer) var data struct { Config struct { - LruMb float64 + CacheMb float64 } } x.Check(json.Unmarshal(resp.Data.Bytes(), &data)) - if _, err := fmt.Fprintln(w, data.Config.LruMb); err != nil { + if _, err := fmt.Fprintln(w, data.Config.CacheMb); err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) } } diff --git a/ee/acl/acl_test.go b/ee/acl/acl_test.go index f54ec632fc1..81954b19d6e 100644 --- a/ee/acl/acl_test.go +++ b/ee/acl/acl_test.go @@ -2587,7 +2587,7 @@ func TestGuardianOnlyAccessForAdminEndpoints(t *testing.T) { name: "config update has guardian auth", query: ` mutation { - config(input: {lruMb: -1}) { + config(input: {cacheMb: -1}) { response { code message @@ -2607,7 +2607,7 @@ func TestGuardianOnlyAccessForAdminEndpoints(t *testing.T) { query: ` query { config { - lruMb + cacheMb } }`, queryName: "config", diff --git a/graphql/admin/admin.go b/graphql/admin/admin.go index a0d9d228c6b..7bce32b1c04 100644 --- a/graphql/admin/admin.go +++ b/graphql/admin/admin.go @@ -249,12 +249,12 @@ const ( } input ConfigInput { - """ - Estimated memory the LRU cache can take. Actual usage by the process would be - more than specified here. (default -1 means no set limit) + Estimated memory the caches can take. Actual usage by the process would be + more than specified here. The caches will be updated according to the + cache_percentage flag. """ - lruMb: Float + cacheMb: Float """ True value of logRequest enables logging of all the requests coming to alphas. @@ -268,7 +268,7 @@ const ( } type Config { - lruMb: Float + cacheMb: Float } ` + adminTypes + ` diff --git a/graphql/admin/config.go b/graphql/admin/config.go index d570f98cb4d..a203c62a483 100644 --- a/graphql/admin/config.go +++ b/graphql/admin/config.go @@ -28,7 +28,7 @@ import ( ) type configInput struct { - LruMB float64 + CacheMb float64 // LogRequest is used to update WorkerOptions.LogRequest. true value of LogRequest enables // logging of all requests coming to alphas. LogRequest type has been kept as *bool instead of // bool to avoid updating WorkerOptions.LogRequest when it has default value of false. @@ -43,8 +43,8 @@ func resolveUpdateConfig(ctx context.Context, m schema.Mutation) (*resolve.Resol return resolve.EmptyResult(m, err), false } - if input.LruMB > 0 { - if err = worker.UpdateLruMb(input.LruMB); err != nil { + if input.CacheMb > 0 { + if err = worker.UpdateCacheMb(input.CacheMb); err != nil { return resolve.EmptyResult(m, err), false } } @@ -65,7 +65,7 @@ func resolveGetConfig(ctx context.Context, q schema.Query) *resolve.Resolved { conf := make(map[string]interface{}) posting.Config.Lock() - conf["lruMb"] = posting.Config.AllottedMemory + conf["cacheMb"] = posting.Config.AllottedMemory posting.Config.Unlock() return &resolve.Resolved{ diff --git a/wiki/content/graphql/admin/index.md b/wiki/content/graphql/admin/index.md index 94cd93ff351..ed8d75dd65d 100644 --- a/wiki/content/graphql/admin/index.md +++ b/wiki/content/graphql/admin/index.md @@ -246,12 +246,12 @@ Here are the important types, queries, and mutations from the admin schema. } input ConfigInput { - """ - Estimated memory the LRU cache can take. Actual usage by the process would be - more than specified here. (default -1 means no set limit) + Estimated memory the caches can take. Actual usage by the process would be + more than specified here. The caches will be updated according to the + cache_percentage flag. """ - lruMb: Float + cacheMb: Float """ True value of logRequest enables logging of all the requests coming to alphas. @@ -265,7 +265,7 @@ Here are the important types, queries, and mutations from the admin schema. } type Config { - lruMb: Float + cacheMb: Float } type Query { From 74df0e354b3945c664e1462f30652d6e503b3d76 Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Sun, 4 Oct 2020 10:10:11 -0700 Subject: [PATCH 07/14] implement UpdateCacheMb function. --- dgraph/cmd/alpha/run.go | 5 +++-- go.mod | 4 ++-- go.sum | 9 ++++----- graphql/admin/config.go | 7 ++----- posting/config.go | 1 - posting/lists.go | 4 ++++ worker/config.go | 10 ++++++---- worker/worker.go | 16 ++++++++++++---- 8 files changed, 33 insertions(+), 23 deletions(-) diff --git a/dgraph/cmd/alpha/run.go b/dgraph/cmd/alpha/run.go index 80e2b28fee8..2b1dc79848f 100644 --- a/dgraph/cmd/alpha/run.go +++ b/dgraph/cmd/alpha/run.go @@ -607,12 +607,13 @@ func run() { PostingDir: Alpha.Conf.GetString("postings"), WALDir: Alpha.Conf.GetString("wal"), PostingDirCompressionLevel: level, + CachePercentage: cachePercentage, PBlockCacheSize: pstoreBlockCacheSize, PIndexCacheSize: pstoreIndexCacheSize, WalCache: walCache, - MutationsMode: worker.AllowMutations, - AuthToken: Alpha.Conf.GetString("auth_token"), + MutationsMode: worker.AllowMutations, + AuthToken: Alpha.Conf.GetString("auth_token"), } opts.BadgerTables = Alpha.Conf.GetString("badger.tables") diff --git a/go.mod b/go.mod index 4bc733c9162..34c112385e5 100644 --- a/go.mod +++ b/go.mod @@ -19,10 +19,10 @@ require ( github.com/blevesearch/segment v0.0.0-20160915185041-762005e7a34f // indirect github.com/blevesearch/snowballstem v0.0.0-20180110192139-26b06a2c243d // indirect github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd - github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20201001173203-feb98a8d999d + github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20201004162312-251f30f523c3 github.com/dgraph-io/dgo/v200 v200.0.0-20200805103119-a3544c464dd6 github.com/dgraph-io/graphql-transport-ws v0.0.0-20200916064635-48589439591b - github.com/dgraph-io/ristretto v0.0.4-0.20201002035039-b807f09fa376 + github.com/dgraph-io/ristretto v0.0.4-0.20201004162201-8d941422a322 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 diff --git a/go.sum b/go.sum index 37b35b0563c..85d1b6195d7 100644 --- a/go.sum +++ b/go.sum @@ -84,15 +84,14 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgraph-io/badger v1.6.0 h1:DshxFxZWXUcO0xX476VJC07Xsr6ZCBVRHKZ93Oh7Evo= github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20201001173203-feb98a8d999d h1:/0/ylo7/wmNoDM/aj4FHW4FQGGCPbTkp6pQK1tlnhJs= -github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20201001173203-feb98a8d999d/go.mod h1:2uGEvGm+JSDLd5UAaKIFSbXDcYyeH0fWJP4N2HMMYMI= +github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20201004162312-251f30f523c3 h1:1/qyacdTB+4F9/2Lv9x2M14ALb2TBl2HAb+onmvBLE8= +github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20201004162312-251f30f523c3/go.mod h1:Xqh1Mm3jw41fDHLyVRxnniET3zrHHQaphsYi/vXojHQ= github.com/dgraph-io/dgo/v200 v200.0.0-20200805103119-a3544c464dd6 h1:toHzMCdCUgYsjM0cW9+wafnKFXfp1HizIJUyzihN+vk= github.com/dgraph-io/dgo/v200 v200.0.0-20200805103119-a3544c464dd6/go.mod h1:rHa+h3kI4M8ASOirxyIyNeXBfHFgeskVUum2OrDMN3U= github.com/dgraph-io/graphql-transport-ws v0.0.0-20200916064635-48589439591b h1:PDEhlwHpkEQ5WBfOOKZCNZTXFDGyCEWTYDhxGQbyIpk= github.com/dgraph-io/graphql-transport-ws v0.0.0-20200916064635-48589439591b/go.mod h1:7z3c/5w0sMYYZF5bHsrh8IH4fKwG5O5Y70cPH1ZLLRQ= -github.com/dgraph-io/ristretto v0.0.4-0.20200906165740-41ebdbffecfd/go.mod h1:YylP9MpCYGVZQrly/j/diqcdUetCRRePeBB0c2VGXsA= -github.com/dgraph-io/ristretto v0.0.4-0.20201002035039-b807f09fa376 h1:bp6nDHi2H+P7TTY/1MbwRcwSyMiDi3aD9w8PpF+kj+Q= -github.com/dgraph-io/ristretto v0.0.4-0.20201002035039-b807f09fa376/go.mod h1:bDI4cDaalvYSji3vBVDKrn9ouDZrwN974u8ZO/AhYXs= +github.com/dgraph-io/ristretto v0.0.4-0.20201004162201-8d941422a322 h1:cOMi6YwCibSAxP/Ewue/5L3vgqe5PwwUKtAKIrNaZy0= +github.com/dgraph-io/ristretto v0.0.4-0.20201004162201-8d941422a322/go.mod h1:bDI4cDaalvYSji3vBVDKrn9ouDZrwN974u8ZO/AhYXs= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 h1:CaO/zOnF8VvUfEbhRatPcwKVWamvbYd8tQGRWacE9kU= diff --git a/graphql/admin/config.go b/graphql/admin/config.go index a203c62a483..92837e7d845 100644 --- a/graphql/admin/config.go +++ b/graphql/admin/config.go @@ -22,13 +22,12 @@ import ( "github.com/dgraph-io/dgraph/graphql/resolve" "github.com/dgraph-io/dgraph/graphql/schema" - "github.com/dgraph-io/dgraph/posting" "github.com/dgraph-io/dgraph/worker" "github.com/golang/glog" ) type configInput struct { - CacheMb float64 + CacheMb int64 // LogRequest is used to update WorkerOptions.LogRequest. true value of LogRequest enables // logging of all requests coming to alphas. LogRequest type has been kept as *bool instead of // bool to avoid updating WorkerOptions.LogRequest when it has default value of false. @@ -64,9 +63,7 @@ func resolveGetConfig(ctx context.Context, q schema.Query) *resolve.Resolved { glog.Info("Got config query through GraphQL admin API") conf := make(map[string]interface{}) - posting.Config.Lock() - conf["cacheMb"] = posting.Config.AllottedMemory - posting.Config.Unlock() + conf["cacheMb"] = worker.Config.CacheMb return &resolve.Resolved{ Data: map[string]interface{}{q.Name(): conf}, diff --git a/posting/config.go b/posting/config.go index 0b85f1db796..918ffb05735 100644 --- a/posting/config.go +++ b/posting/config.go @@ -21,7 +21,6 @@ import "sync" // Options contains options for the postings package. type Options struct { sync.Mutex - AllottedMemory float64 CommitFraction float64 } diff --git a/posting/lists.go b/posting/lists.go index f7c5dbf31d2..5502935f5bc 100644 --- a/posting/lists.go +++ b/posting/lists.go @@ -170,6 +170,10 @@ func Init(ps *badger.DB, cacheSize int64) { }() } +func UpdateMaxCost(maxCost int64) { + lCache.UpdateMaxCost(maxCost) +} + // Cleanup waits until the closer has finished processing. func Cleanup() { closer.SignalAndWait() diff --git a/worker/config.go b/worker/config.go index 7ec953cd270..072719d4d65 100644 --- a/worker/config.go +++ b/worker/config.go @@ -20,7 +20,6 @@ import ( "path/filepath" "time" - "github.com/dgraph-io/dgraph/posting" "github.com/dgraph-io/dgraph/x" ) @@ -66,6 +65,12 @@ type Options struct { AccessJwtTtl time.Duration // RefreshJwtTtl is the TTL of the refresh JWT. RefreshJwtTtl time.Duration + + // CachePercentage is the comma-separated list of cache percentages + // used to split the total cache size among the multiple caches. + CachePercentage string + // CacheMb is the total memory allocated between all the caches. + CacheMb int64 } // Config holds an instance of the server options.. @@ -78,9 +83,6 @@ func SetConfiguration(newConfig *Options) { } newConfig.validate() Config = *newConfig - - posting.Config.Lock() - defer posting.Config.Unlock() } // MinAllottedMemory is the minimum amount of memory needed for the LRU cache. diff --git a/worker/worker.go b/worker/worker.go index 753c79753ef..21d8da912e9 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -127,14 +127,22 @@ func BlockingStop() { } // UpdateCacheMb updates the value of cache_mb and updates the corresponding cache sizes. -func UpdateCacheMb(memoryMB float64) error { +func UpdateCacheMb(memoryMB int64) error { if memoryMB < 0 { return errors.Errorf("cache_mb must be non-negative.") } - posting.Config.Lock() - posting.Config.AllottedMemory = memoryMB - posting.Config.Unlock() + cachePercent, err := x.GetCachePercentages(Config.CachePercentage, 4) + if err != nil { + return err + } + plCacheSize := (cachePercent[0] * (memoryMB << 20)) / 100 + blockCacheSize := (cachePercent[1] * (memoryMB << 20)) / 100 + indexCacheSize := (cachePercent[2] * (memoryMB << 20)) / 100 + + posting.UpdateMaxCost(plCacheSize) + pstore.UpdateCacheMaxCost(badger.BlockCache, blockCacheSize) + pstore.UpdateCacheMaxCost(badger.IndexCache, indexCacheSize) return nil } From 030f15fe55dfaabbf5339c75bf1d8ac56ccf886d Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Tue, 6 Oct 2020 11:12:19 -0700 Subject: [PATCH 08/14] revert blank line change. --- graphql/e2e/normal/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphql/e2e/normal/docker-compose.yml b/graphql/e2e/normal/docker-compose.yml index aa56abf3717..0524f844d7c 100644 --- a/graphql/e2e/normal/docker-compose.yml +++ b/graphql/e2e/normal/docker-compose.yml @@ -86,4 +86,4 @@ services: - type: bind source: ./script.js target: /app/script.js - read_only: true + read_only: true \ No newline at end of file From 2a2e88d8b1f505ad15cb5af1e3851f0c7723769f Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Tue, 6 Oct 2020 13:09:42 -0700 Subject: [PATCH 09/14] fix tests. --- dgraph/cmd/alpha/admin.go | 2 +- ee/acl/acl_test.go | 2 +- graphql/admin/config.go | 10 ++++------ worker/worker.go | 4 +++- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dgraph/cmd/alpha/admin.go b/dgraph/cmd/alpha/admin.go index 7f382c734fe..1a35e7756e0 100644 --- a/dgraph/cmd/alpha/admin.go +++ b/dgraph/cmd/alpha/admin.go @@ -172,7 +172,7 @@ func memoryLimitPutHandler(w http.ResponseWriter, r *http.Request, adminServer w } gqlReq := &schema.Request{ Query: ` - mutation config($cacheMb: Float) { + mutation config($cacheMb: Int) { config(input: {cacheMb: $cacheMb}) { response { code diff --git a/ee/acl/acl_test.go b/ee/acl/acl_test.go index 81954b19d6e..61da0e340db 100644 --- a/ee/acl/acl_test.go +++ b/ee/acl/acl_test.go @@ -2597,7 +2597,7 @@ func TestGuardianOnlyAccessForAdminEndpoints(t *testing.T) { queryName: "config", testGuardianAccess: true, guardianErrs: x.GqlErrorList{{ - Message: "resolving config failed because lru_mb must be non-negative\n", + Message: "resolving config failed because cache_mb must be non-negative", Locations: []x.Location{{Line: 3, Column: 8}}, }}, guardianData: `{"config": null}`, diff --git a/graphql/admin/config.go b/graphql/admin/config.go index 92837e7d845..cbaa67cf296 100644 --- a/graphql/admin/config.go +++ b/graphql/admin/config.go @@ -27,7 +27,7 @@ import ( ) type configInput struct { - CacheMb int64 + CacheMb float64 // LogRequest is used to update WorkerOptions.LogRequest. true value of LogRequest enables // logging of all requests coming to alphas. LogRequest type has been kept as *bool instead of // bool to avoid updating WorkerOptions.LogRequest when it has default value of false. @@ -42,10 +42,8 @@ func resolveUpdateConfig(ctx context.Context, m schema.Mutation) (*resolve.Resol return resolve.EmptyResult(m, err), false } - if input.CacheMb > 0 { - if err = worker.UpdateCacheMb(input.CacheMb); err != nil { - return resolve.EmptyResult(m, err), false - } + if err = worker.UpdateCacheMb(int64(input.CacheMb)); err != nil { + return resolve.EmptyResult(m, err), false } // input.LogRequest will be nil, when it is not specified explicitly in config request. @@ -63,7 +61,7 @@ func resolveGetConfig(ctx context.Context, q schema.Query) *resolve.Resolved { glog.Info("Got config query through GraphQL admin API") conf := make(map[string]interface{}) - conf["cacheMb"] = worker.Config.CacheMb + conf["cacheMb"] = float64(worker.Config.CacheMb) return &resolve.Resolved{ Data: map[string]interface{}{q.Name(): conf}, diff --git a/worker/worker.go b/worker/worker.go index 21d8da912e9..80f0335b0eb 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -128,8 +128,10 @@ func BlockingStop() { // UpdateCacheMb updates the value of cache_mb and updates the corresponding cache sizes. func UpdateCacheMb(memoryMB int64) error { + glog.Infof("memoryMB %d", memoryMB) if memoryMB < 0 { - return errors.Errorf("cache_mb must be non-negative.") + glog.Infof("negative memoryMB") + return errors.Errorf("cache_mb must be non-negative") } cachePercent, err := x.GetCachePercentages(Config.CachePercentage, 4) From b17c4ded2628bce08b26a966ab8db98f7c017327 Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Tue, 6 Oct 2020 14:36:47 -0700 Subject: [PATCH 10/14] fix build issues. --- posting/list_test.go | 1 - worker/config.go | 3 --- worker/worker_test.go | 1 - 3 files changed, 5 deletions(-) diff --git a/posting/list_test.go b/posting/list_test.go index 1e29d9f23f8..609aa90fc61 100644 --- a/posting/list_test.go +++ b/posting/list_test.go @@ -1340,7 +1340,6 @@ var ps *badger.DB func TestMain(m *testing.M) { x.Init() - Config.AllottedMemory = 1024.0 Config.CommitFraction = 0.10 dir, err := ioutil.TempDir("", "storetest_") diff --git a/worker/config.go b/worker/config.go index 5c698077e3b..7dfd97fa252 100644 --- a/worker/config.go +++ b/worker/config.go @@ -89,9 +89,6 @@ func SetConfiguration(newConfig *Options) { Config = *newConfig } -// MinAllottedMemory is the minimum amount of memory needed for the LRU cache. -const MinAllottedMemory = 1024.0 - // AvailableMemory is the total size of the memory we were able to identify. var AvailableMemory int64 diff --git a/worker/worker_test.go b/worker/worker_test.go index 547502bf23b..d09732dd828 100644 --- a/worker/worker_test.go +++ b/worker/worker_test.go @@ -362,7 +362,6 @@ func TestProcessTaskIndex(t *testing.T) { func TestMain(m *testing.M) { x.Init() - posting.Config.AllottedMemory = 1024.0 posting.Config.CommitFraction = 0.10 gr = new(groupi) gr.gid = 1 From bcc4a43721790792b0c35f7cba51a1800394e751 Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Tue, 6 Oct 2020 14:40:31 -0700 Subject: [PATCH 11/14] update badger. --- go.mod | 4 ++-- go.sum | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index a4265b56ea2..18167bf283e 100644 --- a/go.mod +++ b/go.mod @@ -19,10 +19,10 @@ require ( github.com/blevesearch/segment v0.0.0-20160915185041-762005e7a34f // indirect github.com/blevesearch/snowballstem v0.0.0-20180110192139-26b06a2c243d // indirect github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd - github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20201004162312-251f30f523c3 + github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20201006213917-ed7ecaecb0ff github.com/dgraph-io/dgo/v200 v200.0.0-20200805103119-a3544c464dd6 github.com/dgraph-io/graphql-transport-ws v0.0.0-20200916064635-48589439591b - github.com/dgraph-io/ristretto v0.0.4-0.20201004162201-8d941422a322 + github.com/dgraph-io/ristretto v0.0.4-0.20201006213726-068b2f4c1294 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 diff --git a/go.sum b/go.sum index 85d1b6195d7..72058e5c7bc 100644 --- a/go.sum +++ b/go.sum @@ -84,14 +84,14 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgraph-io/badger v1.6.0 h1:DshxFxZWXUcO0xX476VJC07Xsr6ZCBVRHKZ93Oh7Evo= github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20201004162312-251f30f523c3 h1:1/qyacdTB+4F9/2Lv9x2M14ALb2TBl2HAb+onmvBLE8= -github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20201004162312-251f30f523c3/go.mod h1:Xqh1Mm3jw41fDHLyVRxnniET3zrHHQaphsYi/vXojHQ= +github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20201006213917-ed7ecaecb0ff h1:jrYCX4lgJweyxnDWXKBX6epD6WztChCIqlldGJ47XH8= +github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20201006213917-ed7ecaecb0ff/go.mod h1:NqG8CMJ6bbBrbpiC4WVC17xWVLaNJsTsifxi6FacUDQ= github.com/dgraph-io/dgo/v200 v200.0.0-20200805103119-a3544c464dd6 h1:toHzMCdCUgYsjM0cW9+wafnKFXfp1HizIJUyzihN+vk= github.com/dgraph-io/dgo/v200 v200.0.0-20200805103119-a3544c464dd6/go.mod h1:rHa+h3kI4M8ASOirxyIyNeXBfHFgeskVUum2OrDMN3U= github.com/dgraph-io/graphql-transport-ws v0.0.0-20200916064635-48589439591b h1:PDEhlwHpkEQ5WBfOOKZCNZTXFDGyCEWTYDhxGQbyIpk= github.com/dgraph-io/graphql-transport-ws v0.0.0-20200916064635-48589439591b/go.mod h1:7z3c/5w0sMYYZF5bHsrh8IH4fKwG5O5Y70cPH1ZLLRQ= -github.com/dgraph-io/ristretto v0.0.4-0.20201004162201-8d941422a322 h1:cOMi6YwCibSAxP/Ewue/5L3vgqe5PwwUKtAKIrNaZy0= -github.com/dgraph-io/ristretto v0.0.4-0.20201004162201-8d941422a322/go.mod h1:bDI4cDaalvYSji3vBVDKrn9ouDZrwN974u8ZO/AhYXs= +github.com/dgraph-io/ristretto v0.0.4-0.20201006213726-068b2f4c1294 h1:46tiK5GjGTmOpS6YdY38x6DcNEmQKRw8igN+Tsgcnlk= +github.com/dgraph-io/ristretto v0.0.4-0.20201006213726-068b2f4c1294/go.mod h1:bDI4cDaalvYSji3vBVDKrn9ouDZrwN974u8ZO/AhYXs= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 h1:CaO/zOnF8VvUfEbhRatPcwKVWamvbYd8tQGRWacE9kU= @@ -163,6 +163,8 @@ github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85q github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/codesearch v1.0.0 h1:z4h5JoHkUS+GqxqPDrldC3Y0Qq0vHAGgaDEW5pWU/ys= github.com/google/codesearch v1.0.0/go.mod h1:qCnXDFnak/trCmLaE50kgPte3AX9jSeruZexWEOivi0= +github.com/google/flatbuffers v1.12.0 h1:/PtAHvnBY4Kqnx/xCQ3OIV9uYcSFGScBsWI3Oogeh6w= +github.com/google/flatbuffers v1.12.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= From 1bfce228edfe1f58956de10eae70f9e79a4be24a Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Tue, 6 Oct 2020 14:42:58 -0700 Subject: [PATCH 12/14] fix build. --- worker/draft.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/draft.go b/worker/draft.go index c0194ef7392..b74b56e4cc0 100644 --- a/worker/draft.go +++ b/worker/draft.go @@ -1317,7 +1317,7 @@ func (n *node) calculateTabletSizes() { total += size } - tableInfos := pstore.Tables(false) + tableInfos := pstore.Tables() previousLeft := "" var previousSize int64 glog.V(2).Infof("Calculating tablet sizes. Found %d tables\n", len(tableInfos)) From ba131887fbbfea828c8e9952b9cd8d2809a4644f Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Wed, 7 Oct 2020 15:30:26 -0700 Subject: [PATCH 13/14] Fix build issues. --- worker/worker.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/worker/worker.go b/worker/worker.go index 80f0335b0eb..56e0e7765fd 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -143,8 +143,12 @@ func UpdateCacheMb(memoryMB int64) error { indexCacheSize := (cachePercent[2] * (memoryMB << 20)) / 100 posting.UpdateMaxCost(plCacheSize) - pstore.UpdateCacheMaxCost(badger.BlockCache, blockCacheSize) - pstore.UpdateCacheMaxCost(badger.IndexCache, indexCacheSize) + if _, err := pstore.CacheMaxCost(badger.BlockCache, blockCacheSize); err != nil { + return errors.Wrapf(err, "cannot update block cache size") + } + if _, err := pstore.CacheMaxCost(badger.IndexCache, indexCacheSize); err != nil { + return errors.Wrapf(err, "cannot update index cache size") + } return nil } From 07bd9c40252a55431794b711bdb6ba66829f85de Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Wed, 7 Oct 2020 17:18:07 -0700 Subject: [PATCH 14/14] Update log statement. --- worker/worker.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/worker/worker.go b/worker/worker.go index 56e0e7765fd..f96839cc735 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -128,9 +128,8 @@ func BlockingStop() { // UpdateCacheMb updates the value of cache_mb and updates the corresponding cache sizes. func UpdateCacheMb(memoryMB int64) error { - glog.Infof("memoryMB %d", memoryMB) + glog.Infof("Updating cacheMb to %d", memoryMB) if memoryMB < 0 { - glog.Infof("negative memoryMB") return errors.Errorf("cache_mb must be non-negative") }