






ubuntu@ip-172-31-3-158:~$ sudo apt update -y
ubuntu@ip-172-31-3-158:~$ sudo apt upgrade -y
# 데스크톱용 계정 생성
# 패스워드 외 그냥 엔터
ubuntu@ip-172-31-3-158:~$ sudo adduser yjh
Adding user `yjh' ...
Adding new group `yjh' (1001) ...
Adding new user `yjh' (1001) with group `yjh' ...
Creating home directory `/home/yjh' ...
Copying files from `/etc/skel' ...
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for yjh
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] Y
# sudo 그룹에 계정 추가
ubuntu@ip-172-31-3-158:~$ sudo gpasswd -a yjh sudo
# desktop 환경 설치
ubuntu@ip-172-31-3-158:~$ sudo apt -y install ubuntu-desktop
ubuntu@ip-172-31-3-158:~$ sudo apt install -y xrdp
# new cursor 무효화
ubuntu@ip-172-31-3-158:~$ sudo sed -e 's/^new_cursors=true/new_cursors=false/g' -i /etc/xrdp/xrdp.ini
ubuntu@ip-172-31-3-158:~$ sudo systemctl restart xrdp
ubuntu@ip-172-31-3-158:~$ sudo systemctl enable xrdp.service
ubuntu@ip-172-31-3-158:~$ systemctl list-unit-files -t service |grep xrdp
xrdp-sesman.service enabled enabled
xrdp.service enabled enabled
# xsession 파일 작성
ubuntu@ip-172-31-3-158:~$ su yjh
Password:
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
yjh@ip-172-31-3-158:/home/ubuntu$ cd
yjh@ip-172-31-3-158:~$ DESKTOP=/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop/
yjh@ip-172-31-3-158:~$ cat <<EOF > ~/.xsessionrc
> export GNOME_SHELL_SESSION_MODE=ubuntu
> export XDG_CURRENT_DESKTOP=ubuntu:GNOME
> export XDG_DATA_DIRS=${DESKTOP}
> export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
> EOF
# Authentication Required 다이어로그를 회피
yjh@ip-172-31-3-158:~$ cat <<EOF | sudo tee /etc/polkit-1/localauthority/50-local.d/xrdp-color-manager.pkla
> [Networkmanager]
> Identity=unix-user:*
> Action=org.freedesktop.color-manager.create-device
> ResultAny=no
> ResultInactive=no
> ResultActive=yes
> EOF
[sudo] password for yjh:
[Networkmanager]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device
ResultAny=no
ResultInactive=no
ResultActive=yes


원격 데스크톱 접속
라이브러리 설치
ubuntu@ip-172-31-3-158:~$ sudo apt install net-tools
yjh@ip-172-31-3-158:~Desktop$ sudo apt-get install openjdk-11-jdk
yjh@ip-172-31-3-158:~Desktop$ java -version



yjh@ip-172-31-3-158:~$ vim .bashrc
export CONFLUENT_HOME=/home/yjh/confluent
export PATH=:$PATH:$CONFLUENT_HOME/bin
# :wq
yjh@ip-172-31-3-158:~$ echo $CONFLUENT_HOME
/home/yjh/confluentyjh@ip-172-31-3-158:~/confluent$ vi zoo_start.sh
$CONFLUENT_HOME/bin/zookeeper-server-start $CONFLUENT_HOME/etc/kafka/zookeeper.properties
yjh@ip-172-31-3-158:~/confluent$ sh zoo_start.sh
yjh@ip-172-31-3-158:~/confluent$ vi kafka_start.sh
$CONFLUENT_HOME/bin/kafka-server-start $CONFLUENT_HOME/etc/kafka/server.properties
yjh@ip-172-31-3-158:~/confluent$ sh kafka_start.sh
kafka-server-stop / zookeeper-server-stop 스크립트 사용ctrl + c 로 종료중 택 1
Default 설정대로 하면 VM 재기동 시 /tmp/kafka-logs, 리소스 등 삭제 처리가 된다.
yjh@ip-172-31-3-158:~$ mkdir data
yjh@ip-172-31-3-158:~$ cd data
yjh@ip-172-31-3-158:~/data$ mkdir kafka-logs
yjh@ip-172-31-3-158:~/data$ cd kafka-logs/
yjh@ip-172-31-3-158:~/data/kafka-logs$ pwd
/home/yjh/data/kafka-logs
yjh@ip-172-31-3-158:~/data$ mkdir zookeeper
yjh@ip-172-31-3-158:~/data$ cd zookeeper/
yjh@ip-172-31-3-158:~/data/zookeeper$ pwd
/home/yjh/data/zookeeper
yjh@ip-172-31-3-158:~/data/kafka-logs$ cd $CONFLUENT_HOME/etc/kafka
yjh@ip-172-31-3-158:~/confluent/etc/kafka$ vim server.properties
log.dirs=/home/yjh/data/kafka-logs
yjh@ip-172-31-3-158:~/confluent/etc/kafka$ vim zookeeper.properties
dataDir=/home/yjh/data/zookeeper

