Сообщения

How to simulate the loss of the Consul.

You can simulate the loss of the Consul for one instance closing a connection to the 8500 port via iptables. For closing port 8500 need to add rule: iptables -A OUTPUT -p tcp --dport 8500 -j DROP How to remove the rule. 1. Found rule number: iptables -L --line-number 2. In the OUTPUT section found our rule, likely this will number 1, and delete it: iptables -D OUTPUT 1

How To Become a DevOps Engineer In Six Months or Less

You can read in this article: https://medium.com/@devfire/how-to-become-a-devops-engineer-in-six-months-or-less-366097df7737

How-to use cUrl for work with ZKUI.

Изображение
ZKUI is an open source (under Apache 2.0 license ) a UI dashboard that allows CRUD operations on Zookeeper. But sometimes you can want to upload something to the Zookeeper via ZKUI automatically. And as far as I could understand ZKUI don't have API for this purpose, but you can always use cUrl . First of all, you need to authenticate in the ZKUI using LDAP login/password: curl -c COOKIE --data "username=USERNAME&password=PASSWORD&action= 'Sign In' " https: //ZKUI_ADDRESS/login After that, you can use the COOKIE file to communicate with ZKUI. Use the next commands: To export all data to a file: curl -c COOKIE -b COOKIE -s -S "https: //ZKUI_ADDRESS/export?zkPath=/" > FILE To import data from a file: curl -c COOKIE -b COOKIE -s -S --form scmFile=@FILE --form Import=submit https: //ZKUI_ADDRESS/ import Please note: you can set "--form scmOverwrite=true" if you want to overwrite existing properties. ...

How to work with authentication in Zookeeper?

Изображение
In this article, I tried to collect all my experience and add links which I used to set up authentication in Zookeeper. First of all, you need to run Zookeeper (ZK) with the password for "super" user. We need to use DigestAuthenticationProvider for this. Need to generate digest of a given password and after that, you can run Zookeeper with option -DSERVER_JVMFLAGS=-Dzookeeper.DigestAuthenticationProvider.superDigest=super:<password digest> How to generate digest of a given password. For generating  digest you need to do next: /bin/java -cp "/opt/zookeeper-3.4.9.jar /opt/lib/slf4j-api-1.6.1.jar" org.apache.zookeeper.server.auth.DigestAuthenticationProvider super:pass (by link , you can find a slightly different way). The output will be: super:CiymZRNkXx0HJFQhdpGmqJqKuHM= Please note: this is example and digest may not match the password. After that, you need to set SERVER_JVMFLAGS and restart Zookeeper: export SERVER_JVMFLAGS="-Dzookeeper....

Mac OS root bug

It has been reported that at least MacOS High Sierra has a default root account with no password.  You can check it for yourself by going to System Preferences > Users & Groups > Click the lock to make changes. Then use "root" with no password and try it for several times. I think, currently, we cannot be 100 % sure that this issue does not apply to other MacOS versions.

Free Weekend in codeschool.com!

Изображение
Got plans this weekend?  Now you do! codeschool.com opening up FREE access to their entire content library from November 17–19. It’s a learning free-for-all! (Literally — it’s free for all to learn.) What codeschool.com says about themselves: Code School is an online learning destination for existing and aspiring developers that teaches through entertaining content. Each course is built around a creative theme and storyline so that it feels like you’re playing a game, not sitting in a classroom. We combine gaming mechanics with video instruction and in-browser coding challenges to make learning fun and memorable. With over 60 courses covering HTML/CSS, JavaScript, Ruby, Python, .NET, iOS, Git, databases, and more, Code School pairs experienced instructors with meticulously produced, high-quality content inspired by our community and network of members. Over 5 million people around the world come to Code School to get started with a new technology and learn by doin...

How to put tar.gz artifact to the Consul KV store

Yes, you can to upload not only text to the Consul KV store! The first step is encoding your artifact to the base64, and second - upload it. But as you probably know - you can put up to 512kb to the Consul KV store, and encoding artifacts to the base64 growing up the size of artifacts something about 30%. And you know, of course,  - Consul store all data in the KV in the memory , so do not neglect this feature. You can encode and put artifact using command something like this: base64 terraform.tgz | consul kv put -token=$CONSUL_HTTP_TOKEN terraform/us-central1/tool/config -