News-Feeds

Die Unruhe des Geldes

Telepolis - Mi, 2016-08-31 16:00
Dirk Baecker über die Ambivalenz der modernen Ökonomie
Kategorien: Politik + Kultur

USA: Widerstand gegen Fracking-Pipeline

Telepolis - Mi, 2016-08-31 15:14
Historisches Bündnis von Indianerstämmen (First Nations) wehrt sich gegen den Bau einer Pipeline unter dem Missouri
Kategorien: Politik + Kultur

FBI stellt 30 Clinton-E-Mails zur Libyen-Affäre wieder her

Telepolis - Mi, 2016-08-31 14:00
Huma Abedin trennt sich nach weiterer Sexting-Affäre von Anthony Weiner
Kategorien: Politik + Kultur

Viele Flüchtlinge in der Schattenwirtschaft tätig

Telepolis - Mi, 2016-08-31 12:00
Nach Recherchen von NDR Info arbeiten Flüchtlinge unter ausbeuterischen Verhältnissen teils unter einem Euro Stundenlohn
Kategorien: Politik + Kultur

"Wir schaffen das"? Leichtes Spiel für Merkel

Telepolis - Mi, 2016-08-31 11:00
Die Bundeskanzlerin ficht keine Kritik an. Es wird ihr auch nicht schwergemacht
Kategorien: Politik + Kultur

Ein Lobbyist der Industrie: Ludwig Erhard

Telepolis - Mi, 2016-08-31 10:00
Die Krise der heutigen Ökonomie - Teil 2
Kategorien: Politik + Kultur

Noch sind die Meere zu retten: Das blaue Wunder

Telepolis - Mi, 2016-08-31 09:00
US-Präsident Barack Obama hat die größte Meeresschutzzone geschaffen
Kategorien: Politik + Kultur

In den USA wird die Angst vor russischen Hackern geschürt

Telepolis - Mi, 2016-08-31 08:00
Nach dem Einbruch in Computer der Demokratischen Partei sollen mit den Geheimdiensten verbundene russische Hacker amerikanische Think-Tanks angegriffen haben
Kategorien: Politik + Kultur

Saudis schließen Bonner Wahabitenschule

Telepolis - Mi, 2016-08-31 06:00
Auch am geplanten neuen Standort Berlin soll angeblich nicht weitergebaut werden - CDU bedauert, FDP freut sich
Kategorien: Politik + Kultur

Russland-Sanktionen rücken auf den Prüfstand

Telepolis - Di, 2016-08-30 22:00
Außenminister Steinmeier will zudem von "einer Phase der Konfrontation" zu einem "belastbaren Verständnis gemeinsamer Sicherheit" kommen
Kategorien: Politik + Kultur

Flüchtlinge und Immigranten - Beginnt das Drama erneut?

Telepolis - Di, 2016-08-30 22:00
Die Flüchtlingszahlen steigen erneut an, die Unterbringungskapazitäten sind bald erschöpft, kritisiert werden teils unhygienische Bedingungen
Kategorien: Politik + Kultur

Webinar Thursday, September 1 – MongoDB Security: A Practical Approach

MySQL High Performance - Di, 2016-08-30 21:23

Please join David Murphy as he presents a webinar Thursday, September 1 at 10 am PDT (UTC-7) on MongoDB Security: A Practical Approach. (Date changed*)


This webinar will discuss the many features and options available in the MongoDB community to help secure your database environment. First, we will cover how these features work and how to fill in known gaps. Next, we will look at the enterprise-type features shared by Percona Server for MongoDB and MongoDB Enterprise. Finally, we will examine some disk and network designs that can ensure your security out of the gate – you don’t want to read about how your MongoDB database leaked hundreds of gigs of data on someone’s security blog!

We will cover the following topics:

  • Using SSL for all things
  • Limiting network access
  • Custom roles
  • The missing true SUPER user
  • Wildcarding databases and collections
  • Adding specific actions to a normal role
  • LDAP
  • Auditing
  • Disk encryption
  • Network designs

Register for the webinar here.

