$ wget http://download.redis.io/releases/redis-2.8.15.tar.gz $ tar xvfz redis-2.8.15.tar.gz $ cd redis-2.8.15 $ make -j4 $ make install -j4 ###### /etc/init.d/ 추가되도록 install############################# ###### vi /etc/init.d/redis_6379 열어보면 실행방식 자세히 알 수 있음 $ cd utils/ $ ./install_server.sh Welcome to the redis service installer This script will help you easily set up a running redis server Please select the redis port for this instance: [6379] ###포트지정하면됨 Selecting default: 6379 Please select the redis config file name [/etc/redis/6379.conf] Selected default - /etc/redis/6379.conf Please select the redis log file name [/var/log/redis_6379.log] Selected default - /var/log/redis_6379.log Please select the data directory for this instance [/var/lib/redis/6379] Selected default - /var/lib/redis/6379 Please select the redis executable path [/usr/local/bin/redis-server] Selected config: Port : 6379 Config file : /etc/redis/6379.conf ##설정파일 Log file : /var/log/redis_6379.log ##로그파일 Data dir : /var/lib/redis/6379 Executable : /usr/local/bin/redis-server Cli Executable : /usr/local/bin/redis-cli Is this ok? Then press ENTER to go on or Ctrl-C to abort. Copied /tmp/6379.conf => /etc/init.d/redis_6379 Installing service... Successfully added to chkconfig! Successfully added to runlevels 345! Starting Redis server... Installation successful! ###################################################### ### redis 실행######################################## $ /etc/init.d/redis_6379 start Starting Redis server... ### redis 중지######################################## $ /etc/init.d/redis_6379 stop Stopping ... Redis stopped ### 커맨드라인 콘솔모드 접속 ######################### $ redis-cli 127.0.0.1:6379>
'DB/NoSQL'에 해당되는 글 7건
- 2014.09.15 [redis] 리눅스 centos 소스설치
- 2014.09.04 [MYSQL] order by null 이용한 GROUP BY의 Filesort 작업 제거
- 2014.05.22 리눅스 unixODBC FreeTDS 설치 (MSSQL)
- 2014.05.21 unixODBC SQL Server Native Client 11.0 설치 (MSSQL)
- 2014.04.18 MySQL을 NoSQL 같이 handlersocket 설명 잘되어있는 곳
- 2014.04.11 WebScaleSQL - Facebook, Google, LinkedIn, Twitter
- 2013.02.22 [MYSQL] 5.6 Release
※ DISTINCT 와 GROUP BY 의 경우 처리방식은 비슷하지만 사용하는 성향에 따라서 조금씩 이용하는 곳이 다르다.
그리고 가장 큰 차이는 GROUP BY 의 경우 정렬이 일어나는 것이다.
아래의 예시를 보면 file sort가 일어나는 것을 볼 수 있다.
CREATE TABLE `asd` ( `idx` int(11) NOT NULL AUTO_INCREMENT, `id` varchar(20) NOT NULL DEFAULT '', `data` varchar(20) NOT NULL DEFAULT '', PRIMARY KEY (`idx`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; insert into asd (id,data)values('a',100); insert into asd (id,data)values('a',100); insert into asd (id,data)values('c',100); insert into asd (id,data)values('d',100); insert into asd (id,data)values('c',100); insert into asd (id,data)values('c',100); insert into asd (id,data)values('d',100); insert into asd (id,data)values('d',100);
※ id 컬럼에 index가 걸려있다면 filesort가 나지 않지만 걸려 있지 않다면 아래와 같이 filesort가 일어난다.
해당 쿼리가 비번하게 일어난다면 filesort의 경우 성능에 큰 차이를 보일 수 있다.
그래서 정렬이 필요하지 않을 경우에는 order by null를 입력해서 filesort를 막을 수있다.
mysql> explain select * from asd group by id; +----+-------------+-------+------+---------------+------+---------+------+------+---------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+---------------+------+---------+------+------+---------------------------------+ | 1 | SIMPLE | asd | ALL | NULL | NULL | NULL | NULL | 8 | Using temporary; Using filesort | +----+-------------+-------+------+---------------+------+---------+------+------+---------------------------------+ 1 row in set (0.00 sec) mysql> explain select * from asd group by id order by null; +----+-------------+-------+------+---------------+------+---------+------+------+-----------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+---------------+------+---------+------+------+-----------------+ | 1 | SIMPLE | asd | ALL | NULL | NULL | NULL | NULL | 8 | Using temporary | +----+-------------+-------+------+---------------+------+---------+------+------+-----------------+ 1 row in set (0.00 sec)
※ 해당 내용은 아래 블로그를 참조 하였으며 자세한 내용은 아래 블로그에서 설명을 볼 수 있습니다.
DISTINCT 와 GROUP BY의 차이 - http://intomysql.blogspot.kr/2011/01/distinct-group-by.html
GROUP BY의 Filesort 작업 제거 - http://intomysql.blogspot.kr/2010/12/group-by-filesort.html
리눅스에서 MSSQL 서버 접근할려고 MS에서 제공해주는 라이브러리 설치했지만 이래저래
문제가 많아서 FreeTDS를 사용하기로 결정했다.
리눅스 SQL Server(MSSQL) ODBC 설치 - http://www.opens.kr/34
Linux uninxODBC SQL Server Native Client 11.0 한글문제 - http://www.opens.kr/35
FreeTDS Yum 간단 설치 방법
1) 저장소 등록 ( 다른곳을 이용해도 무관함 )
$ rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
2) Yum 설치
$ yum install freetds unixODBC
=================================================================================================================
Package Arch Version Repository Size
=================================================================================================================
Installing:
freetds x86_64 0.91-2.el6 webtatic 567 k
unixODBC x86_64 2.2.14-12.el6_3 base 378 k
Installing for dependencies:
libtool-ltdl x86_64 2.2.6-15.5.el6 base 44 k
Transaction Summary
=================================================================================================================
Install 3 Package(s)
3) tsql을 이용한 접속테스트
$ tsql -H 192.168.0.0 -p 1433 -U username -P userpassword
참조 가이드 : http://www.freetds.org/userguide/confirminstall.htm
4) ODBC에 FreeTDS등록
vi /etc/odbcinst.ini
----------------------------------
[FreeTDS]
Description = FreeTDS Driver
Driver = /usr/lib64/libtdsodbc.so.0
Setup = /usr/lib64/libtdsS.so.2
FileUsage = 1
CPTimeout = 5
CRReuse = 5
----------------------------------
5) isql을 이용한 접속 테스트
vi /etc/odbc.ini
----------------------------------
[MSSQLTEST]
driver=FreeTDS
server=192.168.0.0
port=1433
database=DBNAME
client_charset = UTF-8
tds_version = 8.0
----------------------------------
$ isql -v MSSQLTEST username userpassword
+---------------------------------------+
| Connected!
|
| sql-statement
| help [tablename]
| quit
|
+---------------------------------------+
※ ODBC 정보확인은 아래와 같이
$ odbcinst -j
unixODBC 2.2.14
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /root/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
※ PHP PDO나 타 개발언어에서 사용시
$ vi /etc/freetds.conf의 [global]에 기본 tds_version 버젼과 client_charset 지정해주는 게 좋을 듯하다.
-------------------------------
[global]
tds version = 8.0
client charset = UTF-8
text size = 64512
-------------------------------
※ 리눅스 PHP PDO dblib FreeTDS 사용 (MSSQL) - http://www.opens.kr/37
MS사이트 : http://www.microsoft.com/en-us/download/details.aspx?id=28160
1) 파일다운로드 ( centos6 64bit의 경우 Linux6을 선택 다운로드 안될때 MS사이트 URL확인 )
2) 압축풀고 build_dm실행
$ tar xvfz sqlncli-11.0.1790.0.tar.gz
$ cd sqlncli-11.0.1790.0
$ ./build_dm.sh //실행후 나오는 디렉토리 기준으로 make 실행
Enter 'YES' to have this script continue: YES
Verifying processor and operating system ................................... OK
Verifying wget is installed ................................................ OK
Verifying tar is installed ................................................. OK
Verifying make is installed ................................................ OK
Downloading unixODBC 2.3.0 DriverManager ................................... OK
Unpacking unixODBC 2.3.0 DriverManager ..................................... OK
Configuring unixODBC 2.3.0 DriverManager ................................... OK
Building unixODBC 2.3.0 DriverManager
...................................... OK
Build of the unixODBC 2.3.0 DriverManager complete.
Run the command 'cd /tmp/unixODBC.32631.28583.22057/unixODBC-2.3.0; make install' to install the driver manager.
PLEASE NOTE THAT THIS WILL POTENTIALLY INSTALL THE NEW DRIVER MANAGER OVER ANY
EXISTING UNIXODBC DRIVER MANAGER. IF YOU HAVE ANOTHER COPY OF UNIXODBC INSTALLED,
THIS MAY POTENTIALLY OVERWRITE THAT COPY.
3) 위에 tmp 경로에서 make install 실행
$ cd /tmp/unixODBC.32631.28583.22057/unixODBC-2.3.0
$ make install
touch /etc/odbcinst.ini
touch /etc/odbc.ini
mkdir -p /etc/ODBCDataSources
/usr/bin/odbc_config --header > /usr/include/unixodbc_conf.h
make[2]: Leaving directory `/tmp/unixODBC.32631.28583.22057/unixODBC-2.3.0'
make[1]: Leaving directory `/tmp/unixODBC.32631.28583.22057/unixODBC-2.3.0'
4) install 실행
$ cd /root/sqlncli-11.0.1790.0
$ ./install.sh verify
Microsoft SQL Server ODBC Driver V1.0 for Linux Installation Script
Copyright Microsoft Corp.
Starting install for Microsoft SQL Server ODBC Driver V1.0 for Linux
Checking for 64 bit Linux compatible OS ..................................... OK
Checking required libs are installed ........................................ OK
unixODBC utilities (odbc_config and odbcinst) installed ..................... OK
unixODBC Driver Manager version 2.3.0 installed ............................. OK
unixODBC Driver Manager configuration correct .............................. OK*
Microsoft SQL Server ODBC Driver V1.0 for Linux already installed .... NOT FOUND
Install log created at /tmp/sqlncli.18759.30552.14202/install.log.
One or more steps may have an *. See README for more information regarding
these steps.
$ ./install.sh install
Enter YES to accept the license or anything else to terminate the installation: YES
Checking for 64 bit Linux compatible OS ..................................... OK
Checking required libs are installed ........................................ OK
unixODBC utilities (odbc_config and odbcinst) installed ..................... OK
unixODBC Driver Manager version 2.3.0 installed ............................. OK
unixODBC Driver Manager configuration correct .............................. OK*
Microsoft SQL Server ODBC Driver V1.0 for Linux already installed .... NOT FOUND
Microsoft SQL Server ODBC Driver V1.0 for Linux files copied ................ OK
Symbolic links for bcp and sqlcmd created ................................... OK
Microsoft SQL Server ODBC Driver V1.0 for Linux registered ........... INSTALLED
Install log created at /tmp/sqlncli.27629.13209.11572/install.log.
One or more steps may have an *. See README for more information regarding
these steps.
$ vi /etc/odbcinst.ini //odbc추가확인
[SQL Server Native Client 11.0]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux
Driver=/opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0
Threading=1
UsageCount=1
5) 최종 설치 결과확인
$ ./install.sh verify
Microsoft SQL Server ODBC Driver V1.0 for Linux Installation Script
Copyright Microsoft Corp.
Starting install for Microsoft SQL Server ODBC Driver V1.0 for Linux
Checking for 64 bit Linux compatible OS ..................................... OK
Checking required libs are installed ........................................ OK
unixODBC utilities (odbc_config and odbcinst) installed ..................... OK
unixODBC Driver Manager version 2.3.0 installed ............................. OK
unixODBC Driver Manager configuration correct .............................. OK*
Microsoft SQL Server ODBC Driver V1.0 for Linux already installed .... INSTALLED
6) isql 이용한 접속테스트
$ vi /etc/odbc.ini
-------------------------
[MSSQLTEST]
driver=SQL Server Native Client 11.0
server=192.168.0.0
port=1433
database=DBNAME
-------------------------
$ isql -v MSSQLTEST userid userpassword
+---------------------------------------+
| Connected!
|
| sql-statement
| help [tablename]
| quit
|
+---------------------------------------+
※ PHP에는 PDO ODBC에는 odbcinst.ini에 등록된 이름으로 odbc.ini처럼 지정해주면됨
=> odbc:DRIVER=SQL Server Native Client 11.0;Server=192.168.0.0;port=1433;database=dbname;
※ C컴파일에러시 gcc설치할것!!
view /tmp/unixODBC.19411.11370.8462/build_dm.log
yum install gcc
※ ODBC 정보확인은 아래와 같이
$ odbcinst -j
unixODBC 2.2.14
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /root/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
1. MySQL Handlersocket 관련 한글번역 잘해놓은 사이트
http://advent.perl.kr/2012/2012-12-12.html
※ What is Hanldersocket?
※ Common architecture pattern for MySQL + memcached
2. 개발자 원문 사이트
http://yoshinorimatsunobu.blogspot.kr/search/label/handlersocket
3. 참고사이트 성능비교
http://philipzhong.blogspot.kr/2011/06/performance-test-for-mysql-sql-and.html
공식 홈페이지 : http://webscalesql.org/
GithubUrl : https://github.com/webscalesql/webscalesql-5.6
뉴스기사 : 페이스북·구글·트위터·링크드인, 오픈소스 MySQL 프로젝트 참여
LinkUrl : http://www.ciokorea.com/news/20410
그린은 웹스케일SQL에 기여하는 사람들이 이미 다음과 같은 몇 가지 결과를 만들어 냈다고 밝혔다.
•각각 제안된 변경을 위해 MySQL에 장착된 테스트 시스템(mtr)을 배포하고 실행할 자동화 프레임워크
•스트레스 테스트와 성능 테스트 시스템을 자동화한 프로토타입의 새로운 전체 제품군
•불필요한 충돌이나 테스트 실패를 야기하는 문제를 방지하기 위한 기존 테스트와 일부 기존 코드 구조 변경 또는 안전한 코드 변경
•버퍼 풀 넘침 현상 개선, 특정 유형의 쿼리에 대한 최적화, NUMA 인터리브 정책에 대한 지원 등을 포함한 성능 향상
=> 버퍼 풀 넘침 현상개선이라 흠흠....
=> mysql VS mariaDB VS webscalesql 되는 구조가 될지...아니면 webscalesql은 그냥 mysql에 종속되는 구조인지....... 음흠.......
MySQL 5.6.10 (2013-02-05)
http://dev.mysql.com/doc/relnotes/mysql/5.6/en/
http://dev.mysql.com/tech-resources/articles/mysql-5.6.html
DBA and Developer Guide to MySQL 5.6
Building the Next Generation of Web Applications and Services
At a glance, MySQL 5.6 is simply a better MySQL with improvements that enhance every functional area of the database kernel, including:
- Better Performance and Scalability
- Improved InnoDB storage engine for better transactional throughput
- Improved Optimizer for better query execution times and diagnostics
- Better Application Availability with Online DDL/Schema changes
- Better Developer Agility with NoSQL Access with Memcached API to InnoDB
- Improved Replication for high performance, self-healing distributed deployments
- Improved Performance Schema for better instrumentation
- Improved Security for worry-free application deployments
- And other Important Enhancements
This article serves as a DBA and Developer guide to MySQL 5.6 as it highlights the key new features in each of these areas, many with practical use case examples.
Mysql들어갔더니 5.6으로 릴리즈되어있네요;;
Mysql5.6.7 (2012-09-29, Release Candidate)
작년 9월에 RC버전까지 확인 하고 언제 되는가 기다리고 있었는데... ㅡㅡㅋ
2월 5일에 되었군요 흠흠........
요즘에 SphinxQL이랑 SphinxSE 테스트도 해봐야되는데....
이것도 체크해야겠군요 흠흠
암튼 자세한 내용은 다음에~~