Skip to content

Commit

Permalink
[BE] feat : EC2-RDS 서버 배포 성공
Browse files Browse the repository at this point in the history
- IPv4 : 52.78.52.252
- RDS : airbnb-rds.ct12sp1kygt2.ap-northeast-2.rds.amazonaws.com
- CSV 파일은 수동으로 넣어주어야 한다
  - 수동으로 매번 넣기 힘들기 때문에 한 번 넣어주고 그 뒤로 테이블을 DROP 하지 않는다

- issue : #74
  • Loading branch information
hanurii committed May 27, 2020
1 parent 9ad9b35 commit fa8b05b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 21 deletions.
4 changes: 2 additions & 2 deletions be/out/production/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ spring.datasource.data=classpath:schema.sql, classpath:data.sql

# RDS mySQL 연결
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.url=jdbc:mysql://3.34.93.158:3306/airbnb_a
#spring.datasource.url=jdbc:mysql://airbnb-rds.ct12sp1kygt2.ap-northeast-2.rds.amazonaws.com:3306/airbnb
#spring.datasource.username=admin
#spring.datasource.password=12341234
#spring.datasource.initialization-mode=always
#spring.datasource.data=classpath:schema.sql,classpath:data.sql
#spring.datasource.data=classpath:schema.sql
#spring.datasource.initialization-mode=embedded

# application.properties
Expand Down
1 change: 0 additions & 1 deletion be/out/production/resources/data/properties_detail.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<<<<<<< HEAD
id,summary,space,city_overview,notes,transit,host_name,host_since,host_location,host_about,address,accommodates,bathrooms,bedrooms,beds,bed_type,amenities,service_fee,cleaning_fee,tax,review_scores_accuracy,review_scores_cleanliness,review_scores_checkin,review_scores_communication,review_scores_location,review_scores_value
1,"Chemically sensitive? We've removed the irritants triggering allergy or asthma attacks, like carpeting, forced air & used pillows, all culprits that harbor fungus, mold & bacteria. No smoking, no pets. Designed for healthy living, so breathe easy.","Beautiful, hypoallergenic apartment in an extremely safe, quiet and pedestrian-friendly section of Queen Anne. A leafy-green location that puts the best of Seattle at your doorstep. Free WiFi, free parking, ...even free pillows! What's special about this place? Hypo-allergenic bedding, mattresses/covers and new pillows with each rental. (So feel free to take your new pillows with you!) A beautiful restoration mixing period details & modern sensibilities: Hardwood floors throughout, white subway tile, low/no VOCs & non-toxic paints keep this home-away-from-home clean, smart and healthy. Radiant heat and oil radiators mean no blowing hot air or dust. Great Amenities: Free WiFi & internet TV (LED flatscreen). Fully-equipped kitchen with stainless-steel appliances, sink & disposal. Large washer & dryer. Iron/ironing board. Hairdryer. Plenty of storage. Convenient parking, both on- and off-street. The Best Location: Enjoy Seattle's celebrated Macrina bakery, neighborhood cafes, boutiqu","Queen Anne is a wonderful, truly functional village. You can walk everywhere... for coffee, for groceries, for a night out, for breathtaking views of the Puget Sound.","What's up with the free pillows? Our home was renovated and restored with health & safety in mind, especially the elimination/reduction of indoor allergens, toxins & other pollutants. (For this reason, we have no carpets, just hardwood & slate floors, with radiant heat.) Pillows tend to house a LOT of allergens over time, even when just used by a single owner. The statistics make many people feel pretty queasy but, essentially, pillows become great breeding grounds for bacteria and dust mites, not to mention drool, hair oils and perspiration. Since most people sweat more than a pint a night, the pillow can also easily trap mildew and mold. We use dust mite protectors for mattresses and duvets, but haven't found any that work well for pillows that maintain comfort/elasticity without the use of outgassing materials. So, I let the guests take their pillows but ask that they leave the pillowcases. And if you leave the pillows behind, they'll be donated to a local women's shelter that ","Convenient bus stops are just down the block, if you're headed downtown or further afield to explore. Zip cars are also strategically located on Queen Anne hill.",Andrea,2013-02-21,"Seattle, Washington, United States",Living east coast/left coast/overseas. Time is short & it's a big world. ,"7th Avenue West, Seattle, WA 98119, United States",4,1,1,1,Real Bed,"{TV,Internet,""Wireless Internet"",Kitchen,""Free Parking on Premises"",""Buzzer/Wireless Intercom"",Heating,""Family/Kid Friendly"",Washer,Dryer,""Smoke Detector"",""Carbon Monoxide Detector"",""First Aid Kit"",""Safety Card"",""Fire Extinguisher"",Essentials}",100.00,40.00,15.00,5,5,5,5,5,5
2,"Our tiny cabin is private , very quiet and comfortable spot just for two. The bus is just across the street. Queen Anne ,Ballard and Downtown are a short bus ride. High Speed WI-FI. The bathroom is shared by our guests ."," This cabin was built with Airbnb in mind, Queen bed with gel foam topper 110 heat with thermostat . Cherry hardwood floors . Oak bed frame and night stand . This cabin is very well insulated and is warm and quiet . The bathroom and shower is located in our house just a few steps away. There is plenty of street parking all around us. Bus line just a half block away. Just a ten minute bus ride to Pike Place Market. Private large back yard we have chickens that live there too. In the spring and summer the garden is a sight to see. If you want a private stay in a nice space this is it. Food within walking distance ,sculpture park is pretty close as well. -What you get- your own private space! use of a shared bathroom (for our guests) we have our own. our back yard and garden. clean towels wi-fi fan and heater. We do NOT offer our kitchen.",We are centrally located between Downtown and ballard with a Whole Foods right across the street.,There are three rentals in our back yard . If you are not ok with sharing .. this is not the rental for you. NOW WITH High speed WI-FI !,"the ""D"" line runs out in front of our house . ",Jean-Marc,2012-10-30,"Seattle, Washington, United States","I am a carpenter at heart , I love music , I play the drum's and a bit of guitar, I have two children one 23 and the other is 4 ! I am a home body that dreams of traveling lol ! My wife and I love to make things, she does the sewing and even spins her own yarn . ","West Wheeler Street, Seattle, WA 98119, United States",2,1,1,1,Real Bed,"{""Wireless Internet"",""Pets live on this property"",Dog(s),Heating,""Family/Kid Friendly"",Essentials,Shampoo}",150.00,25.00,6.00,5,5,5,5,4.5,5
Expand Down
24 changes: 12 additions & 12 deletions be/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ logging.level.sql=info;
logging.level.dev.codesquad.java.baseball08=info;