David Murphy, MongoDB Practice Manager David joined Percona in October 2015 as Practice Manager for MongoDB. Prior to that, David was on the ObjectRocket by Rackspace team as the Lead DBA. With the growth involved with any recently acquired startup, David’s role covered a wide range from evangelism, research, run book development, knowledgebase design, consulting, technical account management, mentoring and much more. Prior to the world of MongoDB had been a MySQL and NoSQL architect at Electronic Arts working with some of the largest titles in the world like FIFA, SimCity, and Battle Field providing tuning, design, and technology choice responsibilities. David maintains an active interest in database speaking and exploring new technologies.

MySQL Sharding with ProxySQL

MySQL High Performance - Di, 2016-08-30 19:25

This article demonstrates how MySQL sharding with ProxySQL works.

Recently a colleague of mine asked me to provide a simple example on how ProxySQL performs sharding.

In response, I’m writing this short tutorial in the hope it will illustrate ProxySQL’s sharding functionalities, and help people out there better understand how to use it.

ProxySQL is a very powerful platform that allows us to manipulate and manage our connections and queries in a simple but effective way. This article shows you how.

Before starting let’s clarify some basic concepts.

  • ProxySQL organizes its internal set of servers in Host Groups (HG), and each HG can be associated with users and Query Rules (QR)
  • Each QR can be final (apply = 1) or = let ProxySQL continue to parse other QRs
  • A QR can be a rewrite action, be a simple match, have a specific target HG, or be generic
  • QRs are defined using regex

You can see QRs as a sequence of filters and transformations that you can arrange as you like.

These simple basic rules give us enormous flexibility. They allow us to create very simple actions like a simple query re-write, or very complex chains that could see dozens of QR concatenated. Documentation can be found here.

The information related to HGs or QRs is easily accessible using the ProxySQL administrator interface, in the tables mysql_servers, mysql_query_rules and stats.stats_mysql_query_rules. The last one allows us to evaluate if and how the rule(s) is used.

With regards to sharding, what can ProxySQL do to help us achieve what we need (in a relatively easy way)? Some people/companies include sharding logic in the application, use multiple connections to reach the different targets, or have some logic to split the load across several schemas/tables. ProxySQL allows us to simplify the way connectivity and query distribution is supposed to work reading data in the query or accepting HINTS.

No matter what the requirements, the sharding exercise can be summarized in a few different categories.

  • By splitting the data inside the same container (like having a shard by State where each State is a schema)
  • By physical data location (this can have multiple MySQL servers in the same room, as well as having them geographically distributed)
  • A combination of the two, where I do split by State using a dedicated server, and again split by schema/table by whatever (say by gender)

In the following examples, I show how to use ProxySQL to cover the three different scenarios defined above (and a bit more).

The example below will report text from the Admin ProxySQL interface and the MySQL console. I will mark each one as follows:

  • Mc for MySQL console
  • Pa for ProxySQL Admin

Please note that the MySQL console MUST use the -c flag to pass the comments in the query. This is because the default behavior in the MySQL console is to remove the comments.

I am going to illustrate procedures that you can replicate on your laptop, and when possible I will mention a real implementation. This because I want you to directly test the ProxySQL functionalities.

For the example described below I have a PrxySQL v1.2.2 that is going to become the master in few days. You can download it from:

git clone https://github.com/sysown/proxysql.git git checkout v1.2.2

Then to compile:

cd <path to proxy source code> make make install

If you need full instructions on how to install and configure ProxySQL, read here and here.

Finally, you need to have the WORLD test DB loaded. WORLD test DB can be found here.

Shard inside the same MySQL Server using three different schemas split by continent

Obviously, you can have any number of shards and relative schemas. What is relevant here is demonstrating how traffic gets redirected to different targets (schemas), maintaining the same structure (tables), by discriminating the target based on some relevant information in the data or pass by the application.

OK, let us roll the ball.

[Mc] +---------------+-------------+ | Continent | count(Code) | +---------------+-------------+ | Asia | 51 | <-- | Europe | 46 | <-- | North America | 37 | | Africa | 58 | <-- | Oceania | 28 | | Antarctica | 5 | | South America | 14 | +---------------+-------------+

