This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @celery.task | |
| def create_book(name, pub_date): | |
| Book.objects.create(name=name, pub_date=pub_date) | |
| print Book.objects.all() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| #coding=utf-8 | |
| import sys, os | |
| import time | |
| project_path = os.path.dirname(__file__) | |
| project_path = os.path.join(project_path, '..') | |
| sys.path.append(project_path) | |
| import threading | |
| from Queue import Queue, Empty as QueueEmpty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| #coding=utf-8 | |
| import sys, os | |
| import time | |
| project_path = os.path.dirname(__file__) | |
| project_path = os.path.join(project_path, '..') | |
| sys.path.append(project_path) | |
| import threading | |
| from Queue import Queue, Empty as QueueEmpty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import psutil | |
| import pyinotify | |
| import os | |
| import signal | |
| class EventHandler(pyinotify.ProcessEvent): | |
| def process_default(self, event): | |
| if event.name.endswith(".conf"): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ################################################################## | |
| # /etc/elasticsearch/elasticsearch.yml | |
| # | |
| # Base configuration for a write heavy cluster | |
| # | |
| # Cluster / Node Basics | |
| cluster.name: logng | |
| # Node can have abritrary attributes we can use for routing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # yum list \*openssl\* | |
| yum install -y openssl098e | |
| yum install -y zlib | |
| ln -s /usr/lib64/libssl.so.0.9.8e /usr/lib64/libssl.so.0.9.8 | |
| ln -s /usr/lib64/libcrypto.so.0.9.8e /usr/lib64/libcrypto.so.0.9.8 | |
| ln -s /lib64/libbz2.so.1 /lib64/libbz2.so.1.0 | |
| wget https://bitbucket.org/pypy/pypy/downloads/pypy-1.8-linux64.tar.bz2 | |
| tar -xf pypy-1.8-linux64.tar.bz2 | |
| cp -r pypy-1.8 /opt | |
| ln -s /opt/pypy-1.8/bin/pypy /usr/local/bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; Sample supervisor config file. | |
| ; | |
| ; For more information on the config file, please see: | |
| ; http://supervisord.org/configuration.html | |
| ; | |
| ; Notes: | |
| ; - Shell expansion ("~" or "$HOME") is not supported. Environment | |
| ; variables can be expanded using this syntax: "%(ENV_HOME)s". | |
| ; - Quotes around values are not supported, except in the case of | |
| ; the environment= options as shown below. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ################################################################## | |
| # /etc/elasticsearch/elasticsearch.yml | |
| # | |
| # Base configuration for a write heavy cluster | |
| # | |
| # Cluster / Node Basics | |
| cluster.name: {{ cluster_name }} | |
| # Node can have abritrary attributes we can use for routing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ^C2017-03-14 19:22:31,795 consumer.py [funcname:_maybe_auto_commit_offsets_sync] [line:405] ERROR Offset commit failed: This is likely to cause duplicate message delivery | |
| Traceback (most recent call last): | |
| File "/usr/local/python27/lib/python2.7/site-packages/kafka/coordinator/consumer.py", line 394, in _maybe_auto_commit_offsets_sync | |
| self.commit_offsets_sync(self._subscription.all_consumed_offsets()) | |
| File "/usr/local/python27/lib/python2.7/site-packages/kafka/coordinator/consumer.py", line 379, in commit_offsets_sync | |
| self._client.poll(future=future) | |
| File "/usr/local/python27/lib/python2.7/site-packages/kafka/client_async.py", line 512, in poll | |
| responses.extend(self._poll(timeout, sleep=sleep)) | |
| File "/usr/local/python27/lib/python2.7/site-packages/kafka/client_async.py", line 565, in _poll | |
| response = conn.recv() # Note: conn.recv runs callbacks / errbacks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| ### | |
| # Elasticsearch Rolling restart using Ansible | |
| ### | |
| ## | |
| ## Why is this needed? | |
| ## | |
| # | |
| # Even if you use a serial setting to limit the number of nodes processed at one |
OlderNewer