yum install을 통한 MySQL 설치 간단 정리


1. 의존성 있는 것과 함께 몽땅 설치

yum install mysql mysql-server mysql-connector-odbc mysql-devel


2. 서버 용량에 따라 다양한 conf 파일을 제공해 준다. (/usr/share/mysql/)

/etc/my.cnf 로 copy 하면 OK


3. 기본 mysql DB 설치 및 권한 변경

mysql_install_db && chown -R mysql:mysql /var/lib/mysql/


4. root 권한으로 접속

mysql mysql


5. user 추가

grant all privileges on *.* to 'testuser'@'localhost' identified by '{password}' with grant option;
grant all privileges on *.* to 'testuser'@'%' identified by '{password}' with grant option;


신고
Posted by Stewie

mod_proxy vs. mod_jk


So what to use when? It depends on your topology. In case you already have or need Apache 2.2 functionality you have the choice to choose between mod_proxy and mod_jk. Mod_jk works very well on Apache 2.2, so it all depends on the functionality needed: 


mod_proxy
  • Pros:
    • No need for a separate module compilation and maintenance. mod_proxy, mod_proxy_http, mod_proxy_ajp and mod_proxy_balancer comes as part of standard Apache 2.2+ distribution
    • Ability to use http https or AJP protocols, even within the same balancer.
  • Cons:
    • mod_proxy_ajp does not support large 8K+ packet sizes.
    • Basic load balancer
    • Does not support Domain model clustering

mod_jk
  • Pros:
    • Advanced load balancer
    • Advanced node failure detection
    • Support for large AJP packet sizes
  • Cons:
    • Need to build and maintain a separate module


출처 : https://community.jboss.org/people/mladen.turk/blog/2007/07/16/comparing-modproxy-and-modjk

신고
Posted by Stewie


maven으로 의존 lib들과 함께 java application package 방법


java application package 방법


1. executable jar with dependencies

=> 의존 lib들을 .class 파일로 하나의 jar 파일 안에 package 


# maven-assembly-plugin

- 의존 lib들중 menifest (namespace) 파일이 겹치는 경우 가장 마지막 것만 남음


			<plugin>

				<groupId>org.apache.maven.plugins</groupId>

				<artifactId>maven-assembly-plugin</artifactId>

				<version>2.2.1</version>

				<configuration>

					<descriptorRefs>

						<descriptorRef>jar-with-dependencies</descriptorRef>

					</descriptorRefs>

					<archive>

						<manifest>

							<mainClass>com.stewie.test.Main</mainClass>

						</manifest>

					</archive>

				</configuration>

				<executions>

					<execution>

						<phase>package</phase>

						<goals>

							<goal>assembly</goal>

						</goals>

					</execution>

				</executions>

			</plugin>


# maven-shade-plugin

- 설정으로 manifest 파일을 append하여 namespace 문제 해결 가능


<예제>

			<plugin>

				<groupId>org.apache.maven.plugins</groupId>

				<artifactId>maven-shade-plugin</artifactId>

				<version>1.7.1</version>

				<executions>

					<execution>

						<phase>package</phase>

						<goals>

							<goal>shade</goal>

						</goals>

						<configuration>

							<transformers>

								<transformer

									implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">

									<mainClass>com.stewie.test.Main</mainClass>

								</transformer>

								<transformer

									implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">

									<resource>properties.properties</resource>

								</transformer>

								<transformer

									implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">

									<resource>applicationContext.xml</resource>

								</transformer>

							</transformers>

						</configuration>

					</execution>

				</executions>

			</plugin>



2. /${dist}.jar , /lib, /bin 형태의 tar로 package 방법


# maven-assembly-plugin 사용


		<plugins>

			<plugin>

				<artifactId>maven-assembly-plugin</artifactId>

				<executions>

					<execution>

						<id>distribution-assembly</id>

						<phase>package</phase>

						<goals>

							<goal>single</goal>

						</goals>

						<configuration>

							<descriptors>

								<descriptor>assembly/assembly.xml</descriptor>

							</descriptors>

							<finalName>${filename}</finalName>

							<appendAssemblyId>false</appendAssemblyId>

						</configuration>

					</execution>

				</executions>

			</plugin>

		</plugins>

- 필요한 descriptor 예시 (참조 : http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html)


<?xml version="1.0" encoding="UTF-8"?>

<assembly

	xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"

	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

	xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">

	<id>zip</id>

	<formats>

		<format>tar</format>

	</formats>

	<includeBaseDirectory>false</includeBaseDirectory>



	<dependencySets>

		<dependencySet>

			<includes>

				<include>.....</include>

        ..

        ..

			</includes>

			<outputDirectory>lib</outputDirectory>

			<unpack>false</unpack>

		</dependencySet>

	</dependencySets>

	<fileSets>

		<fileSet>

			<directory>${basedir}</directory>

			<outputDirectory>/</outputDirectory>

			<includes>

				<include>**/*.jar</include>

			</includes>

		</fileSet>

	</fileSets>

</assembly>


// 사족으로 moduleset은 생각보다 작동이 션찮다

신고
Posted by Stewie


티스토리 툴바