For this exercise, I will use three hosts in replica.

To summarize, I will need:

  • Three hosts: 192.168.1.[5-6-7]
  • Three schemas: Continent X + world schema
  • One user : user_shardRW
  • Three hostgroups: 10, 20, 30 (for future use)

First, we will create the schemas Asia, Africa, Europe:

[Mc] Create schema [Asia|Europe|North_America|Africa]; create table Asia.City as select a.* from world.City a join Country on a.CountryCode = Country.code where Continent='Asia' ; create table Europe.City as select a.* from world.City a join Country on a.CountryCode = Country.code where Continent='Europe' ; create table Africa.City as select a.* from world.City a join Country on a.CountryCode = Country.code where Continent='Africa' ; create table North_America.City as select a.* from world.City a join Country on a.CountryCode = Country.code where Continent='North America' ; create table Asia.Country as select * from world.Country where Continent='Asia' ; create table Europe.Country as select * from world.Country where Continent='Europe' ; create table Africa.Country as select * from world.Country where Continent='Africa' ; create table North_America.Country as select * from world.Country where Continent='North America' ;

Now, create the user

grant all on *.* to user_shardRW@'%' identified by 'test';

Now let us start to configure the ProxySQL:

[Pa] insert into mysql_users (username,password,active,default_hostgroup,default_schema) values ('user_shardRW','test',1,10,'test_shard1'); LOAD MYSQL USERS TO RUNTIME;SAVE MYSQL USERS TO DISK; INSERT INTO mysql_servers (hostname,hostgroup_id,port,weight) VALUES ('192.168.1.5',10,3306,100); INSERT INTO mysql_servers (hostname,hostgroup_id,port,weight) VALUES ('192.168.1.6',20,3306,100); INSERT INTO mysql_servers (hostname,hostgroup_id,port,weight) VALUES ('192.168.1.7',30,3306,100); LOAD MYSQL SERVERS TO RUNTIME; SAVE MYSQL SERVERS TO DISK;

With this we have defined the user, the servers and the host groups.

Let us start to define the logic with the query rules:

[Pa] delete from mysql_query_rules where rule_id > 30; INSERT INTO mysql_query_rules (rule_id,active,username,match_pattern,replace_pattern,apply) VALUES (31,1,'user_shardRW',"^SELECT\s*(.*)\s*from\s*world.(\S*)\s(.*).*Continent='(\S*)'\s*(\s*.*)$","SELECT \1 from \4.\2 WHERE 1=1 \5",1); LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;

I am now going to query the master (or a single node), but I am expecting ProxySQL to redirect the query to the right shard, catching the value of the continent:

[Mc] SELECT name,population from world.City WHERE Continent='Europe' and CountryCode='ITA' order by population desc limit 1; +------+------------+ | name | population | +------+------------+ | Roma | 2643581 | +------+------------+

You can say: “Hey! You are querying the schema World, of course you get back the correct data.”

This is not what really happened. ProxySQL did not query the schema World, but the schema Europe.

Let’s look at the details:

[Pa] select * from stats_mysql_query_digest; Original :SELECT name,population from world.City WHERE Continent='Europe' and CountryCode='ITA' order by population desc limit 1; Transformed :SELECT name,population from Europe.City WHERE ?=? and CountryCode=? order by population desc limit ?

Let me explain what happened.

Rule 31 in ProxySQL will take all the FIELDS we will pass in the query. It will catch the CONTINENT in the WHERE clause, it will take any condition after WHERE and it will reorganize the queries all using the RegEx.

Does this work for any table in the sharded schemas? Of course it does.

A query like: SELECT name,population from world.Country WHERE Continent='Asia' ;
Will be transformed into: SELECT name,population from Asia.Country WHERE ?=?

[Mc] +----------------------+------------+ | name | population | +----------------------+------------+ | Afghanistan | 22720000 | | United Arab Emirates | 2441000 | | Armenia | 3520000 | <snip ...> | Vietnam | 79832000 | | Yemen | 18112000 | +----------------------+------------+