## ec2 mySQL 연결
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://52.78.52.252:3306/airbnb
spring.datasource.username=airbnb
spring.datasource.password=airbnb
spring.datasource.initialization-mode=always
spring.datasource.data=classpath:schema.sql, classpath:data.sql
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.url=jdbc:mysql://52.78.52.252:3306/airbnb
#spring.datasource.username=airbnb
#spring.datasource.password=airbnb
#spring.datasource.initialization-mode=always
#spring.datasource.data=classpath:schema.sql, classpath:data.sql
#spring.datasource.initialization-mode=embedded

# RDS mySQL 연결
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.url=jdbc:mysql://3.34.93.158:3306/airbnb_a
#spring.datasource.username=admin
#spring.datasource.password=12341234
#spring.datasource.initialization-mode=always
#spring.datasource.data=classpath:schema.sql,classpath:data.sql
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://airbnb-rds.ct12sp1kygt2.ap-northeast-2.rds.amazonaws.com:3306/airbnb
spring.datasource.username=admin
spring.datasource.password=12341234
spring.datasource.initialization-mode=always
spring.datasource.data=classpath:schema.sql
#spring.datasource.initialization-mode=embedded

# application.properties
Expand Down
6 changes: 3 additions & 3 deletions be/src/main/resources/data.sql
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
LOAD DATA INFILE 'properties.csv'
LOAD DATA LOCAL INFILE '/home/ubuntu/properties.csv'
INTO TABLE airbnb.properties
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS
(id,host_type,title,city,state,latitude,longitude,reservable,price,place_type,review_average,number_of_reviews,saved);

LOAD DATA INFILE 'properties_detail.csv'
LOAD DATA LOCAL INFILE '/home/ubuntu/properties_detail.csv'
INTO TABLE airbnb.detail
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;

LOAD DATA INFILE 'images.csv'
LOAD DATA LOCAL INFILE '/home/ubuntu/images.csv'
INTO TABLE airbnb.images
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
Expand Down
3 changes: 0 additions & 3 deletions be/src/main/resources/schema.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
drop table if exists calendar;
drop table if exists images;
drop table if exists bookmarks;
drop table if exists detail;
drop table if exists user;
drop table if exists bookings;
drop table if exists properties;

create table if not exists properties
(
Expand Down

0 comments on commit fa8b05b

Please sign in to comment.