study 1 day
scale bc 사용법
간단한 정수 연산은 아래와 같이 할 수 있다.
이렇게 하면 85가 출력될 것이다. 수와 연산기호 사이에는 반드시 띄어쓰기를 해 주자. 더하기(+), 빼기(-), 곱하기(\*), 나누기(/), 모듈로(modulo, %) 등을 할 수 있다. 곱하기의 경우 연산기호에 유의하자. 반드시 \* 이렇게 써야 한다.
34*51의 결과를 result 변수에 저장하려면 아래와 같이 하면 되겠다.
result=`expr 34 \* 51`
echo "$result"
정수가 아니라 실수를 사용하고 싶다거나, 연산기호가 여러개 들어가는 복잡한 계산을 하려면 expr로는 안되고 bc를 이용해야 한다.
bc를 사용할 때는 곱하기 연산기호를 평소처럼 그냥 쓰면 된다. 예를 들어 24*3은 아래와 같이 하면 된다.
echo "24*3" | bc
echo 명령으로 출력하는 수식은 반드시 따옴표로 묶어 주자.
-- 2013.7.24 추가 --
실수 나눗셈에 대한 부분을 추가로 적어 두기로 했다.
echo "1/2" | bc
0
1을 2로 나누는 예시인데, 결과가 0.5가 아니라 0이라고 나온다. 기본 설정이 정수 연산으로 되어 있어서 그러니, 제대로 된 결과를 얻으려면 scale 변수에 소수점 이하 몇자리를 출력할 것인지 지정해 주어야겠다. 소수점 이하 세자리를 출력하고 싶으면 아래와 같이 해 보자.
echo "scale=3; 1/2" | bc
0.500
이제 결과가 제대로 나왔다.
'shell' 카테고리의 다른 글
time -o (--output=) 사용법 in Ubuntu 12.04 (0) | 2016.03.19 |
---|---|
[shell] find 사용법 (0) | 2015.11.03 |
while read a를 이용한 화면출력 및 저장 및 파일 만들기 (0) | 2015.10.14 |
dram 엑세스 방법
http://egloos.zum.com/nooriry/v/950940
고정 크기 ramdisk 만들기 및 swap 영역 사용
1. ramdisk 크기 키우기 24GB
go /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="memmap=224G\\\$42G ramdisk_size=25165824"
2. vmalloc은 실제로 메모리를 할당 하지 않기 때문에 고정 크기를 만들기 위해선 모든 page 에 대해 page fault 를 먼저 발생 시켜야 함.
dd if=/dev/zero of=/dev/ram1 bs=4K count=6291456
3. swap 만들기
mkswap /dev/ram1
4. swap 실행
swapon /dev/ram1
'Linux Kernel' 카테고리의 다른 글
What is the return address of kmalloc() ? Physical or Virtual? (0) | 2016.07.29 |
---|---|
Memory Mapping (0) | 2016.07.28 |
sysinfo 관련 (0) | 2016.02.26 |
ubuntu 12.04 kernel compile (0) | 2016.02.25 |
강제 umount 방법 (0) | 2015.10.22 |
KVM xml 에디트
xml file 위치: /etc/libvirt/qemu
CPU 개수 바꾸기
sed -i "s/<vcpu>1/<vcpu>2/g" /etc/libvirt/qemu/vm1.xml
1. vhd 이름이 여러개 일 경우,
#!/bin/bash
for (( i=$1 ; i <= $2 ; i++ )) ;
do
echo " vm$i: <vcpu>1 --> <vcpu>2 "
sed -i "s/<vcpu>1/<vcpu>2/g" /etc/libvirt/qemu/vm$i.xml
# validation
echo " vm$i ... validation"
grep -RE "<vcpu>" /etc/libvirt/qemu/vm$i.xml
2. 여러개의 vm을 실행시킬때
#!/bin/bash
for (( i=1 ; i <= $1 ; i++ )) ;
do
echo "virsh start vm$i" ;
virsh start vm$i ;
done
3. 여러개 vm의 커넥션을 확인 할때,
#!/bin/bash
for (( i=1 ; i <=$1 ; i++ )) ;
do
echo "ssh jm@vm$i" ;
ssh jm@vm$i "echo vm$i is connected"
done
4. 여러개의 vm을 잠깐 정지
#!/bin/bash
for (( i=$1 ; i <= $2 ; i++ )) ;
do
echo "virsh suspend vm$i" ;
virsh suspend vm$i ;
done
5. 여러개의 vm을 다시 진행
#!/bin/bash
for (( i=$1 ; i <= $2 ; i++ )) ;
do
echo "virsh resume vm$i" ;
virsh resume vm$i ;
done
6. 여러개의 vm을 종료
#!/bin/bash
for (( i=1 ; i <= $1 ; i++ )) ;
do
echo "virsh shutdown vm$i" ;
virsh shutdown vm$i ;
done
7. 여러개의 vm을 강제종료
#!/bin/bash
for (( i=1 ; i <= $1 ; i++ )) ;
do
echo "virsh destroy vm$i" ;
virsh destroy vm$i ;
done
8. speccpu test (같은 환경을 vm내에 구축할 시에만 동작)
#!/bin/bash
for (( i=1 ; i <=$1 ; i++ )) ;
do
echo "ssh jm@vm$i" ;
ssh jm@vm$i "echo vm$i is connected"
# scp /work/execute.sh jm@vm$i:/work/
# ssh jm@vm$i "cd /work && time -p ./execute.sh 1 >> time.temp"
ssh jm@vm$i 'rm -rf /work/dlog$i && echo "dlog$i: data log file is deleted"'
ssh jm@vm$i 'rm -rf /work/tlog$i && echo "tlog$i: time log file is deleted"'
ssh jm@vm$i "cd /work && /usr/bin/time -p --output=/work/tlog$i ./execute.sh 1 >> dlog$i" &
done
9. 하나의 vm에서 여러개의 vm을 생성 할때 (--original 원본 vm 이름, --name 생성할 vm 이름, --file 생성할 이미지 이름)
for (( i =1 ; i< 33 ; i++ )) ; do echo "virt-clone --original u13 --name vm$i --file uvm$i" ; virt-clone --original u13 --name vm$i --file uvm$i ; done
'virtualization' 카테고리의 다른 글
SPEC virt working history (0) | 2016.02.09 |
---|---|
KVM on ubuntu (0) | 2016.02.03 |
kvm bridge on ubuntu (0) | 2016.01.28 |
ESXi remote shell 설정 (ESXi 5.5) (0) | 2015.11.12 |
ESX (0) | 2015.11.07 |
time -o (--output=) 사용법 in Ubuntu 12.04
PATH의 우선 순위 문제로 보임. 다른 time 유틸리티가 우선순위에 따라 적용되는 것으로 보임.
/usr/bin/time -o 경우, -o 인식
time -o 경우 -o 옵션을 인식할 수 없음.
'shell' 카테고리의 다른 글
scale bc 사용법 (0) | 2016.04.20 |
---|---|
[shell] find 사용법 (0) | 2015.11.03 |
while read a를 이용한 화면출력 및 저장 및 파일 만들기 (0) | 2015.10.14 |
rocksdb error
rocksdb put error: IO error: sst: Too many open files
--> /etc/security/limits.conf
root hard nofile 500000
root soft nofile 500000
* hard nofile 500000
* soft nofile 500000
'Dababase' 카테고리의 다른 글
Installation gflags on Ubuntu 14.04 (0) | 2017.05.31 |
---|---|
postgresql 9.3 on SpecVirt 작업 일지 (0) | 2016.02.05 |
port forwarding (0) | 2016.02.02 |
examplie: test application for rocksdb compile (0) | 2015.07.18 |
Rocks DB 설치 on Ubuntu 12.04 LTS (0) | 2015.07.18 |
emacs read only mode
ctrl + x q
status line 에 %% 가 나타나야 수정되지 않은 원본파일임.
*% 가 나타날 경우, undo를 통해 원본을 만든후 read only mode를 재실행 할것
'Emacs' 카테고리의 다른 글
emacs 블록지정이 안풀릴때 (0) | 2016.03.01 |
---|---|
cscope 디렉토리 셋업 (0) | 2016.02.26 |
emacs 블록지정이 안풀릴때
ctrl + space
'Emacs' 카테고리의 다른 글
emacs read only mode (0) | 2016.03.01 |
---|---|
cscope 디렉토리 셋업 (0) | 2016.02.26 |
cscope 디렉토리 셋업
M-x cscope-set-initial-directory
'Emacs' 카테고리의 다른 글
emacs read only mode (0) | 2016.03.01 |
---|---|
emacs 블록지정이 안풀릴때 (0) | 2016.03.01 |
sysinfo 관련
sysinfo의 필드 중 명시적으로 user space memory중 사용가능한 공간을 알려주는
field는 없는데 어떤 값이 0으로 출력되었는지 제가 잘 이해를 못하겠네요..-_-;;
죄송합니다.
freeram 필드는 시스템의 전체 메모리 중 buddy allocator에 들어있는, 즉
그 누구에게도(kernel에게도, User에게도) 할당되어 있지 않는 메모리의 크기입니다.
freehigh 필드는 대략적으로 HIGHMEM zone에 있는 free 페이지의 수를 의미합니다.
HIGHMEM zone은 일반적으로 user memory 할당을 위해 사용하지만 커널 또한 사용할 수
있습니다.
반대로 NORMAL zone은 일반적으로 kernel이 사용하도록 노력하지만 HIGHMEM의 fall back zone
으로 구성되어 HIGHMEM zone의 메모리가 모자라게 될 경우, 응용 프로그램에 의해서도
사용가능합니다.
'Linux Kernel' 카테고리의 다른 글
Memory Mapping (0) | 2016.07.28 |
---|---|
고정 크기 ramdisk 만들기 및 swap 영역 사용 (0) | 2016.03.22 |
ubuntu 12.04 kernel compile (0) | 2016.02.25 |
강제 umount 방법 (0) | 2015.10.22 |
[ubuntu 12.04] grub 메모리 크기 변경 (0) | 2015.10.22 |
ubuntu 12.04 kernel compile
Source: http://mitchtech.net/compile-linux-kernel-on-ubuntu-12-04-lts-detailed/
Details...
Compile Linux Kernel on Ubuntu 12.04 LTS (Detailed)
This tutorial will outline the process to compile your own kernel for Ubuntu. It will demonstrate both the traditional process using ‘make’ and ‘make install’ as well as the Debian method, using ‘make-dpkg’. This is the detailed version of this tutorial, see Compile Linux Kernel on Ubuntu 12.04 LTS for the quick overview. In any case, we begin by installing some dependencies:
sudo apt-get install git-core libncurses5 libncurses5-dev libelf-dev asciidoc binutils-dev linux-source qt3-dev-tools libqt3-mt-dev libncurses5 libncurses5-dev fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge kernel-package
Note: qt3-dev-tools and libqt3-mt-dev is necessary if you plan to use ‘make xconfig’ and libncurses5 and libncurses5-dev if you plan to use ‘make menuconfig’. Next, copy the kernel sources with wget:
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.2.17.tar.bz2
Extract the archive and change into the kernel directory:
tar -xjvf linux-3.2.17.tar.bz2 cd linux-3.2.17/
Now you are in the top directory of a kernel source tree. The kernel comes in a default configuration, determined by the people who put together the kernel source code distribution. It will include support for nearly everything, since it is intended for general use, and is huge. In this form it will take a very long time to compile and a long time to load. So, before building the kernel, you must configure it. If you wish to re-use the configuration of your currently-running kernel, start by copying the current config contained in /boot:
cp -vi /boot/config-`uname -r` .config
Parse the .config file using make with the oldconfig flag. If there are new options available in the downloaded kernel tree, you may be prompted to make a selection to include them or not. If unsure, press enter to accept the defaults.
make oldconfig
Since the 2.6.32 kernel, a new feature allows you to update the configuration to only compile modules that are actually used in your system. As above, make selections if prompted, otherwise hit enter for the defaults.
make localmodconfig
The next step is to configure the kernel to your needs. You can configure the build with ncurses using the ‘menuconfig’ flag:
make menuconfig
or, using a GUI with the ‘xconfig’ flag:
make xconfig
In either case, you will be presented with a series of menus, from which you will choose the options you want to include. For most options you have three choices: (blank) leave it out; (M) compile it as a module, which will only be loaded if the feature is needed; (*) compile it into monolithically into the kernel, so it will always be there from the time the kernel first loads.
There are several things you might want to accomplish with your reconfiguration:
- Reduce the size of the kernel, by leaving out unnecessary components. This is helpful for kernel development. A small kernel will take a lot less time to compile and less time to load. It will also leave more memory for you to use, resulting in less page swapping and faster compilations.
- Retain the modules necessary to use the hardware installed on your system. To do this without including just about everything conceivable, you need figure out what hardware is installed on your system. You can find out about that in several ways.
Before you go too far, use the “General Setup” menu and the “Local version” and “Automatically append version info” options to add a suffix to the name of your kernel, so that you can distinguish it from the “vanilla” one. You may want to vary the local version string, for different configurations that you try, to distinguish them also.
Assuming you have a running Linux system with a working kernel, there are several places you can look for information about what devices you have, and what drivers are running.
- Look at the system log file, /var/log/messages or use the command dmesg to see the messages printed out by the device drivers as they came up.
- Use the command lspci -vv to list out the hardware devices that use the PCI bus.
- Use the command lsub -vv to list out the hardware devices that use the USB.
- Use the command lsmod to see which kernel modules are in use.
- Look at /proc/modules to see another view of the modules that are in use.
- Look at /proc/devices to see devices the system has recognized.
- Look at /proc/cpuinfo to see what kind of CPU you have.
- Open up the computer’s case and read the labels on the components.
- Check the hardware documentation for your system. If you know the motherboard, you should be able to look up the manual, which will tell you about the on-board devices.
Using the available information and common sense, select a reasonable set of kernel configuration options. Along the way, read through the on-line help descriptions (for at least all the top-level menu options) so that you become familiar with the range of drivers and software components in the Linux kernel.
Before exiting the final menu level and saving the configuration, it is a good idea to save it to a named file, using the “Save Configuration to an Alternate File” option. By saving different configurations under different names you can reload a configuration without going through all the menu options again. Alternatively, you can backup the file (which is named .config manually, by making a copy with an appropriate name.
One way to reduce frustration in the kernel trimming process (which involves quite a bit of guesswork, trial, and error) is to start with a kernel that works, trim just a little at a time, and test at each stage, saving copies of the .config file along the way so that you can back up when you run into trouble. However, the first few steps of this process will take a long time since you will be compiling a kernel with huge number of modules, nearly all of which you do not need. So, you may be tempted to try eliminating a large number of options from the start
Now we are ready to start the build. You can speed up the compilation process by enabling parallel make with the -j flag. The recommended use is ‘processor cores + 1’, e.g. 5 if you have a quad core processor:
make -j5
This will compile the kernel and create a compressed binary image of the kernel. After the first step, the kernel image can be found at arch/i386/boot/bzImage (for a x86 based processor). Once the initial compilation has completed, install the dynamically loadable kernel modules:
sudo make modules_install
The modules are installed in a subdirectory of “/lib/modules”, named after the kernel version. The resulting modules have the suffix “.ko”. For example, if you chose to compile the network device driver for the Realtek 8139 card as a module, there will be a kernel module name 8139too.ko. The third command is OS specific and will copy the new kernel into the directory “/boot” and update the Grub bootstrap loader configuration file “/boot/grub/grub.cfg” to include a line for the new kernel.
Finally, install the kernel:
sudo make install
This command performs many operations behind the scenes. Examine the /etc/grub.d/ directory structure before and after you run the above commands to see the changes. Also look in the /boot/grub/grub.cfg file for your kernel entry.
The OS specific make install, Ubuntu in this case, also creates an initrd image in the /boot directory. If you compiled the needed drives into the kernel then you will not need this ramdisk file to aid in booting. For extra credit remove the created initrd from the /boot/ directory as well as the references in /etc/grub.d/*.
If there are error messages from any of the make stages, you may be able to solve them by going back and playing with the configuration options. some options require other options or cannot be used in conjunction with some other options. These dependencies and conflicts may not all be accounted-for in the configuration script. If you run into this sort of problem, you are reduced to guesswork based on the compilation or linkage error messages. For example, if the linker complains about a missing definition of some symbol in some module, you might either turn on an option that seems likely to provide a definition for the missing symbol, or turn off the option that made reference to the symbol.
Reboot the system, selecting your new kernel from the boot loader menu. Watch the messages. See if it works. If it does not, reboot with the old kernel, try to fix what went wrong, and repeat until you have a working new kernel
Debian Method:
Instead of the compilation process of above, you can alternatively compile the kernel as installable .deb packages. This improves the portability of the kernel, since installation on a different machine is as simple as installing the packages. Rather than using ‘make’ and ‘make install’, we use ‘make-kpkg’:
fakeroot make-kpkg – -initrd – -append-to-version=-some-string-here kernel-image kernel-headers
Unlike above, you cannot enable parallel compilation with make-kpkg using the -j flag. Instead, define the CONCURRENCY_LEVEL environment variable.
export CONCURRENCY_LEVEL=3
Once the compilation has completed, you can install the kernel and kernel headers using dpkg:
sudo dpkg -i linux-image-3.2.14-mm_3.2.14-mm-10.00.Custom_amd64.deb
sudo dpkg -i linux-headers-3.2.14-mm_3.2.14-mm-10.00.Custom_amd64.deb
'Linux Kernel' 카테고리의 다른 글
고정 크기 ramdisk 만들기 및 swap 영역 사용 (0) | 2016.03.22 |
---|---|
sysinfo 관련 (0) | 2016.02.26 |
강제 umount 방법 (0) | 2015.10.22 |
[ubuntu 12.04] grub 메모리 크기 변경 (0) | 2015.10.22 |
LXC 관련 자료 (0) | 2015.10.17 |
SPEC virt working history
1./opt/SPECvirt/webInit.sh
starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 20.20.20.3 for ServerNam
--> /etc/httpd/conf/httpd.conf 수정
--> www.yourwebserver.com:80 주석 풀어주기
--> check the duplication of Listen:81 on /etc/httpd/conf/httpd.conf, 여러번 실행하다 보면 중복된다. (by makeme_infraserver.sh)
update
--> infraserver에서
--> /etc/httpd/conf/httpd.conf
--> line 1018: Listen 81
--> line 1019: ServerName: *:81
일단 서프넷 모든 아이피에 존재하는 81포트는 무조건 client로 처리한다. --> 에러 발생 그냥 servername warning 을 그냥 놔둔다.
2. jAppInitRstr.sh
- ssh: Could not resolve hostname specdriver: Name or service not known
- + ssh specdelivery -n 'cd /opt/SPECjAppServer2004/bin;./appsrv-ctrl.sh stop'
CLI306: Warning - The server located at /opt/glassfish4/glassfish/domains/spec2004-1 is not running.
- Feb 08, 2016 11:09:01 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Could not contact localhost:8005. Tomcat may not be running
- SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:498)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:370)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:457)
- + ssh specdb /usr/pgsql-9.2/bin/psql -U spec specdb
bash: /usr/pgsql-9.2/bin/psql: No such file or directory
- + ssh specdriver 'echo "`date`: Ending jappInitRstr.sh"'
ssh: Could not resolve hostname specdriver: Name or service not known
--> 서버커넥션을 보통 한번에 못한다. 따라서 두번 이상 restart_service.sh 를 반복한다.
3. Client Error Message
3.1-->For txRate(100), loadFactor(5), and load_scale_factor(1.0), your DBIR must be built for 500IR
3.2-->SPECweb_Support: [ERROR] STATE 3; makeHttpRequest() failed
3.3-->[ERROR] SocketTimeoutException encountered during run
3.4-->Connection: Still expecting 8054 bytes. Expected length is 57408 bytes, but only received 49354 bytes
3.5-->SPECweb_Support: [ERROR] STATE 6; RESPONSE INVALID on GET /support/downloads/dir0000000240/download6_0 HTTP/1.1
'virtualization' 카테고리의 다른 글
KVM xml 에디트 (0) | 2016.03.22 |
---|---|
KVM on ubuntu (0) | 2016.02.03 |
kvm bridge on ubuntu (0) | 2016.01.28 |
ESXi remote shell 설정 (ESXi 5.5) (0) | 2015.11.12 |
ESX (0) | 2015.11.07 |
postgresql 9.3 on SpecVirt 작업 일지
---------------------------------------------------------------------------------------------
Error 메시지 - (Reference 1 참조)
---------------------------------------------------------------------------------------------
makeme_dbserver.sh
테이블 생성이 모두 실패.
하지만 끝까지 진행
loaddb_postgres.sh
막판에 read error 3개 발생
하지만 완료
---------------------------------------------------------------------------------------------
특이 사항
---------------------------------------------------------------------------------------------
디비를 새로 생성하고, 기존의 데이터를 반드시 없애야 함. (아니면 디비가 실행이 안됨)
디비를 생성한 계정으로 postgresql-9.3 을 실행해야만 함.
initdb: 한번 디비의 데이터가 생성된 경우(/var/lib/pgsql/9.3/data) 반드시 fail이 발생한다. 백업을 다른 곳에 해두고 initdb를 다시 할것
service postgresql-9.3 start 가 그래도 안될 경우,
/usr/pgsql-9.3/bin/postgres -D /dbstore/data 를 해보고 메시지를 살필것.
postgres cannot access the server configuration file "/dbstore/postgresql.conf": No such file or directory
---------------------------------------------------------------------------------------------
Reference 1
---------------------------------------------------------------------------------------------
[root@dbserver1 dbvm_scripts]# ./makeme_dbserver.sh
++ cat /opt/hosts.vms
++ echo JAVA_HOME=/usr/lib/jvm/jre
++ echo 'export JAVA_HOME'
++ POSTGRES_CONFDIR=/etc
++ service postgresql-9.3 initdb
Data directory is not empty!
++ service postgresql-9.3 start [FAILED]
Starting postgresql-9.3 service: [ OK ]
++ service postgresql-9.3 stop
Stopping postgresql-9.3 service: [ OK ]
++ chkconfig postgresql-9.3 on
++ mkdir -p /dbstore
++ mkdir -p /dbstore/data/spects
++ mkdir -p /dbstore/log
++ mv /var/lib/pgsql/9.3/data/pg_clog /dbstore/log
++ mv /var/lib/pgsql/9.3/data/pg_xlog /dbstore/log
++ ln -s /dbstore/log/pg_clog /var/lib/pgsql/9.3/data/pg_clog
++ ln -s /dbstore/log/pg_xlog /var/lib/pgsql/9.3/data/pg_xlog
++ chown -R postgres:postgres /dbstore
++ cp /var/lib/pgsql/9.3/data/pg_hba.conf /var/lib/pgsql/9.3/data/pg_hba.conf.orig
++ cp /var/lib/pgsql/9.3/data/postgresql.conf /var/lib/pgsql/9.3/data/postgresql.conf.orig
++ sed -i s/ident/trust/g /var/lib/pgsql/9.3/data/pg_hba.conf
++ sed -i s/peer/trust/g /var/lib/pgsql/9.3/data/pg_hba.conf
++ cat /opt/dbvm_scripts/files/postgresql93.conf.append
++ echo 'host all all 20.20.20.0/24 trust'
++ echo 'host all all 192.168.100.0/24 trust'
++ echo 500 64000 400 512
++ service postgresql-9.3 start
Starting postgresql-9.3 service: [ OK ]
++ sleep 20
++ cd /opt/SPECjAppServer2004/schema/postgresql/
++ sed -i s/postgres/dbstore/g sql/create_tablespace.sql
++ service postgresql-9.3 stop
Stopping postgresql-9.3 service: [ OK ]
++ sleep 20
++ service postgresql-9.3 start
Starting postgresql-9.3 service: [ OK ]
++ ./buildall.sh
CREATE TABLESPACE
dropdb: database removal failed: ERROR: database "specdb" does not exist
SET
ERROR: table "c_customerinventory" does not exist
CREATE TABLE
CREATE INDEX
ERROR: table "c_customer" does not exist
CREATE TABLE
ERROR: table "c_supplier" does not exist
CREATE TABLE
ERROR: table "c_site" does not exist
CREATE TABLE
ERROR: table "c_parts" does not exist
CREATE TABLE
SET
ERROR: table "m_parts" does not exist
CREATE TABLE
ERROR: table "m_bom" does not exist
CREATE TABLE
ERROR: table "m_workorder" does not exist
CREATE TABLE
ERROR: table "m_largeorder" does not exist
CREATE TABLE
CREATE INDEX
CREATE INDEX
ERROR: table "m_inventory" does not exist
CREATE TABLE
SET
ERROR: table "o_orders" does not exist
CREATE TABLE
CREATE INDEX
ERROR: table "o_orderline" does not exist
CREATE TABLE
ERROR: table "o_item" does not exist
CREATE TABLE
CREATE INDEX
SET
ERROR: table "s_component" does not exist
CREATE TABLE
ERROR: table "s_supp_component" does not exist
CREATE TABLE
ERROR: table "s_supplier" does not exist
CREATE TABLE
ERROR: table "s_site" does not exist
CREATE TABLE
ERROR: table "s_purchase_order" does not exist
CREATE TABLE
ERROR: table "s_purchase_orderline" does not exist
CREATE TABLE
SET
ERROR: table "txn_log_table" does not exist
CREATE TABLE
SET
ERROR: table "u_sequences" does not exist
CREATE TABLE
SET
ALTER TABLE
ERROR: multiple primary keys for table "c_customer" are not allowed
ERROR: multiple primary keys for table "c_customerinventory" are not allowed
ERROR: multiple primary keys for table "c_parts" are not allowed
ERROR: multiple primary keys for table "c_site" are not allowed
ERROR: multiple primary keys for table "c_supplier" are not allowed
ERROR: multiple primary keys for table "m_bom" are not allowed
ERROR: multiple primary keys for table "m_inventory" are not allowed
ERROR: multiple primary keys for table "m_largeorder" are not allowed
ERROR: multiple primary keys for table "m_parts" are not allowed
ERROR: multiple primary keys for table "m_workorder" are not allowed
ERROR: multiple primary keys for table "o_item" are not allowed
ERROR: multiple primary keys for table "o_orderline" are not allowed
ERROR: multiple primary keys for table "o_orders" are not allowed
ERROR: multiple primary keys for table "s_component" are not allowed
ERROR: multiple primary keys for table "s_purchase_order" are not allowed
ERROR: multiple primary keys for table "s_purchase_orderline" are not allowed
ERROR: multiple primary keys for table "s_site" are not allowed
ERROR: multiple primary keys for table "s_supp_component" are not allowed
ERROR: multiple primary keys for table "s_supplier" are not allowed
ERROR: multiple primary keys for table "txn_log_table" are not allowed
ERROR: multiple primary keys for table "u_sequences" are not allowed
ERROR: relation "c_custci_idx" already exists
ERROR: relation "m_lo_cat_idx" already exists
ERROR: relation "m_lo_o_idx" already exists
ERROR: relation "o_icat_idx" already exists
ERROR: relation "o_oc_idx" already exists
REVOKE
REVOKE
GRANT
GRANT
++ echo JAVA_HOME=/usr/lib/jvm/jre
++ echo 'export JAVA_HOME'
++ echo 'PATH=${JAVA_HOME}/bin:$PATH'
++ echo 'export PATH'
++ echo 'java -jar /opt/SPECpoll/pollme.jar -n `hostname`-int -p 8001 > /tmp/pollme.out 2>&1&'
++ /opt/dbvm_scripts/ostune.sh
Reverting to saved sysctl settings: [ OK ]
Calling '/etc/ktune.d/tunedadm.sh stop': [ OK ]
Reverting to cfq elevator: dm-0 dm-1 vda vdb [ OK ]
Stopping tuned: [ OK ]
Switching to profile 'virtual-guest'
Applying deadline elevator: dm-0 dm-1 vda vdb [ OK ]
Applying ktune sysctl settings:
/etc/ktune.d/tunedadm.conf: [ OK ]
Calling '/etc/ktune.d/tunedadm.sh start': [ OK ]
Applying sysctl settings from /etc/sysctl.d/libvirtd
Applying sysctl settings from /etc/sysctl.conf
Starting tuned: [ OK ]
++ set +x
'Dababase' 카테고리의 다른 글
Installation gflags on Ubuntu 14.04 (0) | 2017.05.31 |
---|---|
rocksdb error (0) | 2016.03.03 |
port forwarding (0) | 2016.02.02 |
examplie: test application for rocksdb compile (0) | 2015.07.18 |
Rocks DB 설치 on Ubuntu 12.04 LTS (0) | 2015.07.18 |
KVM on ubuntu
bridge setting
- click the (i) button on right side from monitor icon.
- add virtual NIC
- eth0 is for virbr0 (default), eth1 is for br0 (network bridge)
인터넷도 하면서 내부통신이 가능하다.
'virtualization' 카테고리의 다른 글
KVM xml 에디트 (0) | 2016.03.22 |
---|---|
SPEC virt working history (0) | 2016.02.09 |
kvm bridge on ubuntu (0) | 2016.01.28 |
ESXi remote shell 설정 (ESXi 5.5) (0) | 2015.11.12 |
ESX (0) | 2015.11.07 |
port forwarding
윈도우 포트 포워딩 아이피타임 http://myplace.iptime.org/?c=inform_menu/4&uid=53
우분투 포트 포워딩 http://redeyesofangel.tistory.com/722
'Dababase' 카테고리의 다른 글
rocksdb error (0) | 2016.03.03 |
---|---|
postgresql 9.3 on SpecVirt 작업 일지 (0) | 2016.02.05 |
examplie: test application for rocksdb compile (0) | 2015.07.18 |
Rocks DB 설치 on Ubuntu 12.04 LTS (0) | 2015.07.18 |
Installing gflags 12.04 (0) | 2015.07.17 |
kvm bridge on ubuntu
http://4008.tistory.com/50
http://skylit.tistory.com/116 --> virbr0 다시 살리는 방법 on 우분투 desktop
'virtualization' 카테고리의 다른 글
KVM xml 에디트 (0) | 2016.03.22 |
---|---|
SPEC virt working history (0) | 2016.02.09 |
KVM on ubuntu (0) | 2016.02.03 |
ESXi remote shell 설정 (ESXi 5.5) (0) | 2015.11.12 |
ESX (0) | 2015.11.07 |
***********************************************************************
@: decorator
- 원본 클래스가 있을때, 클래스에 추가 함수를 붙임. 원본 클래스에 손상 없이 추가 함수만을 이용하여 추가 기능을 사용할 수 있음.
*** example ***
class Verbose:
def __init__(self, f):
print "Initializing Verbose."
self.func = f;
def __call__(self):
print "Begin", self.func.__name__
self.func();
print "End", self.func.__name__
@Verbose
def my_function():
print "hello, world."
print "Program start"
my_function();
*** result ***
$ python decorator_test.py
Initializing Verbose
Program start
Begin my_func
hello, world
End my_func
***********************************************************************
yield
static과 동일함.
***********************************************************************
딕셔너리 : {key1:value1, key2:value2}
리스트 : [value1, value2]
튜플 : constant list -- (value1, value2), (value1,) -- 한개 있는 것은 콤마를 찍어줘야 함
'python' 카테고리의 다른 글
study 1 day (0) | 2016.05.10 |
---|
spark wordcount test
spark-1.3.1
./conf/spark-defaults.conf
--> default 값 세팅
wordcounts = sc.textFile('../wiki_10GB').persist(StorageLevel.MEMORY_ONLY) \
.map( lambda x: x.replace(',',' ').replace('.',' ').replace('-',' ').lower()).persist(StorageLevel.MEMORY_ONLY)\
.flatMap(lambda x: x.split()).persist(StorageLevel.MEMORY_ONLY)\
.map(lambda x: (x, 1)).persist(StorageLevel.MEMORY_ONLY)\
.reduceByKey(lambda x,y:x+y).persist(StorageLevel.MEMORY_ONLY)\
.map(lambda x:(x[1],x[0])).persist(StorageLevel.MEMORY_ONLY) \
.sortByKey(False).persist(StorageLevel.MEMORY_ONLY).saveAsTextFile("./wiki_rdd/rdd7")
spark 1.3.1
****************
* rdd.py *
****************
RDD는 두가지 종류의
class RDD(object):
method:
def saveAsTextFile(self, path, compressionCodecClass=None):
RDD를 text file 형태로 저장한다.
...
class PipelinedRDD(RDD):
RDD를 parallelize 한다
...
'spark' 카테고리의 다른 글
spark source code tag cscope building (0) | 2015.11.20 |
---|---|
PySpark Import Error (0) | 2015.10.14 |
Spark Installation on ubuntu 12.04 (0) | 2015.10.14 |
spark source code tag cscope building
* CSCOPE*
find `pwd` -name "*.xml" -o -name "*.md" -o -name "*.java" -o -name "*.js" -o -name "*.ini" -o -name "*.scala" -o -name "*.sbt" -o -name "*.py" > cscope.files
cscope -b -q -k
*ETAGS*
find `pwd` -name "*.xml" -o -name "*.md" -o -name "*.java" -o -name "*.js" -o -name "*.ini" -o -name "*.scala" -o -name "*.sbt" -o -name "*.py" -print | xargs etags -a
'spark' 카테고리의 다른 글
spark RDD (0) | 2015.11.20 |
---|---|
PySpark Import Error (0) | 2015.10.14 |
Spark Installation on ubuntu 12.04 (0) | 2015.10.14 |
ESXi remote shell 설정 (ESXi 5.5)
Use the vSphere Client to enable local and remote access to the ESXi Shell:
- Log in to a vCenter Server system using the vSphere Client.
- Select the host in the Inventory panel.
- Click the Configuration tab and click Security Profile.
- In the Services section, click Properties.
- Select ESXi Shell from this list:
ESXi Shell
SSH
Direct Console UI - Click Options and select Start and stop manually.
Note: When you select Start and stop manually, the service does not start when you reboot the host. If you want the service to start when you reboot the host, select Start and stop with host. - Click Start to enable the service.
- Click OK.
'virtualization' 카테고리의 다른 글
KVM xml 에디트 (0) | 2016.03.22 |
---|---|
SPEC virt working history (0) | 2016.02.09 |
KVM on ubuntu (0) | 2016.02.03 |
kvm bridge on ubuntu (0) | 2016.01.28 |
ESX (0) | 2015.11.07 |
ESX
https://www.youtube.com/watch?v=HtNJD5cDpL8
'virtualization' 카테고리의 다른 글
KVM xml 에디트 (0) | 2016.03.22 |
---|---|
SPEC virt working history (0) | 2016.02.09 |
KVM on ubuntu (0) | 2016.02.03 |
kvm bridge on ubuntu (0) | 2016.01.28 |
ESXi remote shell 설정 (ESXi 5.5) (0) | 2015.11.12 |
[shell] find 사용법
간단한 find 사용법 메모
1. /home/backup 폴더에서
출처:http://kin.naver.com/qna/detail.nhn?d1id=1&dirId=10302&docId=221797336&qb=66as64iF7Iqk66qF66C57Ja0IOyYteyFmCDrp4jsnbTrhIjsiqQg65GQ6rCc&enc=utf8§ion=kin&rank=1&search_sort=0&spq=0&pid=SBPWGdoRR1ossbayg1lsssssstG-433712&sid=9qJfBk%2BkUtwT6RUfzv87Ng%3D%3D
'shell' 카테고리의 다른 글
scale bc 사용법 (0) | 2016.04.20 |
---|---|
time -o (--output=) 사용법 in Ubuntu 12.04 (0) | 2016.03.19 |
while read a를 이용한 화면출력 및 저장 및 파일 만들기 (0) | 2015.10.14 |
강제 umount 방법
강제 언마운트
fuser -ck mountdir
해당 마운트 포인트를 사용하는 user 찾기
fuser -cu mountdir
'Linux Kernel' 카테고리의 다른 글
sysinfo 관련 (0) | 2016.02.26 |
---|---|
ubuntu 12.04 kernel compile (0) | 2016.02.25 |
[ubuntu 12.04] grub 메모리 크기 변경 (0) | 2015.10.22 |
LXC 관련 자료 (0) | 2015.10.17 |
ZEST [thezest] 사용법 (0) | 2015.10.16 |
[ubuntu 12.04] grub 메모리 크기 변경
ubuntu 12.04 LTS 기준
1. open /etc/default/grub
2. 다음과 같이 수정
GRUB_DEFAULT=2 GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="memmap=224G\\\$34G" GRUB_CMDLINE_LINUX="" |
224GB --> 34GB 로 줄임.
3. sudo update-grub
완료
'Linux Kernel' 카테고리의 다른 글
ubuntu 12.04 kernel compile (0) | 2016.02.25 |
---|---|
강제 umount 방법 (0) | 2015.10.22 |
LXC 관련 자료 (0) | 2015.10.17 |
ZEST [thezest] 사용법 (0) | 2015.10.16 |
qemu 설치및 사용 (0) | 2015.10.16 |
LXC 관련 자료
internals
http://www.slideshare.net/BodenRussell/realizing-linux-containerslxc?related=1
performance evaluation
http://www.slideshare.net/BodenRussell/kvm-and-docker-lxc-benchmarking-with-openstack
basics
http://www.slideshare.net/Flux7Labs/performance-of-docker-vs-vms?related=1
security
http://www.slideshare.net/jpetazzo/linux-containers-lxc-docker-and-security?related=2
'Linux Kernel' 카테고리의 다른 글
강제 umount 방법 (0) | 2015.10.22 |
---|---|
[ubuntu 12.04] grub 메모리 크기 변경 (0) | 2015.10.22 |
ZEST [thezest] 사용법 (0) | 2015.10.16 |
qemu 설치및 사용 (0) | 2015.10.16 |
permanent 환경변수 설정 on ubuntu 12.04 (0) | 2015.10.14 |
ZEST [thezest] 사용법
1. zest 2.0 download
https://code.google.com/p/thezest/downloads/list
2. 압축풀기 및 설치
3. 실행
--> zest2.0/scripts
sudo ./capture.py # temp 폴더에 전체 메모리 덤프 이미지 파일 생성
./analyze.py # 분석
'Linux Kernel' 카테고리의 다른 글
[ubuntu 12.04] grub 메모리 크기 변경 (0) | 2015.10.22 |
---|---|
LXC 관련 자료 (0) | 2015.10.17 |
qemu 설치및 사용 (0) | 2015.10.16 |
permanent 환경변수 설정 on ubuntu 12.04 (0) | 2015.10.14 |
etags (0) | 2015.07.21 |
qemu 설치및 사용
소스다운 --> ./configure --> sudo make --> sudo make install
만일 yak, bison, flex 등이 없다면 DO ! apt-get
1. 이미지 만들기
qemu-img create -f vdi userver.img 4G
2. 우분투 설치
qemu-system-i386 -cdrom ubuntu-12.04.5-server-i386.iso -k en-us userver.img -boot d
3. 우분투 실행
qemu-system-i386 -k en-us userver.img
4. FYI
만일 설치중 Loading apt-cdrom-setup failed for unknown reasons 일경우,
설치 메모리가 부족해서 생기는 에러일 가능성이 높음. reboot 후
(2)에서 -m 1024 옵션을 붙여서 사용할것
'Linux Kernel' 카테고리의 다른 글
LXC 관련 자료 (0) | 2015.10.17 |
---|---|
ZEST [thezest] 사용법 (0) | 2015.10.16 |
permanent 환경변수 설정 on ubuntu 12.04 (0) | 2015.10.14 |
etags (0) | 2015.07.21 |
ldconfig deferred processing now taking place? (0) | 2015.07.18 |
permanent 환경변수 설정 on ubuntu 12.04
export 확인
환경 변수가 제대로 설정이 되어 있지 않을 경우,
1. /etc/environment 열기
2. 환경 변수 추가
3. source environment
완료
'Linux Kernel' 카테고리의 다른 글
LXC 관련 자료 (0) | 2015.10.17 |
---|---|
ZEST [thezest] 사용법 (0) | 2015.10.16 |
qemu 설치및 사용 (0) | 2015.10.16 |
etags (0) | 2015.07.21 |
ldconfig deferred processing now taking place? (0) | 2015.07.18 |