Another possible approach is to instruct ProxySQL to shard is to pass a hint inside a comment. Let see how.

First let me disable the rule I just inserted. This is not really needed, but we’ll do it so you can see how.

Percona Live Europe Discounted Pricing and Community Dinner!

MySQL High Performance - Di, 2016-08-30 17:47

Get your Percona Live Europe discounted tickets now, and sign up for the community dinner.

The countdown is on for the annual Percona Live Europe Open Source Database Conference! This year the conference will be taking place in the great city of Amsterdam October 3-5. This three-day conference will focus on the latest trends, news and best practices in the MySQL, MongoDB, PostgreSQL and other open source databases, while tackling subjects such as analytics, architecture and design, security, operations, scalability and performance. Percona Live provides in-depth discussions for your high-availability, IoT, cloud, big data and other changing business needs.

With breakout sessions, tutorial sessions and keynote speakers, there will certainly be no lack of content.
Advanced Rate Registration ENDS September 5, so make sure to register now to secure the best price possible.

As it is a Percona Live Europe conference, there will certainly be no lack of FUN either!!!!

As tradition holds, there will be a Community Dinner. Tuesday night, October 4, Percona Live Diamond Sponsor Booking.com hosts the Community Dinner at their very own headquarters located in historic Rembrandt Square in the heart of the city. After breakout sessions conclude, attendees are picked up right outside of the venue and taken to booking.com’s headquarters by canal boats! This gives all attendees the opportunity to play “tourist” while viewing the beauty of Amsterdam from the water. Attendees are dropped off right next to Booking.com’s office (return trip isn’t included)! The Lightning Talks for this year’s conference will be featured at the dinner.

Come and show your support for the community while enjoying dinner and drinks! The first 50 people registered for the dinner get in the doors for €10 (after that the price goes to €15 euro). Space is limited so make sure to sign up ASAP!

So don’t forget, register for the conference and sign up for the community dinner before space is gone! See you in Amsterdam!

Eine Million Rentner gehen einem Minijob nach

Telepolis - Di, 2016-08-30 16:00
Das sind 35 Prozent mehr als 2005, die den "wohlverdienten Ruhestand" nicht ohne Erwerbsarbeit genießen können
Kategorien: Politik + Kultur

UN-Milliarden-Hilfe für Syrien unter Anklage

Telepolis - Di, 2016-08-30 15:00
UN-Organisationen wird vorgeworfen, dass sie der syrischen Regierung und Personen aus dem inneren Machtzirkel eine "Rettungsleine zuwerfen"
Kategorien: Politik + Kultur

Aufstandsbekämpfung im urbanen Raum teurer als geplant

Telepolis - Di, 2016-08-30 14:00
Kosten für Übungsstadt der Bundeswehr steigen um mindestens 20 Prozent - Linkspartei befürchtet, dass auch ausländische Söldner in Schnöggersburg trainieren dürfen
Kategorien: Politik + Kultur

ALG II-Erhöhungen erneut nur in geringer Höhe zu erwarten

Telepolis - Di, 2016-08-30 13:49
Wenn ALG II-Erhöhungen angekündigt werden, ist dies ein Grund zur Hoffnung - doch lediglich in einer Altersgruppe ist die zu erwartende Erhöhung etwas mehr als nur Augenwischerei
Kategorien: Politik + Kultur

Für das Klimaabkommen fehlen 22 Staaten und 54 Prozent der Emissionen

Telepolis - Di, 2016-08-30 13:00
Die Energie- und Klimawochenschau: Vom Dialog zwischen Kohlegegnern und -befürwortern, den Chancen auf ein Inkrafttreten des Klimaabkommens noch 2016 und Unwägbarkeiten im Klimasystem
Kategorien: Politik + Kultur

Trump startet Werbekampagne in Schlachtfeldstaaten

Telepolis - Di, 2016-08-30 12:00
Republikanische Establishment-Videos sollen den Quereinsteiger zum Verzicht zugunsten eines anderen Kandidaten drängen
Kategorien: Politik + Kultur